From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- dtrans/source/win32/clipb/WinClipbImpl.hxx | 106 +++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 dtrans/source/win32/clipb/WinClipbImpl.hxx (limited to 'dtrans/source/win32/clipb/WinClipbImpl.hxx') diff --git a/dtrans/source/win32/clipb/WinClipbImpl.hxx b/dtrans/source/win32/clipb/WinClipbImpl.hxx new file mode 100644 index 000000000..cd5878e6b --- /dev/null +++ b/dtrans/source/win32/clipb/WinClipbImpl.hxx @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX +#define INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_WINCLIPBIMPL_HXX + +#include +#include +#include +#include +#include +#include "MtaOleClipb.hxx" + +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include + +class CWinClipboard; +class CXNotifyingDataObject; + +// impl class to avoid deadlocks between XTDataObject +// and the clipboard implementation + +class CWinClipbImpl +{ +public: + ~CWinClipbImpl( ); + +protected: + CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* theWinClipboard ); + + /// @throws css::uno::RuntimeException + css::uno::Reference< css::datatransfer::XTransferable > getContents( ); + + /// @throws css::uno::RuntimeException + void setContents( + const css::uno::Reference< css::datatransfer::XTransferable >& xTransferable, + const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner ); + + /// @throws css::uno::RuntimeException + OUString getName( ); + + // XClipboardEx + + /// @throws css::uno::RuntimeException + static sal_Int8 getRenderingCapabilities( ); + + // XFlushableClipboard + + /// @throws css::uno::RuntimeException + void flushClipboard( ); + + // XComponent + + /// @throws css::uno::RuntimeException + void dispose( ); + + // member functions + + void registerClipboardViewer( ); + void unregisterClipboardViewer( ); + + static void WINAPI onClipboardContentChanged(); + +private: + void onReleaseDataObject( CXNotifyingDataObject* theCaller ); + +private: + OUString m_itsName; + CMtaOleClipboard m_MtaOleClipboard; + CWinClipboard* m_pWinClipboard; + CXNotifyingDataObject* m_pCurrentClipContent; + com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > m_foreignContent; + osl::Mutex m_ClipContentMutex; + + static osl::Mutex s_aMutex; + static CWinClipbImpl* s_pCWinClipbImpl; + +private: + CWinClipbImpl( const CWinClipbImpl& ); + CWinClipbImpl& operator=( const CWinClipbImpl& ); + + friend class CWinClipboard; + friend class CXNotifyingDataObject; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3