| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2012~2023 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: BSD-3-Clause |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef _FCITX4INPUTCONTEXTPROXY_H_ |
| 9 |
#define _FCITX4INPUTCONTEXTPROXY_H_ |
| 10 |
|
| 11 |
#include "fcitxqtdbustypes.h" |
| 12 |
#include <QDBusConnection> |
| 13 |
#include <QDBusPendingReply> |
| 14 |
#include <QDBusServiceWatcher> |
| 15 |
#include <QObject> |
| 16 |
|
| 17 |
class QDBusPendingCallWatcher; |
| 18 |
|
| 19 |
namespace fcitx { |
| 20 |
|
| 21 |
class Fcitx4Watcher; |
| 22 |
class Fcitx4InputContextProxyPrivate; |
| 23 |
|
| 24 |
class Fcitx4InputContextProxy : public QObject { |
| 25 |
Q_OBJECT |
| 26 |
public: |
| 27 |
Fcitx4InputContextProxy(Fcitx4Watcher *watcher, QObject *parent); |
| 28 |
~Fcitx4InputContextProxy(); |
| 29 |
|
| 30 |
bool isValid() const; |
| 31 |
void setDisplay(const QString &display); |
| 32 |
const QString &display() const; |
| 33 |
|
| 34 |
public Q_SLOTS: |
| 35 |
QDBusPendingReply<> focusIn(); |
| 36 |
QDBusPendingReply<> focusOut(); |
| 37 |
QDBusPendingReply<int> processKeyEvent(unsigned int keyval, |
| 38 |
unsigned int keycode, |
| 39 |
unsigned int state, int type, |
| 40 |
unsigned int time); |
| 41 |
QDBusPendingReply<> reset(); |
| 42 |
QDBusPendingReply<> setCapability(unsigned int caps); |
| 43 |
QDBusPendingReply<> setCursorRect(int x, int y, int w, int h); |
| 44 |
QDBusPendingReply<> setSurroundingText(const QString &text, |
| 45 |
unsigned int cursor, |
| 46 |
unsigned int anchor); |
| 47 |
QDBusPendingReply<> setSurroundingTextPosition(unsigned int cursor, |
| 48 |
unsigned int anchor); |
| 49 |
|
| 50 |
Q_SIGNALS: |
| 51 |
void commitString(const QString &str); |
| 52 |
void currentIM(const QString &name, const QString &uniqueName, |
| 53 |
const QString &langCode); |
| 54 |
void deleteSurroundingText(int offset, unsigned int nchar); |
| 55 |
void forwardKey(unsigned int keyval, unsigned int state, bool isRelease); |
| 56 |
void updateFormattedPreedit(const FcitxQtFormattedPreeditList &str, |
| 57 |
int cursorpos); |
| 58 |
void inputContextCreated(); |
| 59 |
|
| 60 |
private: |
| 61 |
Fcitx4InputContextProxyPrivate *const d_ptr; |
| 62 |
Q_DECLARE_PRIVATE(Fcitx4InputContextProxy); |
| 63 |
}; |
| 64 |
|
| 65 |
} // namespace fcitx |
| 66 |
|
| 67 |
#endif // _FCITX4INPUTCONTEXTPROXY_H_ |