spiegel-keyman/linux/keyman-system-service/src/KeymanSystemService.h
Eberhard Beilharz e4c7332e1c
refactor(linux): use OrderedOutputDeviceMock when running tests
When running tests we use the `OrderedOutputDeviceMock` class which sends a
dbus message for a sentinel key press instead of creating/using a real
"virtual" keyboard.
2025-02-14 16:42:08 +01:00

39 lines
923 B
C++

#ifndef __KEYMANSYSTEMSERVICE_H__
#define __KEYMANSYSTEMSERVICE_H__
#include "config.h"
#include <list>
#if DBUS_IMPLEMENTATION == SYSTEMD
#include <systemd/sd-bus.h>
#else
#include <basu/sd-bus.h>
#endif
#include "OrderedOutputDevice.h"
#include "KeyboardDevice.h"
using namespace std;
class KeymanSystemService {
private:
std::list<KeyboardDevice *>* kbd_devices = nullptr;
OrderedOutputDevice *kbd_ordered_output = nullptr;
sd_bus *bus = nullptr;
bool failed = false;
void GetKbdDevices();
void CreateOrderedOutputDeviceIfNecessary();
public:
KeymanSystemService();
~KeymanSystemService();
void Initialize();
bool Failed() { return failed; }
int Loop();
void SetCapsLockIndicatorOnDevices(uint32_t state);
uint32_t GetCapsLockIndicatorOnDevices();
void CallOrderedOutputSentinel();
};
#endif // __KEYMANSYSTEMSERVICE_H__