7 #ifndef _FCITX_INSTANCE_H_ 8 #define _FCITX_INSTANCE_H_ 13 #include <fcitx-utils/eventdispatcher.h> 14 #include <fcitx-utils/macros.h> 16 #include <fcitx/fcitxcore_export.h> 17 #include <fcitx/globalconfig.h> 20 #define FCITX_INVALID_COMPOSE_RESULT 0xffffffff 25 class InstancePrivate;
28 class InputContextManager;
29 class InputMethodManager;
30 class InputMethodEngine;
31 class InputMethodEntry;
32 class UserInterfaceManager;
36 using EventHandler = std::function<void(Event &event)>;
41 enum class VirtualKeyboardFunctionMode : uint32_t { Full = 1, Limited = 2 };
46 enum class EventWatcherPhase {
76 Default = PostInputMethod
102 bool initialized()
const {
return !!d_ptr; }
117 void setSignalPipe(
int fd);
136 bool willTryReplace()
const;
147 bool exitWhenMainDisplayDisconnected()
const;
154 bool exiting()
const;
187 bool postEvent(
Event &event);
188 bool postEvent(
Event &&event) {
return postEvent(event); }
196 bool postEvent(
Event &event)
const;
197 bool postEvent(
Event &&event)
const {
return postEvent(event); }
208 FCITX_NODISCARD std::unique_ptr<HandlerTableEntry<EventHandler>>
209 watchEvent(
EventType type, EventWatcherPhase phase, EventHandler callback);
258 FCITXCORE_DEPRECATED uint32_t processCompose(
InputContext *ic,
273 std::optional<std::string> processComposeString(
InputContext *ic,
294 const std::string &orig);
336 void exit(
int exitCode);
345 FCITXCORE_DEPRECATED
void configureAddon(
const std::string &addon);
346 FCITXCORE_DEPRECATED
void configureInputMethod(
const std::string &imName);
349 std::string currentUI();
352 std::string addonForInputMethod(
const std::string &imName);
368 void resetInputMethodList();
376 void reloadAddonConfig(
const std::string &addonName);
381 std::string currentInputMethod();
384 void setCurrentInputMethod(
const std::string &imName);
396 void setCurrentInputMethod(
InputContext *ic,
const std::string &imName,
406 bool enumerateGroup(
bool forward);
409 void enumerate(
bool forward);
421 FocusGroup *defaultFocusGroup(
const std::string &displayHint = {});
431 void setXkbParameters(
const std::string &display,
const std::string &rule,
432 const std::string &model,
const std::string &options);
435 void updateXkbStateMask(
const std::string &display, uint32_t depressed_mods,
436 uint32_t latched_mods, uint32_t locked_mods);
439 void clearXkbStateMask(
const std::string &display);
471 const std::string &message);
479 bool checkUpdate()
const;
482 static const char *version();
509 void setRunning(
bool running);
515 bool isRunning()
const;
523 InputMethodMode inputMethodMode()
const;
532 void setInputMethodMode(InputMethodMode mode);
538 bool isRestartRequested()
const;
540 bool virtualKeyboardAutoShow()
const;
542 void setVirtualKeyboardAutoShow(
bool autoShow);
544 bool virtualKeyboardAutoHide()
const;
546 void setVirtualKeyboardAutoHide(
bool autoHide);
548 VirtualKeyboardFunctionMode virtualKeyboardFunctionMode()
const;
550 void setVirtualKeyboardFunctionMode(VirtualKeyboardFunctionMode mode);
560 void setBinaryMode();
572 bool canRestart()
const;
576 InstancePrivate *privateData();
581 bool canTrigger()
const;
584 bool canChangeGroup()
const;
596 std::unique_ptr<InstancePrivate> d_ptr;
601 #endif // _FCITX_INSTANCE_H_ Base class for all object supports connection.
EventType
Type of input method events.
An instance represents a standalone Fcitx instance.
Formatted string commonly used in user interface.
#define FCITX_DECLARE_SIGNAL(CLASS_NAME, NAME,...)
Declare signal by type.
InputMethodSwitchedReason
The reason why input method is switched to another.
Utilities to enable use object with signal.
A class represents a formatted string.
Base class for fcitx event.
A thread safe class to post event to a certain EventLoop.
CheckUpdateEvent is posted when the Instance is requested to check for newly installed addons and inp...
Input Method event for Fcitx.
An input context represents a client of Fcitx.