LibreOffice Module dtrans (master)  1
WinClipbImpl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX
22 
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"
29 
30 #if !defined WIN32_LEAN_AND_MEAN
31 # define WIN32_LEAN_AND_MEAN
32 #endif
33 #include <windows.h>
34 
35 class CWinClipboard;
37 
38 // impl class to avoid deadlocks between XTDataObject
39 // and the clipboard implementation
40 
42 {
43 public:
44  ~CWinClipbImpl( );
45 
46 protected:
47  CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* theWinClipboard );
48 
50  css::uno::Reference< css::datatransfer::XTransferable > getContents( );
51 
53  void setContents(
54  const css::uno::Reference< css::datatransfer::XTransferable >& xTransferable,
55  const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner );
56 
58  OUString getName( );
59 
60  // XClipboardEx
61 
64 
65  // XFlushableClipboard
66 
68  void flushClipboard( );
69 
70  // XComponent
71 
73  void dispose( );
74 
75  // member functions
76 
79 
80  static void WINAPI onClipboardContentChanged();
81 
82 private:
83  void onReleaseDataObject( CXNotifyingDataObject* theCaller );
84 
85 private:
86  OUString m_itsName;
91  osl::Mutex m_ClipContentMutex;
92 
93  static osl::Mutex s_aMutex;
95 
96 private:
97  CWinClipbImpl( const CWinClipbImpl& );
99 
100  friend class CWinClipboard;
101  friend class CXNotifyingDataObject;
102 };
103 
104 #endif
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static sal_Int8 getRenderingCapabilities()
signed char sal_Int8
osl::Mutex m_ClipContentMutex
void flushClipboard()
OUString m_itsName
static CWinClipbImpl * s_pCWinClipbImpl
CWinClipbImpl & operator=(const CWinClipbImpl &)
OUString getName()
void setContents(const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable, const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner > &xClipboardOwner)
static void WINAPI onClipboardContentChanged()
CWinClipboard * m_pWinClipboard
CMtaOleClipboard m_MtaOleClipboard
com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > m_foreignContent
static osl::Mutex s_aMutex
CWinClipbImpl(const OUString &aClipboardName, CWinClipboard *theWinClipboard)
void unregisterClipboardViewer()
void onReleaseDataObject(CXNotifyingDataObject *theCaller)
CXNotifyingDataObject * m_pCurrentClipContent
void registerClipboardViewer()
css::uno::Reference< css::datatransfer::XTransferable > getContents()