/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * 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 implementation has two main functions, which handle the clipboard content: * the XClipboard::setContent function and the QClipboard::change signal handler. * * The first just sets the respective clipboard to the expected content from LO, * the latter will handle any reported changes.
**/ class QtClipboard final
: public QObject, public cppu::WeakComponentImplHelper<css::datatransfer::clipboard::XSystemClipboard,
css::datatransfer::clipboard::XFlushableClipboard,
css::lang::XServiceInfo>
{
Q_OBJECT
osl::Mutex m_aMutex; const OUString m_aClipboardName; const QClipboard::Mode m_aClipboardMode; // has to be set, if LO changes the QClipboard itself, so it won't instantly lose // ownership by it's self-triggered QClipboard::changed handler bool m_bOwnClipboardChange; // true, if LO really wants to give up clipboard ownership bool m_bDoClear;
// if not empty, this holds the setContents provided XTransferable or a QtClipboardTransferable
css::uno::Reference<css::datatransfer::XTransferable> m_aContents; // the owner of the current contents, which must be informed on content change
css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner> m_aOwner;
std::vector<css::uno::Reference<css::datatransfer::clipboard::XClipboardListener>> m_aListeners;
public: // factory function to construct only valid QtClipboard objects by name static css::uno::Reference<css::datatransfer::clipboard::XClipboard>
create(const OUString& aModeString);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.