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 .
20 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
25 #include <com/sun/star/datatransfer/XTransferable.hpp>
26 #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
27 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
28 #include "MtaOleClipb.hxx"
30 #if !defined WIN32_LEAN_AND_MEAN
31 # define WIN32_LEAN_AND_MEAN
36 class CXNotifyingDataObject
;
38 // impl class to avoid deadlocks between XTDataObject
39 // and the clipboard implementation
47 CWinClipbImpl( const OUString
& aClipboardName
, CWinClipboard
* theWinClipboard
);
49 /// @throws css::uno::RuntimeException
50 css::uno::Reference
< css::datatransfer::XTransferable
> getContents( );
52 /// @throws css::uno::RuntimeException
54 const css::uno::Reference
< css::datatransfer::XTransferable
>& xTransferable
,
55 const css::uno::Reference
< css::datatransfer::clipboard::XClipboardOwner
>& xClipboardOwner
);
57 /// @throws css::uno::RuntimeException
62 /// @throws css::uno::RuntimeException
63 static sal_Int8
getRenderingCapabilities( );
65 // XFlushableClipboard
67 /// @throws css::uno::RuntimeException
68 void flushClipboard( );
72 /// @throws css::uno::RuntimeException
77 void registerClipboardViewer( );
78 void unregisterClipboardViewer( );
80 static void WINAPI
onClipboardContentChanged();
83 void onReleaseDataObject( CXNotifyingDataObject
* theCaller
);
87 CMtaOleClipboard m_MtaOleClipboard
;
88 CWinClipboard
* m_pWinClipboard
;
89 CXNotifyingDataObject
* m_pCurrentClipContent
;
90 osl::Mutex m_ClipContentMutex
;
92 static osl::Mutex s_aMutex
;
93 static CWinClipbImpl
* s_pCWinClipbImpl
;
96 CWinClipbImpl( const CWinClipbImpl
& );
97 CWinClipbImpl
& operator=( const CWinClipbImpl
& );
99 friend class CWinClipboard
;
100 friend class CXNotifyingDataObject
;
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */