1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #ifndef _WINCLIPBIMPL_HXX_
22 #define _WINCLIPBIMPL_HXX_
24 #include <sal/types.h>
25 #include <rtl/ustring.hxx>
26 #include <com/sun/star/datatransfer/XTransferable.hpp>
27 #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
28 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
29 #include "MtaOleClipb.hxx"
32 #pragma warning(push,1)
40 class CXNotifyingDataObject
;
42 //---------------------------------------------------
43 // impl class to avoid deadlocks between XTDataObject
44 // and the clipboard implementation
45 //---------------------------------------------------
53 CWinClipbImpl( const OUString
& aClipboardName
, CWinClipboard
* theWinClipboard
);
55 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
> SAL_CALL
getContents( )
56 throw( ::com::sun::star::uno::RuntimeException
);
58 void SAL_CALL
setContents(
59 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& xTransferable
,
60 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboardOwner
>& xClipboardOwner
)
61 throw( ::com::sun::star::uno::RuntimeException
);
63 OUString SAL_CALL
getName( ) throw( ::com::sun::star::uno::RuntimeException
);
65 //------------------------------------------------
67 //------------------------------------------------
69 sal_Int8 SAL_CALL
getRenderingCapabilities( ) throw( ::com::sun::star::uno::RuntimeException
);
71 //------------------------------------------------
72 // XFlushableClipboard
73 //------------------------------------------------
75 void SAL_CALL
flushClipboard( ) throw( com::sun::star::uno::RuntimeException
);
77 //------------------------------------------------
79 //------------------------------------------------
81 void SAL_CALL
dispose( ) throw( ::com::sun::star::uno::RuntimeException
);
83 //------------------------------------------------
85 //------------------------------------------------
87 void SAL_CALL
registerClipboardViewer( );
88 void SAL_CALL
unregisterClipboardViewer( );
90 static void WINAPI
onClipboardContentChanged( void );
93 void SAL_CALL
onReleaseDataObject( CXNotifyingDataObject
* theCaller
);
97 CMtaOleClipboard m_MtaOleClipboard
;
98 CWinClipboard
* m_pWinClipboard
;
99 CXNotifyingDataObject
* m_pCurrentClipContent
;
100 osl::Mutex m_ClipContentMutex
;
102 static osl::Mutex s_aMutex
;
103 static CWinClipbImpl
* s_pCWinClipbImpl
;
106 CWinClipbImpl( const CWinClipbImpl
& );
107 CWinClipbImpl
& operator=( const CWinClipbImpl
& );
109 friend class CWinClipboard
;
110 friend class CXNotifyingDataObject
;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */