Class sh::tools::DataExchange

class sh::tools::DataExchange : public QObject, public sh::base::Singleton

Clipboard and DnD related tools.

Public Types

enum DataExchangeType

A kind of data exchange movement.

Values:

enumerator COPY
enumerator MOVE

Public Functions

bool containsFileEntries(const QMimeData*)

Checks if a QMimeData contains any file entries we understand.

QMimeData *getMimeDataFromFilesystemNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, DataExchangeType type)

Returns a new QMimeData for a list of filesystem nodes and an exchange type.

std::shared_ptr<sh::actions::AbstractActionItem> createCopyAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

Returns a copy action for a source by QMimeData and a destination eurl.

std::shared_ptr<sh::actions::AbstractActionItem> createMoveAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

Returns a move action for a source by QMimeData and a destination eurl.

std::shared_ptr<sh::actions::AbstractActionItem> createPasteAction(const QMimeData *src, std::shared_ptr<const sh::filesystem::Eurl> dest)

Returns a paste action for a source by QMimeData and a destination eurl (copy or move by QMimeData).

QList<std::shared_ptr<const sh::filesystem::Eurl>> getSources(const QMimeData *src, bool *isCut = 0)

Returns a list of eurls (and if it is a cut/move exchange) from the QMimeData.

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Public Static Attributes

QString FilelistTypeShallot = "x-special/shallot-copied-files"
QString FilelistTypeGnome = "x-special/gnome-copied-files"
QString FilelistTypeUrilist = "text/uri-list"
QString FilelistTypePlaintext = "text/plain"

Private Functions

DataExchange()

Private Static Attributes

QString linebreak = "\n"