merge the formfield patch from ooo-build
[ooovba.git] / vcl / aqua / source / dtrans / OSXTransferable.hxx
blob41ff89232e669a72e96fc83aa674e89375c129a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OSXTransferable.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _TRANSFERABLE_HXX_
33 #define _TRANSFERABLE_HXX_
35 //------------------------------------------------------------------------
36 // includes
37 //------------------------------------------------------------------------
39 #include <com/sun/star/datatransfer/XTransferable.hpp>
40 #include <cppuhelper/implbase1.hxx>
41 #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
42 #include <com/sun/star/datatransfer/XMimeContentType.hpp>
44 #include "DataFlavorMapping.hxx"
46 #include <premac.h>
47 #import <Cocoa/Cocoa.h>
48 #include <postmac.h>
50 #include <boost/shared_ptr.hpp>
51 #include <boost/utility.hpp>
52 #include <vector>
55 class OSXTransferable : public ::cppu::WeakImplHelper1<com::sun::star::datatransfer::XTransferable>,
56 private ::boost::noncopyable
58 public:
59 typedef com::sun::star::uno::Sequence< sal_Int8 > ByteSequence_t;
61 explicit OSXTransferable(com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XMimeContentTypeFactory> rXMimeCntFactory,
62 DataFlavorMapperPtr_t pDataFlavorMapper,
63 NSPasteboard* pasteboard);
65 virtual ~OSXTransferable();
67 //------------------------------------------------------------------------
68 // XTransferable
69 //------------------------------------------------------------------------
71 virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
72 throw( ::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
74 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
75 throw( ::com::sun::star::uno::RuntimeException );
77 virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
78 throw( ::com::sun::star::uno::RuntimeException );
80 //------------------------------------------------------------------------
81 // Helper functions not part of the XTransferable interface
82 //------------------------------------------------------------------------
84 void initClipboardItemList();
86 //com::sun::star::uno::Any getClipboardItemData(ClipboardItemPtr_t clipboardItem);
88 bool isUnicodeText(const com::sun::star::datatransfer::DataFlavor& flavor);
90 bool compareDataFlavors( const com::sun::star::datatransfer::DataFlavor& lhs,
91 const com::sun::star::datatransfer::DataFlavor& rhs );
93 bool cmpAllContentTypeParameter( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType > xLhs,
94 const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType > xRhs ) const;
96 private:
97 com::sun::star::uno::Sequence< com::sun::star::datatransfer::DataFlavor > mFlavorList;
98 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory;
99 DataFlavorMapperPtr_t mDataFlavorMapper;
100 NSPasteboard* mPasteboard;
103 #endif