File: fcitx4inputcontextproxy.h

package info (click to toggle)
fcitx5-qt 5.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,340 kB
  • sloc: cpp: 11,697; xml: 243; ansic: 46; makefile: 14; sh: 9
file content (67 lines) | stat: -rw-r--r-- 2,202 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * SPDX-FileCopyrightText: 2012~2023 CSSlayer <wengxt@gmail.com>
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */

#ifndef _FCITX4INPUTCONTEXTPROXY_H_
#define _FCITX4INPUTCONTEXTPROXY_H_

#include "fcitxqtdbustypes.h"
#include <QDBusConnection>
#include <QDBusPendingReply>
#include <QDBusServiceWatcher>
#include <QObject>

class QDBusPendingCallWatcher;

namespace fcitx {

class Fcitx4Watcher;
class Fcitx4InputContextProxyPrivate;

class Fcitx4InputContextProxy : public QObject {
    Q_OBJECT
public:
    Fcitx4InputContextProxy(Fcitx4Watcher *watcher, QObject *parent);
    ~Fcitx4InputContextProxy();

    bool isValid() const;
    void setDisplay(const QString &display);
    const QString &display() const;

public Q_SLOTS:
    QDBusPendingReply<> focusIn();
    QDBusPendingReply<> focusOut();
    QDBusPendingReply<int> processKeyEvent(unsigned int keyval,
                                           unsigned int keycode,
                                           unsigned int state, int type,
                                           unsigned int time);
    QDBusPendingReply<> reset();
    QDBusPendingReply<> setCapability(unsigned int caps);
    QDBusPendingReply<> setCursorRect(int x, int y, int w, int h);
    QDBusPendingReply<> setSurroundingText(const QString &text,
                                           unsigned int cursor,
                                           unsigned int anchor);
    QDBusPendingReply<> setSurroundingTextPosition(unsigned int cursor,
                                                   unsigned int anchor);

Q_SIGNALS:
    void commitString(const QString &str);
    void currentIM(const QString &name, const QString &uniqueName,
                   const QString &langCode);
    void deleteSurroundingText(int offset, unsigned int nchar);
    void forwardKey(unsigned int keyval, unsigned int state, bool isRelease);
    void updateFormattedPreedit(const FcitxQtFormattedPreeditList &str,
                                int cursorpos);
    void inputContextCreated();

private:
    Fcitx4InputContextProxyPrivate *const d_ptr;
    Q_DECLARE_PRIVATE(Fcitx4InputContextProxy);
};

} // namespace fcitx

#endif // _FCITX4INPUTCONTEXTPROXY_H_