Update ooo320-m1
[ooovba.git] / dtrans / source / win32 / clipb / WinClipbImpl.hxx
blob1ca72409b611d259818454c3431bfe7181d61b24
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: WinClipbImpl.hxx,v $
10 * $Revision: 1.12 $
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 _WINCLIPBIMPL_HXX_
33 #define _WINCLIPBIMPL_HXX_
35 //------------------------------------------------------------------------
36 // includes
37 //------------------------------------------------------------------------
39 #include <sal/types.h>
40 #include <rtl/ustring.hxx>
41 #include <com/sun/star/datatransfer/XTransferable.hpp>
42 #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
43 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
44 #include "..\..\inc\MtaOleClipb.hxx"
46 #if defined _MSC_VER
47 #pragma warning(push,1)
48 #endif
49 #include <windows.h>
50 #if defined _MSC_VER
51 #pragma warning(pop)
52 #endif
54 class CWinClipboard;
55 class CXNotifyingDataObject;
57 //---------------------------------------------------
58 // impl class to avoid deadlocks between XTDataObject
59 // and the clipboard implementation
60 //---------------------------------------------------
62 class CWinClipbImpl
64 public:
65 ~CWinClipbImpl( );
67 protected:
68 CWinClipbImpl( const ::rtl::OUString& aClipboardName, CWinClipboard* theWinClipboard );
70 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents( )
71 throw( ::com::sun::star::uno::RuntimeException );
73 void SAL_CALL setContents(
74 const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
75 const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
76 throw( ::com::sun::star::uno::RuntimeException );
78 ::rtl::OUString SAL_CALL getName( ) throw( ::com::sun::star::uno::RuntimeException );
80 //------------------------------------------------
81 // XClipboardEx
82 //------------------------------------------------
84 sal_Int8 SAL_CALL getRenderingCapabilities( ) throw( ::com::sun::star::uno::RuntimeException );
86 //------------------------------------------------
87 // XFlushableClipboard
88 //------------------------------------------------
90 void SAL_CALL flushClipboard( ) throw( com::sun::star::uno::RuntimeException );
92 //------------------------------------------------
93 // XComponent
94 //------------------------------------------------
96 void SAL_CALL dispose( ) throw( ::com::sun::star::uno::RuntimeException );
98 //------------------------------------------------
99 // member functions
100 //------------------------------------------------
102 void SAL_CALL registerClipboardViewer( );
103 void SAL_CALL unregisterClipboardViewer( );
105 static void WINAPI onClipboardContentChanged( void );
107 private:
108 void SAL_CALL onReleaseDataObject( CXNotifyingDataObject* theCaller );
110 private:
111 ::rtl::OUString m_itsName;
112 CMtaOleClipboard m_MtaOleClipboard;
113 CWinClipboard* m_pWinClipboard;
114 CXNotifyingDataObject* m_pCurrentClipContent;
115 osl::Mutex m_ClipContentMutex;
117 static osl::Mutex s_aMutex;
118 static CWinClipbImpl* s_pCWinClipbImpl;
120 private:
121 CWinClipbImpl( const CWinClipbImpl& );
122 CWinClipbImpl& operator=( const CWinClipbImpl& );
124 friend class CWinClipboard;
125 friend class CXNotifyingDataObject;
128 #endif