Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
OSXClipboard Class Reference

OS X clipboard implementation. More...

#include <OSXClipboard.h>

Inheritance diagram for OSXClipboard:
Collaboration diagram for OSXClipboard:

Public Member Functions

 OSXClipboard ()
virtual ~OSXClipboard ()
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.
bool synchronize ()
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.

Detailed Description

OS X clipboard implementation.

Constructor & Destructor Documentation

◆ OSXClipboard()

OSXClipboard::OSXClipboard ( )

◆ ~OSXClipboard()

OSXClipboard::~OSXClipboard ( )
virtual

Member Function Documentation

◆ add()

void OSXClipboard::add ( EFormat ,
const std::string & data )
overridevirtual

Add data.

Add data in the given format to the clipboard. May only be called after a successful empty().

Implements IClipboard.

◆ close()

void OSXClipboard::close ( ) const
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.

◆ empty()

bool OSXClipboard::empty ( )
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.

◆ get()

std::string OSXClipboard::get ( EFormat ) const
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.

◆ getTime()

IClipboard::Time OSXClipboard::getTime ( ) const
overridevirtual

Get time.

Return the timestamp passed to the last successful open().

Implements IClipboard.

◆ has()

bool OSXClipboard::has ( EFormat ) const
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.

◆ isOwnedByDeskflow()

bool OSXClipboard::isOwnedByDeskflow ( )
static

Test if clipboard is owned by deskflow.

◆ open()

bool OSXClipboard::open ( Time time) const
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.

◆ synchronize()

bool OSXClipboard::synchronize ( )

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