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