Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / dtrans / source / win32 / clipb / WinClipbImpl.hxx
blob55a9d8d600bc0d73f33d662b02240547ff7ef4c0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
32 #endif
33 #include <windows.h>
35 class CWinClipboard;
36 class CXNotifyingDataObject;
38 // impl class to avoid deadlocks between XTDataObject
39 // and the clipboard implementation
41 class CWinClipbImpl
43 public:
44 ~CWinClipbImpl( );
46 protected:
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
53 void setContents(
54 const css::uno::Reference< css::datatransfer::XTransferable >& xTransferable,
55 const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner );
57 /// @throws css::uno::RuntimeException
58 OUString getName( );
60 // XClipboardEx
62 /// @throws css::uno::RuntimeException
63 static sal_Int8 getRenderingCapabilities( );
65 // XFlushableClipboard
67 /// @throws css::uno::RuntimeException
68 void flushClipboard( );
70 // XComponent
72 /// @throws css::uno::RuntimeException
73 void dispose( );
75 // member functions
77 void registerClipboardViewer( );
78 void unregisterClipboardViewer( );
80 static void WINAPI onClipboardContentChanged();
82 private:
83 void onReleaseDataObject( CXNotifyingDataObject* theCaller );
85 private:
86 OUString m_itsName;
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;
95 private:
96 CWinClipbImpl( const CWinClipbImpl& );
97 CWinClipbImpl& operator=( const CWinClipbImpl& );
99 friend class CWinClipboard;
100 friend class CXNotifyingDataObject;
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */