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