xref: /AOO41X/main/dtrans/source/os2/clipb/Os2Transferable.hxx (revision 1ac7a910516f5812c8aff83e41fa4f269ea0808c)
1fbcf0fe9SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3fbcf0fe9SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4fbcf0fe9SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5fbcf0fe9SAndrew Rist  * distributed with this work for additional information
6fbcf0fe9SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7fbcf0fe9SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8fbcf0fe9SAndrew Rist  * "License"); you may not use this file except in compliance
9fbcf0fe9SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11fbcf0fe9SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13fbcf0fe9SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14fbcf0fe9SAndrew Rist  * software distributed under the License is distributed on an
15fbcf0fe9SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16fbcf0fe9SAndrew Rist  * KIND, either express or implied.  See the License for the
17fbcf0fe9SAndrew Rist  * specific language governing permissions and limitations
18fbcf0fe9SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20fbcf0fe9SAndrew Rist  *************************************************************/
21fbcf0fe9SAndrew Rist 
22fbcf0fe9SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _DTRANS_OS2_TRANSFERABLE_HXX_
25cdf0e10cSrcweir #define _DTRANS_OS2_TRANSFERABLE_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/datatransfer/XTransferable.hpp>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HDL_
30cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
33cdf0e10cSrcweir #include <osl/thread.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <errno.h>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <uclip.h>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer
40cdf0e10cSrcweir 
41*1ac7a910SYuri Dario #if OSL_DEBUG_LEVEL>10
42*1ac7a910SYuri Dario extern "C" int debug_printf(const char *f, ...);
43cdf0e10cSrcweir #else
44cdf0e10cSrcweir #define debug_printf( ...) { 1; }
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #define CPPUTYPE_SEQSALINT8		  getCppuType( (const Sequence< sal_Int8 >*) 0 )
48cdf0e10cSrcweir #define CPPUTYPE_DEFAULT		  CPPUTYPE_SEQSALINT8
49cdf0e10cSrcweir 
50a7e9c4d8SPedro Giffuni using namespace com::sun::star::uno;
51a7e9c4d8SPedro Giffuni HBITMAP	OOoBmpToOS2Handle( Any &aAnyB);
52a7e9c4d8SPedro Giffuni int	OS2HandleToOOoBmp( HBITMAP hbm, Sequence< sal_Int8 >* winDIBStream);
53a7e9c4d8SPedro Giffuni 
54cdf0e10cSrcweir namespace os2 {
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	class Os2Transferable : public ::cppu::WeakImplHelper1 <
57cdf0e10cSrcweir 		::com::sun::star::datatransfer::XTransferable >
58cdf0e10cSrcweir 	{
59cdf0e10cSrcweir 		HAB			hAB;
60cdf0e10cSrcweir 		::rtl::OUString	clipText;
61cdf0e10cSrcweir 		::com::sun::star::datatransfer::DataFlavor aFlavor;
62cdf0e10cSrcweir 		::osl::Mutex m_aMutex;
63cdf0e10cSrcweir 		::com::sun::star::uno::Reference< XInterface >			m_xCreator;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	public:
66cdf0e10cSrcweir         Os2Transferable( const ::com::sun::star::uno::Reference< XInterface >& xCreator);
67cdf0e10cSrcweir 		virtual ~Os2Transferable();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 		/*
70cdf0e10cSrcweir 		 * XTransferable
71cdf0e10cSrcweir 		 */
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
74cdf0e10cSrcweir 			throw(::com::sun::star::datatransfer::UnsupportedFlavorException,
75cdf0e10cSrcweir 				  ::com::sun::star::io::IOException,
76cdf0e10cSrcweir 				  ::com::sun::star::uno::RuntimeException
77cdf0e10cSrcweir 				  );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors(  )
80cdf0e10cSrcweir 			throw(::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
83cdf0e10cSrcweir 			throw(::com::sun::star::uno::RuntimeException);
84cdf0e10cSrcweir 	};
85cdf0e10cSrcweir 
86cdf0e10cSrcweir } // namespace
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif
89cdf0e10cSrcweir 
90