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

#include <transfer.hxx>

Public Member Functions

 TransferableDataHelper ()
 TransferableDataHelper (const TransferableDataHelper &rDataHelper)
 TransferableDataHelper (TransferableDataHelper &&rDataHelper) noexcept
 TransferableDataHelper (const css::uno::Reference< css::datatransfer::XTransferable > &rxTransferable)
 ~TransferableDataHelper ()
TransferableDataHelperoperator= (const TransferableDataHelper &rDataHelper)
TransferableDataHelperoperator= (TransferableDataHelper &&rDataHelper)
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable () const
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable () const
bool HasFormat (SotClipboardFormatId nFormat) const
bool HasFormat (const css::datatransfer::DataFlavor &rFlavor) const
sal_uInt32 GetFormatCount () const
SotClipboardFormatId GetFormat (sal_uInt32 nFormat) const
css::datatransfer::DataFlavor GetFormatDataFlavor (sal_uInt32 nFormat) const
const DataFlavorExVectorGetDataFlavorExVector () const
bool StartClipboardListening ()
void StopClipboardListening ()
void Rebind (const css::uno::Reference< css::datatransfer::XTransferable > &_rxNewData)
css::uno::Any GetAny (SotClipboardFormatId nFormat, const OUString &rDestDoc) const
css::uno::Any GetAny (const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) const
bool GetString (SotClipboardFormatId nFormat, OUString &rStr) const
bool GetString (const css::datatransfer::DataFlavor &rFlavor, OUString &rStr) const
bool GetBitmapEx (SotClipboardFormatId nFormat, BitmapEx &rBmp) const
bool GetBitmapEx (const css::datatransfer::DataFlavor &rFlavor, BitmapEx &rBmp) const
bool GetGDIMetaFile (SotClipboardFormatId nFormat, GDIMetaFile &rMtf, size_t nMaxActions=0) const
 Return as GDI metafile. More...
bool GetGDIMetaFile (const css::datatransfer::DataFlavor &rFlavor, GDIMetaFile &rMtf) const
bool GetGraphic (SotClipboardFormatId nFormat, Graphic &rGraphic) const
bool GetGraphic (const css::datatransfer::DataFlavor &rFlavor, Graphic &rGraphic) const
bool GetImageMap (SotClipboardFormatId nFormat, ImageMap &rIMap) const
bool GetImageMap (const css::datatransfer::DataFlavor &rFlavor, ImageMap &rImap) const
bool GetTransferableObjectDescriptor (SotClipboardFormatId nFormat, TransferableObjectDescriptor &rDesc)
bool GetTransferableObjectDescriptor (TransferableObjectDescriptor &rDesc)
bool GetINetBookmark (SotClipboardFormatId nFormat, INetBookmark &rBmk) const
bool GetINetBookmark (const css::datatransfer::DataFlavor &rFlavor, INetBookmark &rBmk) const
bool GetINetImage (SotClipboardFormatId nFormat, INetImage &rINtImg) const
bool GetINetImage (const css::datatransfer::DataFlavor &rFlavor, INetImage &rINtImg) const
bool GetFileList (SotClipboardFormatId nFormat, FileList &rFileList) const
bool GetFileList (FileList &rFileList) const
css::uno::Sequence< sal_Int8GetSequence (SotClipboardFormatId nFormat, const OUString &rDestDoc) const
css::uno::Sequence< sal_Int8GetSequence (const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) const
bool GetSotStorageStream (SotClipboardFormatId nFormat, tools::SvRef< SotTempStream > &rStreamRef) const
bool GetSotStorageStream (const css::datatransfer::DataFlavor &rFlavor, tools::SvRef< SotTempStream > &rStreamRef) const
css::uno::Reference< css::io::XInputStream > GetInputStream (SotClipboardFormatId nFormat, const OUString &rDestDoc) const
css::uno::Reference< css::io::XInputStream > GetInputStream (const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) const

Static Public Member Functions

static void FillDataFlavorExVector (const css::uno::Sequence< css::datatransfer::DataFlavor > &rDataFlavorSeq, DataFlavorExVector &rDataFlavorExVector)
static TransferableDataHelper CreateFromClipboard (const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard)
static TransferableDataHelper CreateFromSystemClipboard (vcl::Window *pWindow)
static TransferableDataHelper CreateFromPrimarySelection ()
static bool IsEqual (const css::datatransfer::DataFlavor &rInternalFlavor, const css::datatransfer::DataFlavor &rRequestFlavor)

Private Member Functions

void InitFormats ()

Private Attributes

