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_X11_TRANSFERABLE_HXX_
25 #define _DTRANS_X11_TRANSFERABLE_HXX_
26 
27 #include <X11_selection.hxx>
28 #include <com/sun/star/datatransfer/XTransferable.hpp>
29 
30 #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HDL_
31 #include <com/sun/star/lang/XEventListener.hpp>
32 #endif
33 #include <cppuhelper/implbase1.hxx>
34 
35 namespace x11 {
36 
37 	class X11Transferable : public ::cppu::WeakImplHelper1 <
38 		::com::sun::star::datatransfer::XTransferable >
39 	{
40 		::osl::Mutex m_aMutex;
41 
42 		SelectionManager&				m_rManager;
43 		com::sun::star::uno::Reference< XInterface >			m_xCreator;
44 		Atom				m_aSelection;
45 	public:
46         X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
47 		virtual ~X11Transferable();
48 
49 		/*
50 		 * XTransferable
51 		 */
52 
53 		virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
54 			throw(::com::sun::star::datatransfer::UnsupportedFlavorException,
55 				  ::com::sun::star::io::IOException,
56 				  ::com::sun::star::uno::RuntimeException
57 				  );
58 
59 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors(  )
60 			throw(::com::sun::star::uno::RuntimeException);
61 
62 		virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
63 			throw(::com::sun::star::uno::RuntimeException);
64 	};
65 
66 } // namespace
67 
68 #endif
69