Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
IPlatformScreen.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
4 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
5 * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
6 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
7 */
8
9#pragma once
10
12#include "deskflow/IKeyState.h"
14#include "deskflow/IScreen.h"
17
18class IClipboard;
19
21
26class IPlatformScreen : public IScreen, public IPrimaryScreen, public ISecondaryScreen, public IKeyState
27{
28public:
30
31
32 explicit IPlatformScreen(const IEventQueue *events) : IKeyState(events)
33 {
34 // do nothing
35 }
36
38
43 virtual void enable() = 0;
44
46
50 virtual void disable() = 0;
51
53
56 virtual void enter() = 0;
57
59
65 virtual bool canLeave() = 0;
66
68
72 virtual void leave() = 0;
73
75
78 virtual bool setClipboard(ClipboardID id, const IClipboard *) = 0;
79
81
86 virtual void checkClipboards() = 0;
87
89
95 virtual void openScreensaver(bool notify) = 0;
96
98
103 virtual void closeScreensaver() = 0;
104
106
110 virtual void screensaver(bool activate) = 0;
111
113
116 virtual void resetOptions() = 0;
117
119
123 virtual void setOptions(const OptionsList &options) = 0;
124
126
129 virtual void setSequenceNumber(uint32_t) = 0;
130
132
136 virtual std::string getSecureInputApp() const = 0;
137
139
141
143
146 virtual bool isPrimary() const = 0;
147
149 // IKeyState overrides
150 void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override = 0;
151 bool
152 fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override = 0;
153 bool fakeMediaKey(KeyID) override;
154
155protected:
157
179 virtual void handleSystemEvent(const Event &event) = 0;
180};
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
uint32_t KeyID
Key ID.
Definition KeyTypes.h:21
uint16_t KeyButton
Key Code.
Definition KeyTypes.h:34
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:44
std::vector< uint32_t > OptionsList
Definition OptionTypes.h:26
Event.
Definition Event.h:29
Clipboard interface.
Definition IClipboard.h:19
Event queue interface.
Definition IEventQueue.h:29
IKeyState(const IEventQueue *events)
Definition IKeyState.cpp:17
IPlatformScreen(const IEventQueue *events)
Definition IPlatformScreen.h:32
virtual bool setClipboard(ClipboardID id, const IClipboard *)=0
Set clipboard.
bool fakeMediaKey(KeyID) override
Fake a media key.
Definition IPlatformScreen.cpp:9
virtual bool isPrimary() const =0
Test if is primary screen.
virtual bool canLeave()=0
Leave screen.
virtual void handleSystemEvent(const Event &event)=0
Handle system event.
virtual void closeScreensaver()=0
Close screen saver.
virtual void resetOptions()=0
Notify of options changes.
virtual void setSequenceNumber(uint32_t)=0
Set clipboard sequence number.
virtual void leave()=0
Leave screen.
void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override=0
Fake a key press.
bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override=0
Fake a key repeat.
virtual void openScreensaver(bool notify)=0
Open screen saver.
virtual void checkClipboards()=0
Check clipboard owner.
virtual void screensaver(bool activate)=0
Activate/deactivate screen saver.
virtual void setOptions(const OptionsList &options)=0
Notify of options changes.
virtual void enter()=0
Enter screen.
virtual std::string getSecureInputApp() const =0
Determine the name of the app causing a secure input state.
virtual void enable()=0
Enable screen.
virtual void disable()=0
Disable screen.
Primary screen interface.
Definition IPrimaryScreen.h:20
Screen interface.
Definition IScreen.h:20
Secondary screen interface.
Definition ISecondaryScreen.h:19