css::uno::Reference< css::datatransfer::XTransferable > mxTransfer
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
DataFlavorExVector maFormats
std::unique_ptr< TransferableObjectDescriptormxObjDesc
std::unique_ptr< TransferableDataHelper_ImplmxImpl


class DropTargetHelper

Detailed Description

Definition at line 270 of file transfer.hxx.

Constructor & Destructor Documentation

◆ TransferableDataHelper() [1/4]

TransferableDataHelper::TransferableDataHelper ( )

Definition at line 1083 of file transfer.cxx.

Referenced by CreateFromClipboard(), and CreateFromPrimarySelection().

◆ TransferableDataHelper() [2/4]

TransferableDataHelper::TransferableDataHelper ( const TransferableDataHelper rDataHelper)

Definition at line 1097 of file transfer.cxx.

◆ TransferableDataHelper() [3/4]

TransferableDataHelper::TransferableDataHelper ( TransferableDataHelper &&  rDataHelper)

Definition at line 1106 of file transfer.cxx.

◆ TransferableDataHelper() [4/4]

TransferableDataHelper::TransferableDataHelper ( const css::uno::Reference< css::datatransfer::XTransferable > &  rxTransferable)

◆ ~TransferableDataHelper()

TransferableDataHelper::~TransferableDataHelper ( )

Definition at line 1158 of file transfer.cxx.

References maFormats, mxImpl, mxObjDesc, and StopClipboardListening().

Member Function Documentation

◆ CreateFromClipboard()

TransferableDataHelper TransferableDataHelper::CreateFromClipboard ( const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &  rClipboard)

Definition at line 2097 of file transfer.cxx.

References mxClipboard, and TransferableDataHelper().

Referenced by CreateFromSystemClipboard().

◆ CreateFromPrimarySelection()

TransferableDataHelper TransferableDataHelper::CreateFromPrimarySelection ( )

Definition at line 2134 of file transfer.cxx.

References GetSystemPrimarySelection(), mxClipboard, and TransferableDataHelper().

◆ CreateFromSystemClipboard()

TransferableDataHelper TransferableDataHelper::CreateFromSystemClipboard ( vcl::Window pWindow)

Definition at line 2122 of file transfer.cxx.

References CreateFromClipboard(), DBG_ASSERT, and vcl::Window::GetClipboard().

◆ FillDataFlavorExVector()

