1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: WinClipbImpl.hxx,v $
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 //------------------------------------------------------------------------
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"
47 #pragma warning(push,1)
55 class CXNotifyingDataObject
;
57 //---------------------------------------------------
58 // impl class to avoid deadlocks between XTDataObject
59 // and the clipboard implementation
60 //---------------------------------------------------
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 //------------------------------------------------
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 //------------------------------------------------
94 //------------------------------------------------
96 void SAL_CALL
dispose( ) throw( ::com::sun::star::uno::RuntimeException
);
98 //------------------------------------------------
100 //------------------------------------------------
102 void SAL_CALL
registerClipboardViewer( );
103 void SAL_CALL
unregisterClipboardViewer( );
105 static void WINAPI
onClipboardContentChanged( void );
108 void SAL_CALL
onReleaseDataObject( CXNotifyingDataObject
* theCaller
);
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
;
121 CWinClipbImpl( const CWinClipbImpl
& );
122 CWinClipbImpl
& operator=( const CWinClipbImpl
& );
124 friend class CWinClipboard
;
125 friend class CXNotifyingDataObject
;