2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-07-05 08:10:32 +00:00
|
|
|
|
2014-05-15 12:06:32 +02:00
|
|
|
#ifndef INCLUDED_VCL_OSX_OSXTRANSFERABLE_HXX
|
|
|
|
#define INCLUDED_VCL_OSX_OSXTRANSFERABLE_HXX
|
2007-07-05 08:10:32 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/datatransfer/XTransferable.hpp>
|
2015-09-11 10:37:30 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2007-07-05 08:10:32 +00:00
|
|
|
#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
|
|
|
|
#include <com/sun/star/datatransfer/XMimeContentType.hpp>
|
|
|
|
|
|
|
|
#include "DataFlavorMapping.hxx"
|
|
|
|
|
|
|
|
#include <premac.h>
|
2008-02-18 13:49:24 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2007-07-05 08:10:32 +00:00
|
|
|
#include <postmac.h>
|
|
|
|
|
2015-09-24 02:02:59 +01:00
|
|
|
#include <memory>
|
2007-07-05 08:10:32 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2016-04-13 10:11:37 +02:00
|
|
|
class OSXTransferable : public ::cppu::WeakImplHelper<css::datatransfer::XTransferable>
|
2007-07-05 08:10:32 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-11-18 10:11:06 +02:00
|
|
|
explicit OSXTransferable(css::uno::Reference< css::datatransfer::XMimeContentTypeFactory> rXMimeCntFactory,
|
2008-02-18 13:49:24 +00:00
|
|
|
DataFlavorMapperPtr_t pDataFlavorMapper,
|
|
|
|
NSPasteboard* pasteboard);
|
2007-07-05 08:10:32 +00:00
|
|
|
|
|
|
|
virtual ~OSXTransferable();
|
2016-04-13 10:11:37 +02:00
|
|
|
OSXTransferable(const OSXTransferable&) = delete;
|
|
|
|
OSXTransferable& operator=(const OSXTransferable&) = delete;
|
2007-07-05 08:10:32 +00:00
|
|
|
|
|
|
|
// XTransferable
|
2014-02-25 22:51:59 +01:00
|
|
|
|
2015-11-18 10:11:06 +02:00
|
|
|
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
|
|
|
|
throw( css::datatransfer::UnsupportedFlavorException, css::io::IOException, css::uno::RuntimeException, std::exception ) override;
|
2007-07-05 08:10:32 +00:00
|
|
|
|
2015-11-18 10:11:06 +02:00
|
|
|
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2007-07-05 08:10:32 +00:00
|
|
|
|
2015-11-18 10:11:06 +02:00
|
|
|
virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& aFlavor )
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2007-07-05 08:10:32 +00:00
|
|
|
|
2008-02-18 13:49:24 +00:00
|
|
|
// Helper functions not part of the XTransferable interface
|
2014-02-25 22:51:59 +01:00
|
|
|
|
2007-07-05 08:10:32 +00:00
|
|
|
void initClipboardItemList();
|
|
|
|
|
2015-11-18 10:11:06 +02:00
|
|
|
//css::uno::Any getClipboardItemData(ClipboardItemPtr_t clipboardItem);
|
2007-07-05 08:10:32 +00:00
|
|
|
|
2015-11-18 10:11:06 +02:00
|
|
|
bool compareDataFlavors( const css::datatransfer::DataFlavor& lhs,
|
|
|
|
const css::datatransfer::DataFlavor& rhs );
|
2007-07-05 08:10:32 +00:00
|
|
|
|
|
|
|
private:
|
2015-11-18 10:11:06 +02:00
|
|
|
css::uno::Sequence< css::datatransfer::DataFlavor > mFlavorList;
|
|
|
|
css::uno::Reference< css::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory;
|
2008-02-18 13:49:24 +00:00
|
|
|
DataFlavorMapperPtr_t mDataFlavorMapper;
|
|
|
|
NSPasteboard* mPasteboard;
|
2007-07-05 08:10:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|