Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Microsoft windows clipboard implementation. More...
#include <MSWindowsClipboard.h>
Public Member Functions | |
MSWindowsClipboard (HWND window) | |
MSWindowsClipboard (HWND window, IMSWindowsClipboardFacade &facade) | |
~MSWindowsClipboard () override | |
bool | emptyUnowned () |
Empty clipboard without ownership. | |
bool | empty () override |
Empty clipboard. | |
void | add (EFormat, const std::string &data) override |
Add data. | |
bool | open (Time) const override |
Open clipboard. | |
void | close () const override |
Close clipboard. | |
Time | getTime () const override |
Get time. | |
bool | has (EFormat) const override |
Check for data. | |
std::string | get (EFormat) const override |
Get data. | |
void | setFacade (IMSWindowsClipboardFacade &facade) |
Public Member Functions inherited from IClipboard | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. |
Static Public Member Functions | |
static bool | isOwnedByDeskflow () |
Test if clipboard is owned by deskflow. | |
static std::string | marshall (const IClipboard *clipboard) |
Marshall clipboard data. | |
static void | unmarshall (IClipboard *clipboard, const std::string_view &data, Time time) |
Unmarshall clipboard data. | |
static bool | copy (IClipboard *dst, const IClipboard *src) |
Copy clipboard. | |
static bool | copy (IClipboard *dst, const IClipboard *src, Time) |
Copy clipboard. |
Additional Inherited Members | |
Public Types inherited from IClipboard | |
enum | EFormat { kText , kHTML , kBitmap , kNumFormats } |
Clipboard formats. More... | |
using | Time = uint32_t |
Timestamp type. |
Microsoft windows clipboard implementation.
MSWindowsClipboard::MSWindowsClipboard | ( | HWND | window | ) |
MSWindowsClipboard::MSWindowsClipboard | ( | HWND | window, |
IMSWindowsClipboardFacade & | facade ) |
|
override |
|
overridevirtual |
Add data.
Add data in the given format to the clipboard. May only be called after a successful empty().
Implements IClipboard.
|
overridevirtual |
Close clipboard.
Close the clipboard. close() must match a preceding successful open(). This signals that the clipboard has been filled with all the necessary data or all data has been read. It does not mean the clipboard ownership should be released (if it was taken).
Implements IClipboard.
|
overridevirtual |
Empty clipboard.
Take ownership of the clipboard and clear all data from it. This must be called between a successful open() and close(). Return false if the clipboard ownership could not be taken; the clipboard should not be emptied in this case.
Implements IClipboard.
bool MSWindowsClipboard::emptyUnowned | ( | ) |
Empty clipboard without ownership.
Take ownership of the clipboard and clear all data from it. This must be called between a successful open() and close(). Return false if the clipboard ownership could not be taken; the clipboard should not be emptied in this case. Unlike empty(), isOwnedByDeskflow() will return false when emptied this way. This is useful when deskflow wants to put data on clipboard but pretend (to itself) that some other app did it. When using empty(), deskflow assumes the data came from the server and doesn't need to be sent back. emptyUnowned() makes deskflow send the data to the server.
|
overridevirtual |
Get data.
Return the data in the given format. Returns the empty string if there is no data in that format. Must be called between a successful open() and close().
Implements IClipboard.
|
overridevirtual |
|
overridevirtual |
Check for data.
Return true iff the clipboard contains data in the given format. Must be called between a successful open() and close().
Implements IClipboard.
|
static |
Test if clipboard is owned by deskflow.
|
overridevirtual |
Open clipboard.
Open the clipboard. Return true iff the clipboard could be opened. If open() returns true then the client must call close() at some later time; if it returns false then close() must not be called. time
should be the current time or a time in the past when the open should effectively have taken place.
Implements IClipboard.
void MSWindowsClipboard::setFacade | ( | IMSWindowsClipboardFacade & | facade | ) |