LibreOffice Module vcl (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Qt5ClipboardTransferable Class Referencefinal

The QClipboard's QMimeData is volatile. More...

#include <Qt5Transferable.hxx>

Inheritance diagram for Qt5ClipboardTransferable:
[legend]
Collaboration diagram for Qt5ClipboardTransferable:
[legend]

Public Member Functions

 Qt5ClipboardTransferable (const QClipboard::Mode aMode, const QMimeData *pMimeData)
 
css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors () override
 
sal_Bool SAL_CALL isDataFlavorSupported (const css::datatransfer::DataFlavor &rFlavor) override
 
css::uno::Any SAL_CALL getTransferData (const css::datatransfer::DataFlavor &rFlavor) override
 
- Public Member Functions inherited from Qt5Transferable
 Qt5Transferable (const QMimeData *pMimeData)
 
const QMimeData * mimeData () const
 
css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors () override
 
sal_Bool SAL_CALL isDataFlavorSupported (const css::datatransfer::DataFlavor &rFlavor) override
 
css::uno::Any SAL_CALL getTransferData (const css::datatransfer::DataFlavor &rFlavor) override
 

Private Member Functions

bool hasInFlightChanged () const
 

Private Attributes

const QClipboard::Mode m_aMode
 

Detailed Description

The QClipboard's QMimeData is volatile.

As written in the QClipboard::mimeData documentation, "the pointer returned might become invalidated when the contents of the clipboard changes". Therefore it can just be accessed reliably inside the QClipboard's object thread, which is the QApplication's thread, so all of the access has to go through RunInMainThread().

If we detect a QMimeData change, we simply drop reporting any content. In theory we can recover in the case where there hadn't been any calls of the XTransferable interface, but currently we don't. But we ensure to never report mixed content, so we'll just cease operation on QMimeData change.

Definition at line 62 of file Qt5Transferable.hxx.

Constructor & Destructor Documentation

Qt5ClipboardTransferable::Qt5ClipboardTransferable ( const QClipboard::Mode  aMode,
const QMimeData *  pMimeData 
)
explicit

Member Function Documentation

css::uno::Any SAL_CALL Qt5ClipboardTransferable::getTransferData ( const css::datatransfer::DataFlavor &  rFlavor)
override
css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL Qt5ClipboardTransferable::getTransferDataFlavors ( )
override
bool Qt5ClipboardTransferable::hasInFlightChanged ( ) const
private
sal_Bool SAL_CALL Qt5ClipboardTransferable::isDataFlavorSupported ( const css::datatransfer::DataFlavor &  rFlavor)
override

Member Data Documentation

const QClipboard::Mode Qt5ClipboardTransferable::m_aMode
private

Definition at line 65 of file Qt5Transferable.hxx.


The documentation for this class was generated from the following file: