Deskflow 1.26.0.285
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
deskflow::EiClipboard Class Reference

EI/Portal clipboard implementation. More...

#include <EiClipboard.h>

Inheritance diagram for deskflow::EiClipboard:
Collaboration diagram for deskflow::EiClipboard:

Public Member Functions

 EiClipboard (ClipboardID id)
 ~EiClipboard () override=default
ClipboardID getID () const
 Get clipboard ID.
Public Member Functions inherited from IClipboard
virtual ~IClipboard ()=default

IClipboard overrides

bool empty () override
 Empty clipboard.
void add (Format, 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 (Format) const override
 Check for data.
std::string get (Format) const override
 Get data.

Additional Inherited Members

Public Types inherited from IClipboard
enum class  Format { Text , HTML , Bitmap , TotalFormats }
 Clipboard formats. More...
using Time = uint32_t
 Timestamp type.
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.

Detailed Description

EI/Portal clipboard implementation.

This class implements a clipboard for EI (libei) and portal-based input capture. It stores clipboard data in memory for the specified clipboard ID.

Constructor & Destructor Documentation

◆ EiClipboard()

deskflow::EiClipboard::EiClipboard ( ClipboardID id)
explicit

◆ ~EiClipboard()

deskflow::EiClipboard::~EiClipboard ( )
overridedefault

Member Function Documentation

◆ add()

void deskflow::EiClipboard::add ( Format ,
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 deskflow::EiClipboard::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 deskflow::EiClipboard::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 deskflow::EiClipboard::get ( Format ) 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.

◆ getID()

ClipboardID deskflow::EiClipboard::getID ( ) const
inline

Get clipboard ID.

◆ getTime()

EiClipboard::Time deskflow::EiClipboard::getTime ( ) const
overridevirtual

Get time.

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

Implements IClipboard.

◆ has()

bool deskflow::EiClipboard::has ( Format ) 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.

◆ open()

bool deskflow::EiClipboard::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.


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