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

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

#include <QtTransferable.hxx>

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

Public Member Functions

 QtClipboardTransferable (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 QtTransferable
 QtTransferable (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 qt5/QtTransferable.hxx.

Constructor & Destructor Documentation

◆ QtClipboardTransferable()

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

Member Function Documentation

◆ getTransferData()

css::uno::Any SAL_CALL QtClipboardTransferable::getTransferData ( const css::datatransfer::DataFlavor &  rFlavor)
override

◆ getTransferDataFlavors()

css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL QtClipboardTransferable::getTransferDataFlavors ( )
override

◆ hasInFlightChanged()

bool QtClipboardTransferable::hasInFlightChanged ( ) const
private

◆ isDataFlavorSupported()

sal_Bool SAL_CALL QtClipboardTransferable::isDataFlavorSupported ( const css::datatransfer::DataFlavor &  rFlavor)
override

Member Data Documentation

◆ m_aMode

const QClipboard::Mode QtClipboardTransferable::m_aMode
private

Definition at line 65 of file qt5/QtTransferable.hxx.


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