void TransferableDataHelper::FillDataFlavorExVector ( const css::uno::Sequence< css::datatransfer::DataFlavor > &  rDataFlavorSeq,
DataFlavorExVector rDataFlavorExVector 

◆ GetAny() [1/2]

css::uno::Any TransferableDataHelper::GetAny ( const css::datatransfer::DataFlavor &  rFlavor,
const OUString &  rDestDoc 
) const

References GetString().

◆ GetAny() [2/2]

Any TransferableDataHelper::GetAny ( SotClipboardFormatId  nFormat,
const OUString &  rDestDoc 
) const

Definition at line 1357 of file transfer.cxx.

References Any, GetAny(), and SotExchange::GetFormatDataFlavor().

Referenced by GetAny().

◆ GetBitmapEx() [1/2]

bool TransferableDataHelper::GetBitmapEx ( const css::datatransfer::DataFlavor &  rFlavor,
BitmapEx rBmp 
) const

◆ GetBitmapEx() [2/2]

bool TransferableDataHelper::GetBitmapEx ( SotClipboardFormatId  nFormat,
BitmapEx rBmp 
) const

Definition at line 1476 of file transfer.cxx.

References GetBitmapEx(), and SotExchange::GetFormatDataFlavor().

Referenced by GetBitmapEx(), and GetGraphic().

◆ GetDataFlavorExVector()

const DataFlavorExVector & TransferableDataHelper::GetDataFlavorExVector ( ) const

Definition at line 307 of file transfer.hxx.

◆ GetFileList() [1/2]

bool TransferableDataHelper::GetFileList ( FileList rFileList) const

◆ GetFileList() [2/2]

bool TransferableDataHelper::GetFileList ( SotClipboardFormatId  nFormat,
FileList rFileList 
) const

Definition at line 1967 of file transfer.cxx.

References GetFileList(), and SotExchange::GetFormatDataFlavor().

Referenced by GetFileList().

◆ GetFormat()

SotClipboardFormatId TransferableDataHelper::GetFormat ( sal_uInt32  nFormat) const

Definition at line 1312 of file transfer.cxx.

References DBG_ASSERT, maFormats, and mxImpl.

Referenced by GetFileList().

◆ GetFormatCount()

sal_uInt32 TransferableDataHelper::GetFormatCount ( ) const

Definition at line 1306 of file transfer.cxx.

References maFormats, and mxImpl.

Referenced by GetFileList().

◆ GetFormatDataFlavor()

DataFlavor TransferableDataHelper::GetFormatDataFlavor ( sal_uInt32  nFormat) const

Definition at line 1319 of file transfer.cxx.

References DBG_ASSERT, maFormats, and mxImpl.

Referenced by GetFileList().

◆ GetGDIMetaFile() [1/2]

bool TransferableDataHelper::GetGDIMetaFile ( const css::datatransfer::DataFlavor &  rFlavor,
GDIMetaFile rMtf 
) const

◆ GetGDIMetaFile() [2/2]

bool TransferableDataHelper::GetGDIMetaFile ( SotClipboardFormatId  nFormat,
GDIMetaFile rMtf,
size_t  nMaxActions = 0 
) const

Return as GDI metafile.

nMaxActionAllows you to limit the amount of actions; defaults to 0 which means no limit.

When you eg. Ctrl+a in Excel, you can get the entire sheet as metafile, with over 3 million (!) actions; which is just too large for any reasonable handling - and you need to set a limit.

Definition at line 1608 of file transfer.cxx.

References GDIMetaFile::GetActionSize(), SotExchange::GetFormatDataFlavor(), and GetGDIMetaFile().

Referenced by GetGDIMetaFile(), and GetGraphic().

◆ GetGraphic() [1/2]

bool TransferableDataHelper::GetGraphic ( const css::datatransfer::DataFlavor &  rFlavor,
Graphic rGraphic 
) const

◆ GetGraphic() [2/2]

bool TransferableDataHelper::GetGraphic ( SotClipboardFormatId  nFormat,
Graphic rGraphic 
) const

Definition at line 1662 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetGraphic().

Referenced by GetGraphic().

◆ GetImageMap() [1/2]

bool TransferableDataHelper::GetImageMap ( const css::datatransfer::DataFlavor &  rFlavor,
ImageMap rImap 
) const

Definition at line 1761 of file transfer.cxx.

References ERRCODE_NONE, GetSotStorageStream(), and ImageMap::Read().

◆ GetImageMap() [2/2]

bool TransferableDataHelper::GetImageMap ( SotClipboardFormatId  nFormat,
ImageMap rIMap 
) const

Definition at line 1754 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetImageMap().

Referenced by GetImageMap().

◆ GetINetBookmark() [1/2]

bool TransferableDataHelper::GetINetBookmark ( const css::datatransfer::DataFlavor &  rFlavor,
INetBookmark rBmk 
) const

◆ GetINetBookmark() [2/2]

bool TransferableDataHelper::GetINetBookmark ( SotClipboardFormatId  nFormat,
INetBookmark rBmk 
) const

Definition at line 1790 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetINetBookmark().

Referenced by GetINetBookmark().

◆ GetINetImage() [1/2]

bool TransferableDataHelper::GetINetImage ( const css::datatransfer::DataFlavor &  rFlavor,
INetImage rINtImg 
) const

Definition at line 1954 of file transfer.cxx.

References SotExchange::GetFormat(), GetSotStorageStream(), and INetImage::Read().

◆ GetINetImage() [2/2]

bool TransferableDataHelper::GetINetImage ( SotClipboardFormatId  nFormat,
INetImage rINtImg 
) const

Definition at line 1946 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetINetImage().

Referenced by GetINetImage().

◆ GetInputStream() [1/2]

css::uno::Reference< css::io::XInputStream > TransferableDataHelper::GetInputStream ( const css::datatransfer::DataFlavor &  rFlavor,
const OUString &  rDestDoc 
) const

◆ GetInputStream() [2/2]

Reference< XInputStream > TransferableDataHelper::GetInputStream ( SotClipboardFormatId  nFormat,
const OUString &  rDestDoc 
) const

Definition at line 2049 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetInputStream().

Referenced by GetInputStream().

◆ GetSequence() [1/2]

css::uno::Sequence< sal_Int8 > TransferableDataHelper::GetSequence ( const css::datatransfer::DataFlavor &  rFlavor,
const OUString &  rDestDoc 
) const

◆ GetSequence() [2/2]

Sequence< sal_Int8 > TransferableDataHelper::GetSequence ( SotClipboardFormatId  nFormat,
const OUString &  rDestDoc 
) const

Definition at line 2008 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetSequence().

Referenced by GetINetBookmark(), and GetSequence().

◆ GetSotStorageStream() [1/2]

bool TransferableDataHelper::GetSotStorageStream ( const css::datatransfer::DataFlavor &  rFlavor,
tools::SvRef< SotTempStream > &  rStreamRef 
) const

◆ GetSotStorageStream() [2/2]

bool TransferableDataHelper::GetSotStorageStream ( SotClipboardFormatId  nFormat,
tools::SvRef< SotTempStream > &  rStreamRef 
) const

◆ GetString() [1/2]

bool TransferableDataHelper::GetString ( const css::datatransfer::DataFlavor &  rFlavor,
OUString &  rStr 
) const

◆ GetString() [2/2]

bool TransferableDataHelper::GetString ( SotClipboardFormatId  nFormat,
OUString &  rStr 
) const

Definition at line 1434 of file transfer.cxx.

References SotExchange::GetFormatDataFlavor(), and GetString().

Referenced by GetINetBookmark(), and GetString().

◆ GetTransferable()

const css::uno::Reference< css::datatransfer::XTransferable > & TransferableDataHelper::GetTransferable ( ) const

Definition at line 296 of file transfer.hxx.

◆ GetTransferableObjectDescriptor() [1/2]

bool TransferableDataHelper::GetTransferableObjectDescriptor ( SotClipboardFormatId  nFormat,
TransferableObjectDescriptor rDesc 

◆ GetTransferableObjectDescriptor() [2/2]

bool TransferableDataHelper::GetTransferableObjectDescriptor ( TransferableObjectDescriptor rDesc)

Definition at line 1783 of file transfer.cxx.

References mxObjDesc.

◆ GetXTransferable()

Reference< XTransferable > TransferableDataHelper::GetXTransferable ( ) const

Definition at line 1333 of file transfer.cxx.

References mxTransfer.

◆ HasFormat() [1/2]

bool TransferableDataHelper::HasFormat ( const css::datatransfer::DataFlavor &  rFlavor) const

References GetFormat().

◆ HasFormat() [2/2]

bool TransferableDataHelper::HasFormat ( SotClipboardFormatId  nFormat) const

Definition at line 1287 of file transfer.cxx.

References maFormats, and mxImpl.

Referenced by GetINetBookmark().

◆ InitFormats()

void TransferableDataHelper::InitFormats ( )

Definition at line 1263 of file transfer.cxx.

References FillDataFlavorExVector(), ImplSetParameterString(), maFormats, mxImpl, mxObjDesc, and mxTransfer.

Referenced by Rebind().

◆ IsEqual()

bool TransferableDataHelper::IsEqual ( const css::datatransfer::DataFlavor &  rInternalFlavor,
const css::datatransfer::DataFlavor &  rRequestFlavor 

◆ operator=() [1/2]

TransferableDataHelper & TransferableDataHelper::operator= ( const TransferableDataHelper rDataHelper)

◆ operator=() [2/2]

TransferableDataHelper & TransferableDataHelper::operator= ( TransferableDataHelper &&  rDataHelper)

◆ Rebind()

void TransferableDataHelper::Rebind ( const css::uno::Reference< css::datatransfer::XTransferable > &  _rxNewData)

Definition at line 2069 of file transfer.cxx.

References InitFormats(), and mxTransfer.

◆ StartClipboardListening()

bool TransferableDataHelper::StartClipboardListening ( )

Definition at line 2075 of file transfer.cxx.

References mxClipboard, mxImpl, and StopClipboardListening().

Referenced by operator=().

◆ StopClipboardListening()

void TransferableDataHelper::StopClipboardListening ( )

Definition at line 2086 of file transfer.cxx.

References mxImpl.

Referenced by operator=(), StartClipboardListening(), and ~TransferableDataHelper().

Friends And Related Function Documentation

◆ DropTargetHelper

friend class DropTargetHelper

Definition at line 272 of file transfer.hxx.

Member Data Documentation

◆ maFormats

DataFlavorExVector TransferableDataHelper::maFormats

◆ mxClipboard

css::uno::Reference< css::datatransfer::clipboard::XClipboard > TransferableDataHelper::mxClipboard

◆ mxImpl

std::unique_ptr<TransferableDataHelper_Impl> TransferableDataHelper::mxImpl

◆ mxObjDesc

std::unique_ptr<TransferableObjectDescriptor> TransferableDataHelper::mxObjDesc

◆ mxTransfer

css::uno::Reference< css::datatransfer::XTransferable > TransferableDataHelper::mxTransfer

Definition at line 274 of file transfer.hxx.

Referenced by GetXTransferable(), InitFormats(), operator=(), and Rebind().

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