Fcitx
Files | Classes | Macros | Typedefs | Enumerations | Functions | Variables | Friends
FcitxCore
Collaboration diagram for FcitxCore:

Files

file  action.h
 Action class.
 
file  addonfactory.h
 Addon Factory class.
 
file  addoninstance.h
 Addon For fcitx.
 
file  addonmanager.h
 Addon Manager class.
 
file  event.h
 Input Method event for Fcitx.
 
file  icontheme.h
 XDG icon specification helper.
 
file  inputcontext.h
 Input Context for Fcitx.
 
file  inputcontextproperty.h
 Input Context Property for Fcitx.
 
file  inputmethodmanager.h
 Input Method Manager For fcitx.
 
file  inputpanel.h
 Class for input panel in UI.
 
file  menu.h
 Class for menu in UI.
 
file  statusarea.h
 Class for status area in UI.
 
file  surroundingtext.h
 Local cache for surrounding text.
 
file  text.h
 Formatted string commonly used in user interface.
 
file  userinterface.h
 Base class for User Interface addon.
 
file  userinterfacemanager.h
 Manager class for user interface.
 

Classes

class  fcitx::Action
 The Action class provides an abstraction for user commands that can be added to user interfaces. More...
 
class  fcitx::SimpleAction
 
class  fcitx::AddonFactory
 Base class for addon factory. More...
 
class  fcitx::AddonInstance
 Base class for any addon in fcitx. More...
 
class  fcitx::AddonManager
 
class  fcitx::Event
 Base class for fcitx event. More...
 
class  fcitx::InputContextEvent
 
class  fcitx::KeyEventBase
 
class  fcitx::KeyEvent
 
class  fcitx::VirtualKeyboardEvent
 
class  fcitx::ForwardKeyEvent
 
class  fcitx::CommitStringEvent
 
class  fcitx::CommitStringWithCursorEvent
 Event for commit string with cursor. More...
 
class  fcitx::InvokeActionEvent
 
class  fcitx::InputContextSwitchInputMethodEvent
 
class  fcitx::ResetEvent
 
class  fcitx::InputContextUpdateUIEvent
 
class  fcitx::InputContextFlushUIEvent
 Events triggered that user interface manager that flush the UI update. More...
 
class  fcitx::VirtualKeyboardVisibilityChangedEvent
 
class  fcitx::InputMethodNotificationEvent
 
class  fcitx::InputMethodActivatedEvent
 
class  fcitx::InputMethodDeactivatedEvent
 
struct  fcitx::InputContextCreatedEvent
 
struct  fcitx::InputContextDestroyedEvent
 
struct  fcitx::FocusInEvent
 
struct  fcitx::FocusOutEvent
 
struct  fcitx::SurroundingTextUpdatedEvent
 
struct  fcitx::CursorRectChangedEvent
 
struct  fcitx::UpdatePreeditEvent
 
class  fcitx::InputMethodGroupChangedEvent
 
class  fcitx::InputMethodGroupAboutToChangeEvent
 
class  fcitx::UIChangedEvent
 
class  fcitx::CheckUpdateEvent
 
class  fcitx::FocusGroupFocusChangedEvent
 Notify a focus change for focus group. More...
 
class  fcitx::InputMethodModeChangedEvent
 Notify the input method mode is changed. More...
 
class  fcitx::GlobalConfigReloadedEvent
 Notify the global config is reloaded. More...
 
class  fcitx::CapabilityEvent
 
class  fcitx::CapabilityChangedEvent
 
class  fcitx::CapabilityAboutToChangeEvent
 
class  fcitx::IconThemeDirectory
 
class  fcitx::IconTheme
 A implementation of freedesktop.org icont specification. More...
 
class  fcitx::InputContext
 An input context represents a client of Fcitx. More...
 
class  fcitx::InputContextV2
 
class  fcitx::InputContextEventBlocker
 A helper class for frontend addon. More...
 
class  fcitx::InputContextProperty
 This is a class that designed to store state that is specific to certain input context. More...
 
class  fcitx::InputContextPropertyFactory
 Factory class for input context property. More...
 
class  fcitx::SimpleInputContextPropertyFactory< T >
 
class  fcitx::LambdaInputContextPropertyFactory< Ret >
 
class  fcitx::InputMethodManager
 Class to manage all the input method relation information. More...
 
class  fcitx::InputPanel
 Input Panel is usually a floating window that is display at the cursor of input. More...
 
class  fcitx::Menu
 Menu that contains a list of actions. More...
 
class  fcitx::StatusArea
 Status area represent a list of actions and action may have sub actions. More...
 
class  fcitx::SurroundingText
 Class represents the current state of surrounding text of an input context. More...
 
class  fcitx::Text
 A class represents a formatted string. More...
 
class  fcitx::UserInterface
 ... More...
 
class  fcitx::VirtualKeyboardUserInterface
 
class  fcitx::UserInterfaceManager
 

Macros

#define FCITX_ADDON_EXPORT   __attribute__((visibility("default")))
 
#define FCITX_ADDON_DECLARE_FUNCTION(NAME, FUNCTION, SIGNATURE...)
 
#define FCITX_ADDON_EXPORT_FUNCTION(CLASS, FUNCTION)
 
#define FCITX_ADDON_FACTORY(ClassName)
 
#define FCITX_ADDON_FACTORY_V2(AddonName, ClassName)
 
#define FCITX_DEFINE_STATIC_ADDON_REGISTRY(Name, ...)
 
#define FCITX_ADDON_FACTORY_V2_BACKWARDS(AddonName, ClassName)
 
#define FCITX_IMPORT_ADDON_FACTORY(StaticRegistryGetter, AddonName)
 
#define FCITX_ADDON_DEPENDENCY_LOADER(NAME, ADDONMANAGER)
 A convenient macro to obtain the addon pointer of another addon. More...
 
#define FCITX_DEFINE_SIMPLE_EVENT(NAME, TYPE, ARGS...)
 

Typedefs

using fcitx::ICUUID = std::array< uint8_t, 16 >
 
using fcitx::InputContextVisitor = std::function< bool(InputContext *ic)>
 
typedef T fcitx::SimpleInputContextPropertyFactory< T >::PropertyType
 
typedef Ret fcitx::LambdaInputContextPropertyFactory< Ret >::PropertyType
 
template<typename T >
using fcitx::FactoryFor = LambdaInputContextPropertyFactory< T >
 Convinient short type alias for creating a LambdaInputContextPropertyFactory. More...
 
using fcitx::CustomInputPanelCallback = std::function< void(InputContext *)>
 

Enumerations

enum  ResetReason { FCITXCORE_DEPRECATED, FCITXCORE_DEPRECATED, FCITXCORE_DEPRECATED, Client }
 
enum  fcitx::InputMethodSwitchedReason {
  fcitx::InputMethodSwitchedReason::Trigger, fcitx::InputMethodSwitchedReason::Deactivate, fcitx::InputMethodSwitchedReason::AltTrigger, fcitx::InputMethodSwitchedReason::Activate,
  fcitx::InputMethodSwitchedReason::Enumerate, fcitx::InputMethodSwitchedReason::GroupChange, fcitx::InputMethodSwitchedReason::CapabilityChanged, fcitx::InputMethodSwitchedReason::Other
}
 The reason why input method is switched to another. More...
 
enum  InputMethodMode { PhysicalKeyboard, OnScreenKeyboard }
 
enum  fcitx::EventType : uint32_t {
  EventTypeFlag = 0xfffff000, UserTypeFlag = 0xffff0000, InputContextEventFlag = 0x0001000, InputMethodEventFlag = 0x0002000,
  fcitx::EventType::InstanceEventFlag = 0x0003000, InputContextCreated = InputContextEventFlag | 0x1, InputContextDestroyed = InputContextEventFlag | 0x2, fcitx::EventType::InputContextFocusIn = InputContextEventFlag | 0x3,
  fcitx::EventType::InputContextFocusOut = InputContextEventFlag | 0x4, fcitx::EventType::InputContextKeyEvent = InputContextEventFlag | 0x5, fcitx::EventType::InputContextReset = InputContextEventFlag | 0x6, InputContextSurroundingTextUpdated = InputContextEventFlag | 0x7,
  InputContextCapabilityChanged = InputContextEventFlag | 0x8, InputContextCursorRectChanged = InputContextEventFlag | 0x9, InputContextCapabilityAboutToChange = InputContextEventFlag | 0xD, fcitx::EventType::InputContextSwitchInputMethod = InputContextEventFlag | 0xA,
  InputContextInputMethodActivated = InputContextEventFlag | 0xB, InputContextInputMethodDeactivated = InputContextEventFlag | 0xC, fcitx::EventType::InputContextInvokeAction = InputContextEventFlag | 0xE, InputContextVirtualKeyboardEvent = InputContextEventFlag | 0xF,
  InputContextForwardKey = InputMethodEventFlag | 0x1, InputContextCommitString = InputMethodEventFlag | 0x2, InputContextDeleteSurroundingText = InputMethodEventFlag | 0x3, InputContextUpdatePreedit = InputMethodEventFlag | 0x4,
  InputContextUpdateUI = InputMethodEventFlag | 0x5, InputContextCommitStringWithCursor = InputMethodEventFlag | 0x6, InputContextFlushUI = InputMethodEventFlag | 0x7, fcitx::EventType::InputMethodGroupChanged = InstanceEventFlag | 0x1,
  fcitx::EventType::InputMethodGroupAboutToChange = InstanceEventFlag | 0x2, fcitx::EventType::UIChanged = InstanceEventFlag | 0x3, fcitx::EventType::CheckUpdate = InstanceEventFlag | 0x4, fcitx::EventType::FocusGroupFocusChanged = InstanceEventFlag | 0x5,
  fcitx::EventType::InputMethodModeChanged = InstanceEventFlag | 0x6, fcitx::EventType::GlobalConfigReloaded = InstanceEventFlag | 0x7, fcitx::EventType::VirtualKeyboardVisibilityChanged = InstanceEventFlag | 0x8
}
 Type of input method events. More...
 
enum  Action { LeftClick, RightClick }
 
enum  fcitx::StatusGroup { fcitx::StatusGroup::BeforeInputMethod, fcitx::StatusGroup::InputMethod, fcitx::StatusGroup::AfterInputMethod }
 
enum  fcitx::UserInterfaceComponent { fcitx::UserInterfaceComponent::InputPanel, fcitx::UserInterfaceComponent::StatusArea }
 

Functions

bool fcitx::Action::isSeparator () const
 Whether the action is a separator action.
 
Actionfcitx::Action::setSeparator (bool separator)
 Set whether this action is a separator. More...
 
bool fcitx::Action::isCheckable () const
 Whether the action is a checkable action.
 
Actionfcitx::Action::setCheckable (bool checkable)
 Set whether this action is a checkable action. More...
 
const std::string & fcitx::Action::name () const
 The action name when this action is registered.
 
bool fcitx::Action::registerAction (const std::string &name, UserInterfaceManager *uiManager)
 Register an action to UserInterfaceManager. More...
 
virtual std::string fcitx::Action::shortText (InputContext *) const =0
 Short description for this action of given input context.
 
virtual std::string fcitx::Action::icon (InputContext *) const =0
 Icon name of this action of given input context.
 
virtual bool fcitx::Action::isChecked (InputContext *) const
 Return if this action is checked. More...
 
virtual std::string fcitx::Action::longText (InputContext *) const
 Return a long description for this action. More...
 
void fcitx::Action::setMenu (Menu *menu)
 Set the sub menu of this action. More...
 
Menufcitx::Action::menu ()
 Return the sub menu of this action.
 
int fcitx::Action::id ()
 Return the unique integer id of action. More...
 
virtual void fcitx::Action::activate (InputContext *)
 Activate this action. More...
 
void fcitx::Action::update (InputContext *ic)
 Notify that this action is required to be updated of given input context. More...
 
 fcitx::Action::FCITX_DECLARE_SIGNAL (Action, Update, void(InputContext *))
 
const KeyList & fcitx::Action::hotkey () const
 Hotkey bound to the action. More...
 
void fcitx::Action::setHotkey (const KeyList &hotkey)
 Set associated hotkey for display. More...
 
void fcitx::SimpleAction::setIcon (const std::string &icon)
 
void fcitx::SimpleAction::setChecked (bool checked)
 
void fcitx::SimpleAction::setShortText (const std::string &text)
 
void fcitx::SimpleAction::setLongText (const std::string &text)
 
std::string fcitx::SimpleAction::shortText (InputContext *) const override
 Short description for this action of given input context.
 
std::string fcitx::SimpleAction::icon (InputContext *) const override
 Icon name of this action of given input context.
 
bool fcitx::SimpleAction::isChecked (InputContext *) const override
 Return if this action is checked. More...
 
std::string fcitx::SimpleAction::longText (InputContext *) const override
 Return a long description for this action. More...
 
void fcitx::SimpleAction::activate (fcitx::InputContext *) override
 Activate this action. More...
 
 fcitx::SimpleAction::FCITX_DECLARE_SIGNAL (SimpleAction, Activated, void(InputContext *))
 
virtual AddonInstancefcitx::AddonFactory::create (AddonManager *manager)=0
 Create a addon instance for given addon manager. More...
 
virtual void fcitx::AddonInstance::reloadConfig ()
 Reload configuration from disk.
 
virtual void fcitx::AddonInstance::save ()
 Save any relevant data. Usually, it will be invoked when fcitx exits.
 
virtual const Configurationfcitx::AddonInstance::getConfig () const
 Get the configuration.
 
virtual void fcitx::AddonInstance::setConfig (const RawConfig &)
 Set configuration from Raw Config.
 
virtual const Configurationfcitx::AddonInstance::getSubConfig (const std::string &) const
 
virtual void fcitx::AddonInstance::setSubConfig (const std::string &, const RawConfig &)
 
template<typename Signature , typename... Args>
std::function< Signature >::result_type fcitx::AddonInstance::callWithSignature (const std::string &name, Args &&...args)
 
template<typename MetaSignatureString , typename... Args>
AddonFunctionSignatureReturnType< MetaSignatureString > fcitx::AddonInstance::callWithMetaString (Args &&...args)
 
template<typename MetaType , typename... Args>
AddonFunctionSignatureReturnType< typename MetaType::Name > fcitx::AddonInstance::call (Args &&...args)
 Call an exported function for this addon.
 
void fcitx::AddonInstance::registerCallback (const std::string &name, AddonFunctionAdaptorBase *adaptor)
 
const AddonInfofcitx::AddonInstance::addonInfo () const
 
bool fcitx::AddonInstance::canRestart () const
 Check if this addon can safely restart. More...
 
void fcitx::AddonInstance::setCanRestart (bool canRestart)
 Set if this addon can safely restart. More...
 
 fcitx::AddonManager::AddonManager ()
 Construct an addon manager.
 
 fcitx::AddonManager::AddonManager (const std::string &addonConfigDir)
 Create addon manager with given addon config dir. More...
 
virtual fcitx::AddonManager::~AddonManager ()
 Destruct and unload all addons.
 
void fcitx::AddonManager::registerDefaultLoader (StaticAddonRegistry *registry)
 Register addon loader, including static and shared library loader. More...
 
void fcitx::AddonManager::registerLoader (std::unique_ptr< AddonLoader > loader)
 Register new addon loader. More...
 
void fcitx::AddonManager::unregisterLoader (const std::string &name)
 Unregister addon loader. More...
 
void fcitx::AddonManager::load (const std::unordered_set< std::string > &enabled={}, const std::unordered_set< std::string > &disabled={})
 Load addon based on given parameter. More...
 
void fcitx::AddonManager::unload ()
 Destruct all addon, all information is cleared to the initial state. More...
 
void fcitx::AddonManager::saveAll ()
 Save all addon configuration. More...
 
AddonInstancefcitx::AddonManager::addon (const std::string &name, bool load=false)
 Get the loaded addon instance. More...
 
AddonInstancefcitx::AddonManager::lookupAddon (const std::string &name) const
 Get the currently loaded addon instance. More...
 
const std::vector< std::string > & fcitx::AddonManager::loadedAddonNames () const
 Return the loaded addon name in the order of they were loaded. More...
 
const AddonInfofcitx::AddonManager::addonInfo (const std::string &name) const
 Get addon information for given addon. More...
 
std::unordered_set< std::string > fcitx::AddonManager::addonNames (AddonCategory category)
 
Instancefcitx::AddonManager::instance ()
 Return the fcitx instance when it is created by Fcitx. More...
 
EventLoopfcitx::AddonManager::eventLoop ()
 Return the associated event loop. More...
 
void fcitx::AddonManager::setEventLoop (EventLoop *eventLoop)
 Set event loop. More...
 
const SemanticVersionfcitx::AddonManager::version () const
 Return the version number of Fcitx5Core library.
 
bool fcitx::AddonManager::checkUpdate () const
 Check directory for quick hint for whether update is required. More...
 
void fcitx::AddonManager::setAddonOptions (std::unordered_map< std::string, std::vector< std::string >> options)
 Set addon parameters that may be used during addon construction. More...
 
std::vector< std::string > fcitx::AddonManager::addonOptions (const std::string &name)
 Query addon options that set with setAddonOptions for given addon. More...
 
 fcitx::Event::Event (EventType type)
 
EventType fcitx::Event::type () const
 Type of event, can be used to decide event class. More...
 
void fcitx::Event::accept ()
 
bool fcitx::Event::accepted () const
 Return value used by Instance::postEvent. More...
 
virtual bool fcitx::Event::filtered () const
 Whether a event is filtered by handler. More...
 
bool fcitx::Event::isInputContextEvent () const
 A helper function to check if a event is input context event. More...
 
 fcitx::InputContextEvent::InputContextEvent (InputContext *context, EventType type)
 
InputContextfcitx::InputContextEvent::inputContext () const
 
 fcitx::KeyEventBase::KeyEventBase (EventType type, InputContext *context, Key rawKey, bool isRelease=false, int time=0)
 
 fcitx::KeyEventBase::KeyEventBase (const KeyEventBase &)=default
 
Key fcitx::KeyEventBase::key () const
 Normalized key event. More...
 
void fcitx::KeyEventBase::setKey (const Key &key)
 It will automatically be called if input method layout does not match the system keyboard layout. More...
 
void fcitx::KeyEventBase::setRawKey (const Key &key)
 It is designed for faking the key event. More...
 
void fcitx::KeyEventBase::setForward (bool forward)
 It is designed for overriding the key forward option. More...
 
Key fcitx::KeyEventBase::origKey () const
 Key event regardless of keyboard layout conversion. More...
 
Key fcitx::KeyEventBase::rawKey () const
 Key event after layout conversion. More...
 
bool fcitx::KeyEventBase::isRelease () const
 
int fcitx::KeyEventBase::time () const
 
bool fcitx::KeyEventBase::forward () const
 If true, the key that produce character will commit a string. More...
 
bool fcitx::KeyEventBase::isVirtual () const
 Whether this key event is derived from a virtual keyboard. More...
 
 fcitx::KeyEvent::KeyEvent (InputContext *context, Key rawKey, bool isRelease=false, int time=0)
 
void fcitx::KeyEvent::filter ()
 
bool fcitx::KeyEvent::filtered () const override
 Whether a event is filtered by handler. More...
 
void fcitx::KeyEvent::filterAndAccept ()
 
 fcitx::VirtualKeyboardEvent::VirtualKeyboardEvent (InputContext *context, bool isRelease, int time=0)
 
int fcitx::VirtualKeyboardEvent::time () const
 
void fcitx::VirtualKeyboardEvent::setKey (Key key)
 
const Keyfcitx::VirtualKeyboardEvent::key () const
 
void fcitx::VirtualKeyboardEvent::setPosition (float x, float y)
 
float fcitx::VirtualKeyboardEvent::x () const
 
float fcitx::VirtualKeyboardEvent::y () const
 
void fcitx::VirtualKeyboardEvent::setLongPress (bool longPress)
 
bool fcitx::VirtualKeyboardEvent::isLongPress () const
 
void fcitx::VirtualKeyboardEvent::setUserAction (uint64_t actionId)
 
uint64_t fcitx::VirtualKeyboardEvent::userAction () const
 
void fcitx::VirtualKeyboardEvent::setText (std::string text)
 
const std::string & fcitx::VirtualKeyboardEvent::text () const
 
std::unique_ptr< KeyEventfcitx::VirtualKeyboardEvent::toKeyEvent () const
 
 fcitx::VirtualKeyboardEvent::FCITX_DECLARE_PRIVATE (VirtualKeyboardEvent)
 
 fcitx::ForwardKeyEvent::ForwardKeyEvent (InputContext *context, Key rawKey, bool isRelease=false, int time=0)
 
 fcitx::CommitStringEvent::CommitStringEvent (const std::string &text, InputContext *context)
 
const std::string & fcitx::CommitStringEvent::text () const
 
 fcitx::CommitStringWithCursorEvent::CommitStringWithCursorEvent (std::string text, size_t cursor, InputContext *context)
 
const std::string & fcitx::CommitStringWithCursorEvent::text () const
 
size_t fcitx::CommitStringWithCursorEvent::cursor () const
 
 fcitx::InvokeActionEvent::InvokeActionEvent (Action action, int cursor, InputContext *context)
 
Action fcitx::InvokeActionEvent::action () const
 
int fcitx::InvokeActionEvent::cursor () const
 
void fcitx::InvokeActionEvent::filter ()
 
bool fcitx::InvokeActionEvent::filtered () const override
 Whether a event is filtered by handler. More...
 
 fcitx::InputContextSwitchInputMethodEvent::InputContextSwitchInputMethodEvent (InputMethodSwitchedReason reason, const std::string &oldIM, InputContext *context)
 
InputMethodSwitchedReason fcitx::InputContextSwitchInputMethodEvent::reason () const
 
const std::string & fcitx::InputContextSwitchInputMethodEvent::oldInputMethod () const
 
FCITXCORE_DEPRECATED fcitx::ResetEvent::ResetEvent (ResetReason reason, InputContext *context)
 
 fcitx::ResetEvent::ResetEvent (InputContext *context)
 
FCITXCORE_DEPRECATED ResetReason fcitx::ResetEvent::reason () const
 
 fcitx::InputContextUpdateUIEvent::InputContextUpdateUIEvent (UserInterfaceComponent component, InputContext *context, bool immediate=false)
 
UserInterfaceComponent fcitx::InputContextUpdateUIEvent::component () const
 
bool fcitx::InputContextUpdateUIEvent::immediate () const
 
 fcitx::InputContextFlushUIEvent::InputContextFlushUIEvent (UserInterfaceComponent component, InputContext *context)
 
UserInterfaceComponent fcitx::InputContextFlushUIEvent::component () const
 
 fcitx::InputMethodNotificationEvent::InputMethodNotificationEvent (EventType type, const std::string &name, InputContext *context)
 
const std::string & fcitx::InputMethodNotificationEvent::name () const
 
 fcitx::InputMethodActivatedEvent::InputMethodActivatedEvent (const std::string &name, InputContext *context)
 
 fcitx::InputMethodDeactivatedEvent::InputMethodDeactivatedEvent (const std::string &name, InputContext *context)
 
 fcitx::InputContextCreatedEvent::InputContextCreatedEvent (InputContext *ic)
 
 fcitx::InputContextDestroyedEvent::InputContextDestroyedEvent (InputContext *ic)
 
 fcitx::FocusInEvent::FocusInEvent (InputContext *ic)
 
 fcitx::FocusOutEvent::FocusOutEvent (InputContext *ic)
 
 fcitx::SurroundingTextUpdatedEvent::SurroundingTextUpdatedEvent (InputContext *ic)
 
 fcitx::CursorRectChangedEvent::CursorRectChangedEvent (InputContext *ic)
 
 fcitx::UpdatePreeditEvent::UpdatePreeditEvent (InputContext *ic)
 
void fcitx::CheckUpdateEvent::setHasUpdate ()
 Make checking update short circuit. More...
 
bool fcitx::CheckUpdateEvent::filtered () const override
 Whether a event is filtered by handler. More...
 
 fcitx::FocusGroupFocusChangedEvent::FocusGroupFocusChangedEvent (FocusGroup *group, InputContext *oldFocus, InputContext *newFocus)
 
FocusGroupfcitx::FocusGroupFocusChangedEvent::group () const
 
InputContextfcitx::FocusGroupFocusChangedEvent::oldFocus () const
 
InputContextfcitx::FocusGroupFocusChangedEvent::newFocus () const
 
 fcitx::CapabilityEvent::CapabilityEvent (InputContext *ic, EventType type, CapabilityFlags oldFlags, CapabilityFlags newFlags)
 
auto fcitx::CapabilityEvent::oldFlags () const
 
auto fcitx::CapabilityEvent::newFlags () const
 
 fcitx::CapabilityChangedEvent::CapabilityChangedEvent (InputContext *ic, CapabilityFlags oldFlags, CapabilityFlags newFlags)
 
 fcitx::CapabilityAboutToChangeEvent::CapabilityAboutToChangeEvent (InputContext *ic, CapabilityFlags oldFlags, CapabilityFlags newFlags)
 
 fcitx::FCITX_CONFIG_ENUM (IconThemeDirectoryType, Fixed, Scalable, Threshold)
 
 fcitx::IconThemeDirectory::IconThemeDirectory (const RawConfig &config=RawConfig())
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_VIRTUAL_DTOR_COPY_AND_MOVE (IconThemeDirectory)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (std::string, path)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (int, size)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (int, scale)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (std::string, context)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (IconThemeDirectoryType, type)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (int, maxSize)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (int, minSize)
 
 fcitx::IconThemeDirectory::FCITX_DECLARE_READ_ONLY_PROPERTY (int, threshold)
 
bool fcitx::IconThemeDirectory::matchesSize (int iconsize, int iconscale) const
 
int fcitx::IconThemeDirectory::sizeDistance (int iconsize, int iconscale) const
 
 fcitx::IconTheme::IconTheme (const char *name, const StandardPath &standardPath)
 
 fcitx::IconTheme::IconTheme (const std::string &name, const StandardPath &standardPath)
 
 fcitx::IconTheme::IconTheme (const StandardPath &standardPath)
 
 fcitx::IconTheme::IconTheme (const std::string &name, const StandardPaths &standardPath=StandardPaths::global())
 
 fcitx::IconTheme::IconTheme (const StandardPaths &standardPath=StandardPaths::global())
 
 fcitx::IconTheme::FCITX_DECLARE_VIRTUAL_DTOR_MOVE (IconTheme)
 
FCITXCORE_DEPRECATED std::string fcitx::IconTheme::findIcon (const std::string &iconName, unsigned int desiredSize, int scale=1, const std::vector< std::string > &extensions={".svg", ".png", ".xpm"})
 
FCITXCORE_DEPRECATED std::string fcitx::IconTheme::findIcon (const std::string &iconName, unsigned int desiredSize, int scale=1, const std::vector< std::string > &extensions={".svg", ".png", ".xpm"}) const
 
std::filesystem::path fcitx::IconTheme::findIconPath (const std::string &iconName, unsigned int desiredSize, int scale=1, const std::vector< std::string > &extensions={".svg", ".png", ".xpm"}) const
 
static std::string fcitx::IconTheme::defaultIconThemeName ()
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (std::string, internalName)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (I18NString, name)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (I18NString, comment)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (std::vector< IconTheme >, inherits)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (std::vector< IconThemeDirectory >, directories)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (std::vector< IconThemeDirectory >, scaledDirectories)
 
 fcitx::IconTheme::FCITX_DECLARE_READ_ONLY_PROPERTY (std::string, example)
 
static std::string fcitx::IconTheme::iconName (const std::string &icon, bool inFlatpak=isInFlatpak())
 Rename fcitx-* icon to org.fcitx.Fcitx5.fcitx-* if in flatpak.
 
 fcitx::InputContext::InputContext (InputContextManager &manager, const std::string &program={})
 
 fcitx::InputContext::InputContext (InputContext &&other)=delete
 
virtual const char * fcitx::InputContext::frontend () const =0
 Returns the underlying implementation of Input Context.
 
std::string_view fcitx::InputContext::frontendName () const
 Return the frontend name. More...
 
const ICUUID & fcitx::InputContext::uuid () const
 Returns the uuid of this input context.
 
const std::string & fcitx::InputContext::program () const
 Returns the program name of input context. More...
 
std::string fcitx::InputContext::display () const
 Returns the display server of the client. More...
 
const Rectfcitx::InputContext::cursorRect () const
 Returns the cursor position of the client.
 
double fcitx::InputContext::scaleFactor () const
 Return the client scale factor.
 
void fcitx::InputContext::focusIn ()
 Called When input context gains the input focus.
 
void fcitx::InputContext::focusOut ()
 Called when input context losts the input focus.
 
void fcitx::InputContext::setFocusGroup (FocusGroup *group)
 Set the focus group of this input context. More...
 
FocusGroupfcitx::InputContext::focusGroup () const
 Returns the current focus group of input context.
 
FCITXCORE_DEPRECATED void fcitx::InputContext::reset (ResetReason reason)
 Called when input context state need to be reset.
 
void fcitx::InputContext::reset ()
 Called when input context state need to be reset. More...
 
void fcitx::InputContext::setCapabilityFlags (CapabilityFlags flags)
 Update the capability flags of the input context. More...
 
CapabilityFlags fcitx::InputContext::capabilityFlags () const
 Returns the current capability flags. More...
 
void fcitx::InputContext::setEnablePreedit (bool enable)
 Override the preedit hint from client.
 
bool fcitx::InputContext::isPreeditEnabled () const
 Check if preedit is manually disabled.
 
void fcitx::InputContext::setCursorRect (Rect rect)
 Update the current cursor rect of the input context.
 
void fcitx::InputContext::setCursorRect (Rect rect, double scale)
 Update the client rect with scale factor.
 
bool fcitx::InputContext::keyEvent (KeyEvent &event)
 Send a key event to current input context.
 
bool fcitx::InputContext::virtualKeyboardEvent (VirtualKeyboardEvent &event)
 Send a virtual keyboard event to current input context. More...
 
bool fcitx::InputContext::hasFocus () const
 Returns whether the input context holds the input focus. More...
 
void fcitx::InputContext::invokeAction (InvokeActionEvent &event)
 Invoke an action on the preedit.
 
SurroundingTextfcitx::InputContext::surroundingText ()
 Returns the mutable surrounding text of the input context. More...
 
const SurroundingTextfcitx::InputContext::surroundingText () const
 Returns the immutable surrounding text of the input context.
 
void fcitx::InputContext::updateSurroundingText ()
 Notifies the surrounding text modification from the client.
 
void fcitx::InputContext::commitString (const std::string &text)
 Commit a string to the client.
 
void fcitx::InputContext::commitStringWithCursor (const std::string &text, size_t cursor)
 Commit a string to application with a cursor location after commit. More...
 
void fcitx::InputContext::deleteSurroundingText (int offset, unsigned int size)
 Ask client to delete a range of surrounding text.
 
void fcitx::InputContext::forwardKey (const Key &rawKey, bool isRelease=false, int time=0)
 Send a key event to client.
 
void fcitx::InputContext::updatePreedit ()
 Notifies client about changes in clientPreedit. More...
 
void fcitx::InputContext::updateUserInterface (UserInterfaceComponent component, bool immediate=false)
 Notifies UI about changes in user interface. More...
 
void fcitx::InputContext::setBlockEventToClient (bool block)
 Prevent event deliver to input context, and re-send the event later. More...
 
bool fcitx::InputContext::hasPendingEvents () const
 
bool fcitx::InputContext::hasPendingEventsStrictOrder () const
 Has pending event that need to use key order fix. More...
 
InputContextPropertyfcitx::InputContext::property (const std::string &name)
 Returns the input context property by name.
 
InputContextPropertyfcitx::InputContext::property (const InputContextPropertyFactory *factory)
 Returns the input context property by factory.
 
InputPanelfcitx::InputContext::inputPanel ()
 Returns the associated input panel.
 
const InputPanelfcitx::InputContext::inputPanel () const
 Returns the associated input panel. More...
 
StatusAreafcitx::InputContext::statusArea ()
 Returns the associated StatusArea.
 
const StatusAreafcitx::InputContext::statusArea () const
 Returns the associated StatusArea. More...
 
template<typename T >
T * fcitx::InputContext::propertyAs (const std::string &name)
 Helper function to return the input context property in specific type. More...
 
template<typename T >
T::PropertyType * fcitx::InputContext::propertyFor (const T *factory)
 Helper function to return the input context property in specific type by given factory. More...
 
void fcitx::InputContext::updateProperty (const std::string &name)
 Notifies the change of a given input context property. More...
 
void fcitx::InputContext::updateProperty (const InputContextPropertyFactory *factory)
 Notifies the change of a given input context property by its factory. More...
 
bool fcitx::InputContext::isVirtualKeyboardVisible () const
 
void fcitx::InputContext::showVirtualKeyboard () const
 
void fcitx::InputContext::hideVirtualKeyboard () const
 
bool fcitx::InputContext::clientControlVirtualkeyboardShow () const
 
void fcitx::InputContext::setClientControlVirtualkeyboardShow (bool show)
 
bool fcitx::InputContext::clientControlVirtualkeyboardHide () const
 
void fcitx::InputContext::setClientControlVirtualkeyboardHide (bool show)
 
virtual void fcitx::InputContext::commitStringImpl (const std::string &text)=0
 Send the committed string to client. More...
 
virtual void fcitx::InputContext::deleteSurroundingTextImpl (int offset, unsigned int size)=0
 Send the delete Surrounding Text request to client. More...
 
virtual void fcitx::InputContext::forwardKeyImpl (const ForwardKeyEvent &key)=0
 Send the forwarded key to client. More...
 
virtual void fcitx::InputContext::updatePreeditImpl ()=0
 Send the preedit update to the client. More...
 
virtual void fcitx::InputContext::updateClientSideUIImpl ()
 Send the UI update to client. More...
 
void fcitx::InputContext::destroy ()
 Notifies the destruction of the input context. More...
 
void fcitx::InputContext::created ()
 Notifies the creation of input context. More...
 
virtual void fcitx::InputContextV2::commitStringWithCursorImpl (const std::string &text, size_t cursor)=0
 
 fcitx::InputContextEventBlocker::InputContextEventBlocker (InputContext *inputContext)
 
virtual void fcitx::InputContextProperty::copyTo (InputContextProperty *)
 copy state to another property. More...
 
virtual bool fcitx::InputContextProperty::needCopy () const
 Quick check if there's need to copy over the state.
 
virtual InputContextPropertyfcitx::InputContextPropertyFactory::create (InputContext &)=0
 
bool fcitx::InputContextPropertyFactory::registered () const
 Return whether the factory is already registered with an InputContextManager. More...
 
void fcitx::InputContextPropertyFactory::unregister ()
 Unregister the factory from current InputContextManager.
 
InputContextPropertyfcitx::SimpleInputContextPropertyFactory< T >::create (InputContext &) override
 
 fcitx::LambdaInputContextPropertyFactory< Ret >::LambdaInputContextPropertyFactory (std::function< Ret *(InputContext &)> f)
 
InputContextPropertyfcitx::LambdaInputContextPropertyFactory< Ret >::create (InputContext &ic) override
 
 fcitx::InputMethodManager::InputMethodManager (AddonManager *addonManager)
 
void fcitx::InputMethodManager::load (const std::function< void(InputMethodManager &)> &buildDefaultGroupCallback={})
 Load the input method information from disk. More...
 
void fcitx::InputMethodManager::reset (const std::function< void(InputMethodManager &)> &buildDefaultGroupCallback={})
 Reset all the group information to initial state.
 
void fcitx::InputMethodManager::refresh ()
 Load new input method configuration file from disk. More...
 
void fcitx::InputMethodManager::save ()
 Save the input method information to disk. More...
 
std::vector< std::string > fcitx::InputMethodManager::groups () const
 Return all the names of group by order.
 
int fcitx::InputMethodManager::groupCount () const
 Return the number of groups.
 
void fcitx::InputMethodManager::setCurrentGroup (const std::string &group)
 Set the name of current group, rest of the group order will be adjusted accordingly. More...
 
const InputMethodGroupfcitx::InputMethodManager::currentGroup () const
 Return the current group.
 
void fcitx::InputMethodManager::enumerateGroup (bool forward)
 Simply enumerate input method groups.
 
void fcitx::InputMethodManager::enumerateGroupTo (const std::string &groupName)
 enumerate group to a certain group. More...
 
void fcitx::InputMethodManager::setDefaultInputMethod (const std::string &name)
 Set default input method for current group. More...
 
const InputMethodGroupfcitx::InputMethodManager::group (const std::string &name) const
 Return the input methdo group of given name.
 
void fcitx::InputMethodManager::setGroup (InputMethodGroup newGroupInfo)
 Update the information of an existing group. More...
 
void fcitx::InputMethodManager::addEmptyGroup (const std::string &name)
 Create a new empty group with given name.
 
void fcitx::InputMethodManager::removeGroup (const std::string &name)
 Remove an existing group by name.
 
void fcitx::InputMethodManager::setGroupOrder (const std::vector< std::string > &groups)
 Update the initial order of groups. More...
 
const InputMethodEntryfcitx::InputMethodManager::entry (const std::string &name) const
 Return a given input method entry by name.
 
bool fcitx::InputMethodManager::foreachEntries (const std::function< bool(const InputMethodEntry &entry)> &callback)
 Enumerate all the input method entries. More...
 
bool fcitx::InputMethodManager::checkUpdate () const
 Check if there is new entries could be loaded. More...
 
 fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL (InputMethodManager, CurrentGroupAboutToChange, void(const std::string &group))
 Emit the signal when current group is about to change. More...
 
 fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL (InputMethodManager, CurrentGroupChanged, void(const std::string &group))
 
 fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL (InputMethodManager, GroupAdded, void(const std::string &group))
 Emit the signal when a new group is added. More...
 
 fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL (InputMethodManager, GroupRemoved, void(const std::string &group))
 Emit the signal when a group is removed. More...
 
 fcitx::InputPanel::InputPanel (InputContext *ic)
 Construct a Input Panel associated with given input context.
 
const Textfcitx::InputPanel::preedit () const
 
void fcitx::InputPanel::setPreedit (const Text &text)
 
const Textfcitx::InputPanel::auxUp () const
 
void fcitx::InputPanel::setAuxUp (const Text &text)
 
const Textfcitx::InputPanel::auxDown () const
 
void fcitx::InputPanel::setAuxDown (const Text &text)
 
const Textfcitx::InputPanel::clientPreedit () const
 The preedit text embedded in client window.
 
void fcitx::InputPanel::setClientPreedit (const Text &clientPreedit)
 
std::shared_ptr< CandidateListfcitx::InputPanel::candidateList () const
 
void fcitx::InputPanel::setCandidateList (std::unique_ptr< CandidateList > candidate)
 
const CustomInputPanelCallback & fcitx::InputPanel::customInputPanelCallback () const
 Return the current input panel display callback. More...
 
void fcitx::InputPanel::setCustomInputPanelCallback (CustomInputPanelCallback callback)
 Set a custom callback to display the input panel. More...
 
const CustomInputPanelCallback & fcitx::InputPanel::customVirtualKeyboardCallback () const
 
void fcitx::InputPanel::setCustomVirtualKeyboardCallback (CustomInputPanelCallback callback)
 
void fcitx::InputPanel::reset ()
 
bool fcitx::InputPanel::empty () const
 Whether input panel is totally empty.
 
void fcitx::Menu::addAction (Action *action)
 
void fcitx::Menu::removeAction (Action *action)
 
void fcitx::Menu::insertAction (Action *before, Action *action)
 
std::vector< Action * > fcitx::Menu::actions ()
 
 fcitx::Menu::FCITX_DECLARE_SIGNAL (Menu, Update, void())
 
 fcitx::StatusArea::StatusArea (InputContext *ic)
 Construct status area for associated input context.
 
void fcitx::StatusArea::addAction (StatusGroup group, Action *action)
 Add an action to given group.
 
void fcitx::StatusArea::removeAction (Action *action)
 Remove an action from given group.
 
void fcitx::StatusArea::clear ()
 Clear all the actions, will be called when input context lost focus.
 
void fcitx::StatusArea::clearGroup (StatusGroup group)
 Clear only given status group.
 
std::vector< Action * > fcitx::StatusArea::actions (StatusGroup group) const
 Get the associated actions for group.
 
std::vector< Action * > fcitx::StatusArea::allActions () const
 Get all the associated actions.
 
 fcitx::SurroundingText::FCITX_DECLARE_VIRTUAL_DTOR_COPY_AND_MOVE (SurroundingText)
 
void fcitx::SurroundingText::invalidate ()
 Reset surrounding text to invalid state.
 
bool fcitx::SurroundingText::isValid () const
 Return whether surrounding text is valid.
 
unsigned int fcitx::SurroundingText::anchor () const
 offset of anchor in character.
 
unsigned int fcitx::SurroundingText::cursor () const
 offset of anchor in character.
 
const std::string & fcitx::SurroundingText::text () const
 
std::string fcitx::SurroundingText::selectedText () const
 
void fcitx::SurroundingText::setText (const std::string &text, unsigned int cursor, unsigned int anchor)
 Set current of surrounding text. More...
 
void fcitx::SurroundingText::setCursor (unsigned int cursor, unsigned int anchor)
 Set current cursor and anchor of surrounding text. More...
 
void fcitx::SurroundingText::deleteText (int offset, unsigned int size)
 Delete surrounding text with offset and size. More...
 
LogMessageBuilderfcitx::operator<< (LogMessageBuilder &log, const SurroundingText &surroundingText)
 
 fcitx::Text::Text (std::string text, TextFormatFlags flag=TextFormatFlag::NoFlag)
 
 fcitx::Text::FCITX_DECLARE_VIRTUAL_DTOR_COPY_AND_MOVE (Text)
 
int fcitx::Text::cursor () const
 Get cursor by byte.
 
void fcitx::Text::setCursor (int pos=-1)
 Set cursor by byte.
 
void fcitx::Text::clear ()
 
void fcitx::Text::append (std::string str, TextFormatFlags flag=TextFormatFlag::NoFlag)
 
void fcitx::Text::append (Text text)
 Append another text. More...
 
const std::string & fcitx::Text::stringAt (int idx) const
 
TextFormatFlags fcitx::Text::formatAt (int idx) const
 
size_t fcitx::Text::size () const
 
bool fcitx::Text::empty () const
 
size_t fcitx::Text::textLength () const
 
std::string fcitx::Text::toString () const
 
std::string fcitx::Text::toStringForCommit () const
 
Text fcitx::Text::normalize () const
 Remove empty string piece and merge the string with same format. More...
 
std::vector< Textfcitx::Text::splitByLine () const
 Split Text object into lines. More...
 
std::ostream & fcitx::operator<< (std::ostream &os, const Text &text)
 
virtual void fcitx::UserInterface::update (UserInterfaceComponent component, InputContext *inputContext)=0
 
virtual bool fcitx::UserInterface::available ()=0
 
virtual void fcitx::UserInterface::suspend ()=0
 
virtual void fcitx::UserInterface::resume ()=0
 
virtual bool fcitx::VirtualKeyboardUserInterface::isVirtualKeyboardVisible () const =0
 
virtual void fcitx::VirtualKeyboardUserInterface::showVirtualKeyboard ()=0
 
virtual void fcitx::VirtualKeyboardUserInterface::hideVirtualKeyboard ()=0
 
 fcitx::UserInterfaceManager::UserInterfaceManager (AddonManager *manager)
 
void fcitx::UserInterfaceManager::load (const std::string &ui={})
 Initialize the UI Addon. More...
 
bool fcitx::UserInterfaceManager::registerAction (const std::string &name, Action *action)
 Register an named action. More...
 
bool fcitx::UserInterfaceManager::registerAction (Action *action)
 Register an anonymous action. More...
 
void fcitx::UserInterfaceManager::unregisterAction (Action *action)
 Unregister the action.
 
Actionfcitx::UserInterfaceManager::lookupAction (const std::string &name) const
 Lookup an action by the name. More...
 
Actionfcitx::UserInterfaceManager::lookupActionById (int id) const
 Lookup an action by id. More...
 
void fcitx::UserInterfaceManager::update (UserInterfaceComponent component, InputContext *inputContext)
 Mark a user interface component to be updated for given input context. More...
 
void fcitx::UserInterfaceManager::expire (InputContext *inputContext)
 Remove all pending updates for a given input context.
 
void fcitx::UserInterfaceManager::flush ()
 
void fcitx::UserInterfaceManager::updateAvailability ()
 Invoke by user interface addon to notify if there is any avaiability change.
 
std::string fcitx::UserInterfaceManager::currentUI () const
 Return the current active addon ui name.
 
bool fcitx::UserInterfaceManager::isVirtualKeyboardVisible () const
 Return if virtual keyboard is visible.
 
void fcitx::UserInterfaceManager::showVirtualKeyboard () const
 Show the virtual keyboard. More...
 
void fcitx::UserInterfaceManager::hideVirtualKeyboard () const
 Hide the virtual keyboard. More...
 
void fcitx::UserInterfaceManager::updateVirtualKeyboardVisibility ()
 Invoke by user interface addon to notify if there is any virtual keyboard visibility change. More...
 

Variables

EventType fcitx::Event::type_
 
bool fcitx::Event::accepted_ = false
 
InputContextfcitx::InputContextEvent::ic_
 
Key fcitx::KeyEventBase::key_
 
Key fcitx::KeyEventBase::origKey_
 
Key fcitx::KeyEventBase::rawKey_
 
bool fcitx::KeyEventBase::isRelease_
 
int fcitx::KeyEventBase::time_
 
bool fcitx::KeyEventBase::forward_ = false
 
std::unique_ptr< VirtualKeyboardEventPrivatefcitx::VirtualKeyboardEvent::d_ptr
 
std::string fcitx::CommitStringEvent::text_
 
std::string fcitx::CommitStringWithCursorEvent::text_
 
size_t fcitx::CommitStringWithCursorEvent::cursor_
 
Action fcitx::InvokeActionEvent::action_
 
int fcitx::InvokeActionEvent::cursor_
 
bool fcitx::InvokeActionEvent::filtered_ = false
 
InputMethodSwitchedReason fcitx::InputContextSwitchInputMethodEvent::reason_
 
std::string fcitx::InputContextSwitchInputMethodEvent::oldInputMethod_
 
ResetReason fcitx::ResetEvent::reason_
 
UserInterfaceComponent fcitx::InputContextUpdateUIEvent::component_
 
bool fcitx::InputContextUpdateUIEvent::immediate_
 
UserInterfaceComponent fcitx::InputContextFlushUIEvent::component_
 
std::string fcitx::InputMethodNotificationEvent::name_
 
const CapabilityFlags fcitx::CapabilityEvent::oldFlags_
 
const CapabilityFlags fcitx::CapabilityEvent::newFlags_
 

Friends

class fcitx::Action::UserInterfaceManager
 
class fcitx::Action::UserInterfaceManagerPrivate
 
class fcitx::AddonInstance::AddonManagerPrivate
 
class fcitx::AddonManager::Instance
 
class fcitx::IconTheme::IconThemePrivate
 
class fcitx::InputContext::InputContextManagerPrivate
 
class fcitx::InputContext::FocusGroup
 
class fcitx::InputContext::UserInterfaceManager
 
class fcitx::InputContext::UserInterfaceManagerPrivate
 
class fcitx::InputContextV2::InputContextPrivate
 
class fcitx::InputContextPropertyFactory::InputContextManager
 
class fcitx::Menu::Action
 

Detailed Description

Macro Definition Documentation

◆ FCITX_ADDON_DECLARE_FUNCTION

#define FCITX_ADDON_DECLARE_FUNCTION (   NAME,
  FUNCTION,
  SIGNATURE... 
)
Value:
namespace fcitx { \
template <> \
struct AddonFunctionSignature<fcitxMakeMetaString(#NAME "::" #FUNCTION)> { \
using type = \
std::remove_reference_t<decltype(std::declval<SIGNATURE>())>; \
}; \
namespace I##NAME { \
struct FUNCTION { \
using Name = fcitxMakeMetaString(#NAME "::" #FUNCTION); \
using Signature = AddonFunctionSignatureType<Name>; \
}; \
} \
}
#define fcitxMakeMetaString(STRING)
Create meta string from string literal.
Definition: metastring.h:192
Definition: action.cpp:17

Definition at line 172 of file addoninstance.h.

◆ FCITX_ADDON_DEPENDENCY_LOADER

#define FCITX_ADDON_DEPENDENCY_LOADER (   NAME,
  ADDONMANAGER 
)
Value:
auto NAME() { \
if (_##NAME##FirstCall_) { \
_##NAME##_ = (ADDONMANAGER).addon(#NAME, true); \
_##NAME##FirstCall_ = false; \
} \
return _##NAME##_; \
} \
bool _##NAME##FirstCall_ = true; \
::fcitx::AddonInstance *_##NAME##_ = nullptr;
Base class for any addon in fcitx.
Definition: addoninstance.h:74

A convenient macro to obtain the addon pointer of another addon.

Definition at line 243 of file addoninstance.h.

◆ FCITX_ADDON_EXPORT_FUNCTION

#define FCITX_ADDON_EXPORT_FUNCTION (   CLASS,
  FUNCTION 
)
Value:
static_assert(std::is_same_v<::fcitx::I##CLASS::FUNCTION::Name, \
fcitxMakeMetaString(#CLASS "::" #FUNCTION)>, \
""); \
decltype(::fcitx::MakeAddonFunctionAdaptor( \
&CLASS::FUNCTION)) FUNCTION##Adaptor{#CLASS "::" #FUNCTION, this, \
&CLASS::FUNCTION}; \
static_assert( \
std::is_same_v<decltype(::fcitx::MakeAddonFunctionAdaptor( \
&CLASS::FUNCTION))::Signature, \
::fcitx::AddonFunctionSignatureType< \
fcitxMakeMetaString(#CLASS "::" #FUNCTION)>>, \
"Signature doesn't match");
#define fcitxMakeMetaString(STRING)
Create meta string from string literal.
Definition: metastring.h:192

Definition at line 187 of file addoninstance.h.

◆ FCITX_ADDON_FACTORY

#define FCITX_ADDON_FACTORY (   ClassName)
Value:
extern "C" { \
FCITX_ADDON_EXPORT ::fcitx::AddonFactory *fcitx_addon_factory_instance() { \
static ClassName factory; \
return &factory; \
} \
}

Definition at line 201 of file addoninstance.h.

◆ FCITX_ADDON_FACTORY_V2

#define FCITX_ADDON_FACTORY_V2 (   AddonName,
  ClassName 
)
Value:
extern "C" { \
FCITX_ADDON_EXPORT ::fcitx::AddonFactory * \
fcitx_addon_factory_instance_##AddonName() { \
static ClassName factory; \
return &factory; \
} \
}

Definition at line 209 of file addoninstance.h.

◆ FCITX_ADDON_FACTORY_V2_BACKWARDS

#define FCITX_ADDON_FACTORY_V2_BACKWARDS (   AddonName,
  ClassName 
)
Value:
FCITX_ADDON_FACTORY_V2(AddonName, ClassName) \
FCITX_ADDON_FACTORY(ClassName)

Definition at line 224 of file addoninstance.h.

◆ FCITX_DEFINE_SIMPLE_EVENT

#define FCITX_DEFINE_SIMPLE_EVENT (   NAME,
  TYPE,
  ARGS... 
)
Value:
struct FCITXCORE_EXPORT NAME##Event : public InputContextEvent { \
NAME##Event(InputContext *ic) \
: InputContextEvent(ic, EventType::TYPE) {} \
}

Definition at line 570 of file event.h.

◆ FCITX_DEFINE_STATIC_ADDON_REGISTRY

#define FCITX_DEFINE_STATIC_ADDON_REGISTRY (   Name,
  ... 
)
Value:
::fcitx::StaticAddonRegistry &Name() { \
static ::fcitx::StaticAddonRegistry registry{__VA_ARGS__}; \
return registry; \
}

Definition at line 218 of file addoninstance.h.

◆ FCITX_IMPORT_ADDON_FACTORY

#define FCITX_IMPORT_ADDON_FACTORY (   StaticRegistryGetter,
  AddonName 
)
Value:
extern "C" { \
::fcitx::AddonFactory *fcitx_addon_factory_instance_##AddonName(); \
} \
class StaticAddonRegistrar_##AddonName { \
public: \
StaticAddonRegistrar_##AddonName() { \
(StaticRegistryGetter)().emplace( \
FCITX_STRINGIFY(AddonName), \
fcitx_addon_factory_instance_##AddonName()); \
} \
}; \
StaticAddonRegistrar_##AddonName staticAddonRegistrar_##AddonName
Base class for addon factory.
Definition: addonfactory.h:23

Definition at line 228 of file addoninstance.h.

Typedef Documentation

◆ FactoryFor

template<typename T >
using fcitx::FactoryFor = typedef LambdaInputContextPropertyFactory<T>

Convinient short type alias for creating a LambdaInputContextPropertyFactory.

Example usage: Define it as a field of AddonInstance.

FactoryFor<MyProperty> factory_;

Register the property to InputContextManager in constructor of AddonInstance.

instance_->inputContextManager().registerProperty("propertyName",
&factory_);

The name of property need to be unique.

Get the property from input context within the addon.

auto *state = inputContext->propertyFor(&factory_);

The returned type will be casted automatically. Get property with factory is faster than get property with name.

Accessing the property outside the addon.

InputContextProperty *state = inputContext->property("propertyName");

You may need to cast the type to access any private data within it.

Definition at line 137 of file inputcontextproperty.h.

Enumeration Type Documentation

◆ EventType

enum fcitx::EventType : uint32_t
strong

Type of input method events.

Enumerator
InstanceEventFlag 

captured by everything

InputContextFocusIn 

FocusInEvent is generated when client gets focused.

See also
FocusInEvent
InputContextFocusOut 

when using lost focus this might be variance case to case.

the default behavior is to commit the preedit, and resetIM.

Controlled by [Output/DontCommitPreeditWhenUnfocus], this option will not work for application switch doesn't support async commit.

So OnClose is called when preedit IS committed (not like CChangeByInactivate, this behavior cannot be overridden), it give im a chance to choose remember this word or not.

Input method need to notice, that the commit is already DONE, do not do extra commit.

See also
FocusOutEvent
InputContextKeyEvent 

Key event is generated when client press or release a key.

See also
KeyEvent
InputContextReset 

ResetEvent is generated.

InputContextSwitchInputMethod 

when user switch to a different input method by hand such as ctrl+shift by default, or by ui, default behavior is reset IM.

InputContextInvokeAction 

InvokeAction event is generated when client click on the preedit.

Not all client support this feature.

Since
5.0.11
InputMethodGroupChanged 

This is generated when input method group changed.

This would also trigger InputContextSwitchInputMethod afterwards.

InputMethodGroupAboutToChange 

InputMethodGroupAboutToChangeEvent is generated when input method group is about to be changed.

See also
InputMethodGroupAboutToChange
UIChanged 

UIChangedEvent is posted when the UI implementation is changed.

CheckUpdate 

CheckUpdateEvent is posted when the Instance is requested to check for newly installed addons and input methods.

This can be used for addons to pick up new input methods if it provides input method at runtime.

FocusGroupFocusChanged 

FocusGroupFocusChanged is posted when a focus group changed its focused input context.

This is a more fine grained control over focus in and focus out event. This is more useful for UI to keep track of what input context is being focused.

See also
FocusInEvent
FocusOutEvent
InputMethodModeChanged 

Input method mode changed.

GlobalConfigReloaded 

Global config is reloaded.

This only fires after fcitx has entered running state. The initial load will not trigger this event.

See also
GlobalConfig
Since
5.1.0
VirtualKeyboardVisibilityChanged 

Virtual keyboard visibility changed.

See also
UserInterfaceManager
Since
5.1.0

Definition at line 65 of file event.h.

◆ InputMethodSwitchedReason

The reason why input method is switched to another.

Enumerator
Trigger 

Switched by trigger key.

Deactivate 

Switched by deactivate key.

AltTrigger 

Switched by alternative trigger key.

Activate 

Switched by activate key.

Enumerate 

Switched by enumerate key.

GroupChange 

Switched by group change.

CapabilityChanged 

Switched by capability change (e.g. password field)

Other 

miscellaneous reason

Definition at line 41 of file event.h.

◆ StatusGroup

enum fcitx::StatusGroup
strong
Enumerator
BeforeInputMethod 

Action shown before input method group.

InputMethod 

Group should be solely used by input method engine.

It will be cleared automatically before InputMethodEngine::activate.

See also
InputMethodEngine::activate
AfterInputMethod 

Action shown after input method group.

Definition at line 27 of file statusarea.h.

◆ UserInterfaceComponent

Enumerator
InputPanel 

Input Panel component.

See also
InputPanel
StatusArea 

Status Area component.

See also
StatusArea

Definition at line 21 of file userinterface.h.

Function Documentation

◆ accepted()

bool fcitx::Event::accepted ( ) const
inline

Return value used by Instance::postEvent.

See also
Instance::postEvent
Returns
bool

Definition at line 231 of file event.h.

◆ activate() [1/2]

virtual void fcitx::Action::activate ( InputContext )
inlinevirtual

Activate this action.

This function may be triggered by user mouse click of the given action.

Reimplemented in fcitx::SimpleAction.

Definition at line 134 of file action.h.

◆ activate() [2/2]

void fcitx::SimpleAction::activate ( fcitx::InputContext )
overridevirtual

Activate this action.

This function may be triggered by user mouse click of the given action.

Reimplemented from fcitx::Action.

Definition at line 166 of file action.cpp.

◆ addon()

AddonInstance * fcitx::AddonManager::addon ( const std::string &  name,
bool  load = false 
)

Get the loaded addon instance.

Parameters
namename of addon.
loadto force load the addon if possible.
Returns
instance of addon.

Definition at line 328 of file addonmanager.cpp.

◆ addonInfo()

const AddonInfo * fcitx::AddonManager::addonInfo ( const std::string &  name) const

Get addon information for given addon.

Parameters
namename of addon.
Returns
const fcitx::AddonInfo*

Definition at line 342 of file addonmanager.cpp.

◆ AddonManager()

fcitx::AddonManager::AddonManager ( const std::string &  addonConfigDir)

Create addon manager with given addon config dir.

By default, addonConfigDir is set to "addon". It can be a relative path to PkgData, or an absolute path. This function is only used by test.

Parameters
addonConfigDirdirectory name.
See also
StandardPath

Definition at line 230 of file addonmanager.cpp.

◆ addonOptions()

std::vector< std::string > fcitx::AddonManager::addonOptions ( const std::string &  name)

Query addon options that set with setAddonOptions for given addon.

Parameters
nameaddon name
Returns
Options for given addon
Since
5.1.7

Definition at line 414 of file addonmanager.cpp.

◆ append()

void fcitx::Text::append ( Text  text)

Append another text.

Parameters
texttext to append
Since
5.1.9

Definition at line 59 of file text.cpp.

◆ canRestart()

bool fcitx::AddonInstance::canRestart ( ) const

Check if this addon can safely restart.

When the existing fcitx 5 instance returns false, fcitx5 -r, or Instance::restart will just be no-op.

Returns
whether it is safe for fcitx to restart on its own.
See also
AddonInstance::setCanRestart
Since
5.1.6

Definition at line 47 of file addoninstance.cpp.

◆ capabilityFlags()

CapabilityFlags fcitx::InputContext::capabilityFlags ( ) const

Returns the current capability flags.

See also
CapabilityFlag

Definition at line 218 of file inputcontext.cpp.

◆ checkUpdate() [1/2]

bool fcitx::InputMethodManager::checkUpdate ( ) const

Check if there is new entries could be loaded.

Returns
whether need to perform update.
See also
InputMethodManager::refresh

Definition at line 477 of file inputmethodmanager.cpp.

◆ checkUpdate() [2/2]

bool fcitx::AddonManager::checkUpdate ( ) const

Check directory for quick hint for whether update is required.

Since
5.0.6

Definition at line 401 of file addonmanager.cpp.

◆ commitStringImpl()

virtual void fcitx::InputContext::commitStringImpl ( const std::string &  text)
protectedpure virtual

Send the committed string to client.

Parameters
textstring
See also
commitString

◆ commitStringWithCursor()

void fcitx::InputContext::commitStringWithCursor ( const std::string &  text,
size_t  cursor 
)

Commit a string to application with a cursor location after commit.

Parameters
texttext to commit
cursorcursor position after commit, the value should be within [0, utf8::length(text)].
See also
CapabilityFlag::CommitStringWithCursor

Definition at line 425 of file inputcontext.cpp.

◆ copyTo()

virtual void fcitx::InputContextProperty::copyTo ( InputContextProperty )
inlinevirtual

copy state to another property.

Default implemenation is empty. This is triggered by InputContext::updateProperty.

See also
InputContext::updateProperty

Definition at line 48 of file inputcontextproperty.h.

◆ create()

virtual AddonInstance* fcitx::AddonFactory::create ( AddonManager manager)
pure virtual

Create a addon instance for given addon manager.

This function is called by AddonManager

Returns
a created addon instance.
See also
AddonManager

◆ created()

void fcitx::InputContext::created ( )
protected

Notifies the creation of input context.

Need to be called at the end of the constructor.

Definition at line 76 of file inputcontext.cpp.

◆ customInputPanelCallback()

const CustomInputPanelCallback & fcitx::InputPanel::customInputPanelCallback ( ) const

Return the current input panel display callback.

See also
setCustomInputPanelCallback
Returns
current custom ui callback
Since
5.0.24

Definition at line 82 of file inputpanel.cpp.

◆ deleteSurroundingTextImpl()

virtual void fcitx::InputContext::deleteSurroundingTextImpl ( int  offset,
unsigned int  size 
)
protectedpure virtual

Send the delete Surrounding Text request to client.

Parameters
offsetoffset of deletion start, in UCS4 char.
sizelength of the deletion in UCS4 char.

◆ deleteText()

void fcitx::SurroundingText::deleteText ( int  offset,
unsigned int  size 
)

Delete surrounding text with offset and size.

This can be used to update the local state of surrounding text before client send it back.

Parameters
offsetoffset to cursor position.
sizelength of text to delete.

Definition at line 99 of file surroundingtext.cpp.

◆ destroy()

void fcitx::InputContext::destroy ( )
protected

Notifies the destruction of the input context.

Need to be called in the destructor.

Definition at line 83 of file inputcontext.cpp.

◆ display()

std::string fcitx::InputContext::display ( ) const

Returns the display server of the client.

In form of type:string, E.g. client from X11 server of :0 will become x11::0.

Definition at line 104 of file inputcontext.cpp.

◆ enumerateGroupTo()

void fcitx::InputMethodManager::enumerateGroupTo ( const std::string &  groupName)

enumerate group to a certain group.

For example, current order is A,B,C,D, enumerateGroupTo(C) will make order to be C,D,A,B.

  • groupName group name

Definition at line 286 of file inputmethodmanager.cpp.

◆ eventLoop()

EventLoop * fcitx::AddonManager::eventLoop ( )

Return the associated event loop.

If AddonManager is created by Instance, it will return the event loop of associated instance.

Returns
event loop.

Definition at line 391 of file addonmanager.cpp.

◆ FCITX_DECLARE_SIGNAL() [1/3]

fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL ( InputMethodManager  ,
CurrentGroupAboutToChange  ,
void(const std::string &group  
)

◆ FCITX_DECLARE_SIGNAL() [2/3]

fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL ( InputMethodManager  ,
GroupAdded  ,
void(const std::string &group  
)

Emit the signal when a new group is added.

This will not be emitted when building the group.

See also
InputMethodManager::addEmptyGroup
Since
5.0.8

◆ FCITX_DECLARE_SIGNAL() [3/3]

fcitx::InputMethodManager::FCITX_DECLARE_SIGNAL ( InputMethodManager  ,
GroupRemoved  ,
void(const std::string &group  
)

Emit the signal when a group is removed.

This will not be emitted when building the group.

See also
InputMethodManager::removeGroup
Since
5.0.8

◆ filtered() [1/4]

virtual bool fcitx::Event::filtered ( ) const
inlinevirtual

Whether a event is filtered by handler.

If event is filtered, it will not send to another handler. For now only keyevent from input context can be filtered.

Returns
bool

Reimplemented in fcitx::CheckUpdateEvent, fcitx::InvokeActionEvent, and fcitx::KeyEvent.

Definition at line 241 of file event.h.

◆ filtered() [2/4]

bool fcitx::KeyEvent::filtered ( ) const
inlineoverridevirtual

Whether a event is filtered by handler.

If event is filtered, it will not send to another handler. For now only keyevent from input context can be filtered.

Returns
bool

Reimplemented from fcitx::Event.

Definition at line 365 of file event.h.

◆ filtered() [3/4]

bool fcitx::InvokeActionEvent::filtered ( ) const
inlineoverridevirtual

Whether a event is filtered by handler.

If event is filtered, it will not send to another handler. For now only keyevent from input context can be filtered.

Returns
bool

Reimplemented from fcitx::Event.

Definition at line 463 of file event.h.

◆ filtered() [4/4]

bool fcitx::CheckUpdateEvent::filtered ( ) const
inlineoverridevirtual

Whether a event is filtered by handler.

If event is filtered, it will not send to another handler. For now only keyevent from input context can be filtered.

Returns
bool

Reimplemented from fcitx::Event.

Definition at line 612 of file event.h.

◆ foreachEntries()

bool fcitx::InputMethodManager::foreachEntries ( const std::function< bool(const InputMethodEntry &entry)> &  callback)

Enumerate all the input method entries.

Returns
return true if the enumeration is done without interruption.

Definition at line 458 of file inputmethodmanager.cpp.

◆ forward()

bool fcitx::KeyEventBase::forward ( ) const
inline

If true, the key that produce character will commit a string.

This is currently used by internal keyboard layout translation.

Returns
bool

Definition at line 340 of file event.h.

◆ forwardKeyImpl()

virtual void fcitx::InputContext::forwardKeyImpl ( const ForwardKeyEvent key)
protectedpure virtual

Send the forwarded key to client.

See also
forwardKey

◆ frontendName()

std::string_view fcitx::InputContext::frontendName ( ) const

Return the frontend name.

Helper function that simply calls InputContext::frontend, but returns a string_view.

Since
5.0.22

Definition at line 81 of file inputcontext.cpp.

◆ hasFocus()

bool fcitx::InputContext::hasFocus ( ) const

Returns whether the input context holds the input focus.

Input context need to have focus.

Definition at line 293 of file inputcontext.cpp.

◆ hasPendingEventsStrictOrder()

bool fcitx::InputContext::hasPendingEventsStrictOrder ( ) const

Has pending event that need to use key order fix.

If pending event only have preedit, then it's generally fine to not use key forward.

Since
5.0.21

Definition at line 394 of file inputcontext.cpp.

◆ hideVirtualKeyboard()

void fcitx::UserInterfaceManager::hideVirtualKeyboard ( ) const

Hide the virtual keyboard.

This is a no-op if active addon is not a virtual keyboard addon.

Definition at line 351 of file userinterfacemanager.cpp.

◆ hotkey()

const KeyList & fcitx::Action::hotkey ( ) const

Hotkey bound to the action.

This is only for display purpose when UI implementation supports it, and it has nothing to do with the key handling logic.

Returns
key list.
Since
5.1.11

Definition at line 101 of file action.cpp.

◆ id()

int fcitx::Action::id ( )

Return the unique integer id of action.

This id is generated when the action is registered. If it is not registered, the value will be 0.

Definition at line 55 of file action.cpp.

◆ inputPanel()

const InputPanel & fcitx::InputContext::inputPanel ( ) const

Returns the associated input panel.

Since
5.0.22

Definition at line 475 of file inputcontext.cpp.

◆ instance()

Instance * fcitx::AddonManager::instance ( )

Return the fcitx instance when it is created by Fcitx.

Returns
fcitx instance.

Definition at line 375 of file addonmanager.cpp.

◆ isChecked() [1/2]

virtual bool fcitx::Action::isChecked ( InputContext ) const
inlinevirtual

Return if this action is checked.

It is only meaningful when isCheckable is true.

See also
setCheckable

Reimplemented in fcitx::SimpleAction.

Definition at line 98 of file action.h.

◆ isChecked() [2/2]

bool fcitx::SimpleAction::isChecked ( InputContext ) const
overridevirtual

Return if this action is checked.

It is only meaningful when isCheckable is true.

See also
setCheckable

Reimplemented from fcitx::Action.

Definition at line 151 of file action.cpp.

◆ isInputContextEvent()

bool fcitx::Event::isInputContextEvent ( ) const
inline

A helper function to check if a event is input context event.

Returns
bool

Definition at line 248 of file event.h.

◆ isVirtual()

bool fcitx::KeyEventBase::isVirtual ( ) const
inline

Whether this key event is derived from a virtual keyboard.

Returns
bool
Since
5.1.2

Definition at line 348 of file event.h.

◆ key()

Key fcitx::KeyEventBase::key ( ) const
inline

Normalized key event.

Returns
fcitx::Key

Definition at line 281 of file event.h.

◆ load() [1/3]

void fcitx::UserInterfaceManager::load ( const std::string &  ui = {})

Initialize the UI Addon.

If passed with a certain UI name, only that UI is treated as the usable UI.

  • ui addon name of the UI to be used.

Definition at line 144 of file userinterfacemanager.cpp.

◆ load() [2/3]

void fcitx::InputMethodManager::load ( const std::function< void(InputMethodManager &)> &  buildDefaultGroupCallback = {})

Load the input method information from disk.

If it does not exist, use the callback to create the default setup.

Definition at line 229 of file inputmethodmanager.cpp.

◆ load() [3/3]

void fcitx::AddonManager::load ( const std::unordered_set< std::string > &  enabled = {},
const std::unordered_set< std::string > &  disabled = {} 
)

Load addon based on given parameter.

By default, addon is enable or disabled by config file, but enabled or disabled may be used to override it.

Usually this function should only be called once. You can pass –enable=... –disable= in fcitx's flag to set it. "enabled" will override "disabled" if they have same addon name in it.

A special name "all" can be used to enable or disable all addons.

Parameters
enabledset of additionally enabled addons.
disabledset of disabled addons

Definition at line 258 of file addonmanager.cpp.

◆ loadedAddonNames()

const std::vector< std::string > & fcitx::AddonManager::loadedAddonNames ( ) const

Return the loaded addon name in the order of they were loaded.

Returns
the name of loaded addons.
Since
5.1.6

Definition at line 357 of file addonmanager.cpp.

◆ longText() [1/2]

virtual std::string fcitx::Action::longText ( InputContext ) const
inlinevirtual

Return a long description for this action.

In some UI implementation, this is not displayed at all. In some other implemented, it is only displayed as tooltip.

Reimplemented in fcitx::SimpleAction.

Definition at line 106 of file action.h.

◆ longText() [2/2]

std::string fcitx::SimpleAction::longText ( InputContext ) const
overridevirtual

Return a long description for this action.

In some UI implementation, this is not displayed at all. In some other implemented, it is only displayed as tooltip.

Reimplemented from fcitx::Action.

Definition at line 161 of file action.cpp.

◆ lookupAction()

Action * fcitx::UserInterfaceManager::lookupAction ( const std::string &  name) const

Lookup an action by the name.

Return null if action is not found.

Returns
action

Definition at line 218 of file userinterfacemanager.cpp.

◆ lookupActionById()

Action * fcitx::UserInterfaceManager::lookupActionById ( int  id) const

Lookup an action by id.

Return null if action is not found.

Returns
action

Definition at line 227 of file userinterfacemanager.cpp.

◆ lookupAddon()

AddonInstance * fcitx::AddonManager::lookupAddon ( const std::string &  name) const

Get the currently loaded addon instance.

This is same as AddonManager::addon(name, false), but allow to be used with a constant AddonManager.

Parameters
nameof addon.
Returns
instance of addon, null if not found.
Since
5.1.6

Definition at line 351 of file addonmanager.cpp.

◆ normalize()

Text fcitx::Text::normalize ( ) const

Remove empty string piece and merge the string with same format.

This function is useful for frontend to send less data over the wire and avoid send data that is problematic for some frontend.

Since
5.1.1

Definition at line 152 of file text.cpp.

◆ origKey()

Key fcitx::KeyEventBase::origKey ( ) const
inline

Key event regardless of keyboard layout conversion.

Returns
fcitx::Key

Definition at line 320 of file event.h.

◆ program()

const std::string & fcitx::InputContext::program ( ) const

Returns the program name of input context.

It can be empty depending on the application.

Definition at line 99 of file inputcontext.cpp.

◆ propertyAs()

template<typename T >
T* fcitx::InputContext::propertyAs ( const std::string &  name)
inline

Helper function to return the input context property in specific type.

Parameters
Ttype of the input context property.
namename of the input context property.
Returns
T*

Definition at line 272 of file inputcontext.h.

◆ propertyFor()

template<typename T >
T::PropertyType* fcitx::InputContext::propertyFor ( const T *  factory)
inline

Helper function to return the input context property in specific type by given factory.

Parameters
Ttype of the input context property factory.
namename of the input context property.
Returns
T*

Definition at line 285 of file inputcontext.h.

◆ rawKey()

Key fcitx::KeyEventBase::rawKey ( ) const
inline

Key event after layout conversion.

Basically it is the "unnormalized" key event.

Returns
fcitx::Key

Definition at line 329 of file event.h.

◆ refresh()

void fcitx::InputMethodManager::refresh ( )

Load new input method configuration file from disk.

It only load "new" input method configuration, and it would not update the loaded data. Should only be used after load is called.

Definition at line 254 of file inputmethodmanager.cpp.

◆ registerAction() [1/3]

bool fcitx::UserInterfaceManager::registerAction ( const std::string &  name,
Action action 
)

Register an named action.

The action should have a meaningful unique name. A common use case for the name is to allow an input method to enable a feature exposed by other addons.

  • name name of the action.
  • action action to be registered.
    Returns
    whether action is registered successfully.

Definition at line 194 of file userinterfacemanager.cpp.

◆ registerAction() [2/3]

bool fcitx::UserInterfaceManager::registerAction ( Action action)

Register an anonymous action.

  • action action to be registered.
    Returns
    whether action is registered successfully.

Definition at line 179 of file userinterfacemanager.cpp.

◆ registerAction() [3/3]

bool fcitx::Action::registerAction ( const std::string &  name,
UserInterfaceManager uiManager 
)

Register an action to UserInterfaceManager.

All action should have a unique name, but it is suggested that the action using a human readable string for its name. In order to make addons work together, other addon may use this name to lookup a certain action.

Definition at line 45 of file action.cpp.

◆ registerDefaultLoader()

void fcitx::AddonManager::registerDefaultLoader ( StaticAddonRegistry *  registry)

Register addon loader, including static and shared library loader.

This function usually need to be called before any other function call to addon manager.

Parameters
registrystatic addon registry that can be used to set a list of built-in addons.

Definition at line 251 of file addonmanager.cpp.

◆ registered()

bool fcitx::InputContextPropertyFactory::registered ( ) const

Return whether the factory is already registered with an InputContextManager.

Definition at line 17 of file inputcontextproperty.cpp.

◆ registerLoader()

void fcitx::AddonManager::registerLoader ( std::unique_ptr< AddonLoader loader)

Register new addon loader.

Parameters
loaderaddon loader instance.

Definition at line 237 of file addonmanager.cpp.

◆ reset()

void fcitx::InputContext::reset ( )

Called when input context state need to be reset.

Input context need to have focus.

Definition at line 355 of file inputcontext.cpp.

◆ save()

void fcitx::InputMethodManager::save ( )

Save the input method information to disk.

Commonly, the storage path will be ~/.config/fcitx5/profile.

Definition at line 424 of file inputmethodmanager.cpp.

◆ saveAll()

void fcitx::AddonManager::saveAll ( )

Save all addon configuration.

See also
fcitx::AddonInstance::save

Definition at line 314 of file addonmanager.cpp.

◆ setAddonOptions()

void fcitx::AddonManager::setAddonOptions ( std::unordered_map< std::string, std::vector< std::string >>  options)

Set addon parameters that may be used during addon construction.

This is usually passed from command line flags –option or -o.

Parameters
optionsmap from addon name to a set of string values
Since
5.1.7

Definition at line 408 of file addonmanager.cpp.

◆ setBlockEventToClient()

void fcitx::InputContext::setBlockEventToClient ( bool  block)

Prevent event deliver to input context, and re-send the event later.

This should be only used by frontend to make sync and async event handled in the same order.

Parameters
blockblock state of input context.
See also
InputContextEventBlocker

Definition at line 376 of file inputcontext.cpp.

◆ setCanRestart()

void fcitx::AddonInstance::setCanRestart ( bool  canRestart)
protected

Set if this addon can safely restart.

In certain cases, it is not a good idea to allow restart fcitx 5. Otherwise fcitx will lose permission. For example, when fcitx is launching with WAYLAND_SOCKET. In that case, user is recommended to use other way to restart fcitx.

The value will be false be default, but it will default to true when running as fcitx5 binary. After initialize addon, addon may change it back to false, for example, wayland module.

Parameters
canRestartWhether fcitx is allowed to restart on its own.
See also
Instance::restart
Since
5.1.6

Definition at line 42 of file addoninstance.cpp.

◆ setCapabilityFlags()

void fcitx::InputContext::setCapabilityFlags ( CapabilityFlags  flags)

Update the capability flags of the input context.

See also
CapabilityFlag

Definition at line 202 of file inputcontext.cpp.

◆ setCheckable()

Action & fcitx::Action::setCheckable ( bool  checkable)

Set whether this action is a checkable action.

This property mainly affect how this action is presented. Usually, it will be displayed as a radio button.

Definition at line 65 of file action.cpp.

◆ setCurrentGroup()

void fcitx::InputMethodManager::setCurrentGroup ( const std::string &  group)

Set the name of current group, rest of the group order will be adjusted accordingly.

Definition at line 271 of file inputmethodmanager.cpp.

◆ setCursor()

void fcitx::SurroundingText::setCursor ( unsigned int  cursor,
unsigned int  anchor 
)

Set current cursor and anchor of surrounding text.

If cursor and anchor are out of range, it will be reset to invalid state. This function is useful to safe some bandwidth.

Parameters
cursoroffset of cursor in character.
anchoroffset of anchor in character.

Definition at line 89 of file surroundingtext.cpp.

◆ setCustomInputPanelCallback()

void fcitx::InputPanel::setCustomInputPanelCallback ( CustomInputPanelCallback  callback)

Set a custom callback to display the input panel.

When this is set, Instance::updateUserInterface(UserInterfaceComponent::InputPanel) will trigger a call to the callback function instead. The capability flag ClientSideInputPanel will not be respected, but the clientPreedit will still be sent if InputContext::updatePreedit is called.

All the UI display batching logic still applies. The actual update that triggers this callback will be called as a deferred event after current event. If you need UI update right away (rare), you can still true as immediate to Instance::updateUserInterface.

Parameters
callbackcallback to display input panel.
Since
5.0.24

Definition at line 87 of file inputpanel.cpp.

◆ setDefaultInputMethod()

void fcitx::InputMethodManager::setDefaultInputMethod ( const std::string &  name)

Set default input method for current group.

See also
InputMethodGroup::setDefaultInputMethod

Definition at line 323 of file inputmethodmanager.cpp.

◆ setEventLoop()

void fcitx::AddonManager::setEventLoop ( EventLoop eventLoop)

Set event loop.

It should be only used with stand alone AddonManager. E.g. write test or for some special purpose.

Parameters
eventLoopevent loop.
See also
fcitx::AddonManager::eventLoop

Definition at line 386 of file addonmanager.cpp.

◆ setFocusGroup()

void fcitx::InputContext::setFocusGroup ( FocusGroup group)

Set the focus group of this input context.

group can be null if it does not belong to any group.

See also
FocusGroup

Definition at line 256 of file inputcontext.cpp.

◆ setForward()

void fcitx::KeyEventBase::setForward ( bool  forward)
inline

It is designed for overriding the key forward option.

Normally should not be used.

Parameters
forward
Since
5.0.4

Definition at line 313 of file event.h.

◆ setGroup()

void fcitx::InputMethodManager::setGroup ( InputMethodGroup  newGroupInfo)

Update the information of an existing group.

The group info will be revalidated and filtered to the existing input methods.

Definition at line 335 of file inputmethodmanager.cpp.

◆ setGroupOrder()

void fcitx::InputMethodManager::setGroupOrder ( const std::vector< std::string > &  groups)

Update the initial order of groups.

This function should be only used in the buildDefaultGroupCallback. Otherwise the group order can be only modified via setCurrentGroup.

Parameters
groupsthe order of groups.
See also
InputMethodManager::load

Definition at line 469 of file inputmethodmanager.cpp.

◆ setHasUpdate()

void fcitx::CheckUpdateEvent::setHasUpdate ( )
inline

Make checking update short circuit.

If anything need a refresh, just simply break.

Definition at line 608 of file event.h.

◆ setHotkey()

void fcitx::Action::setHotkey ( const KeyList &  hotkey)

Set associated hotkey for display.

Parameters
hotkeykeys that trigger the action.
Since
5.1.11

Definition at line 106 of file action.cpp.

◆ setKey()

void fcitx::KeyEventBase::setKey ( const Key key)
inline

It will automatically be called if input method layout does not match the system keyboard layout.

Parameters
keyp_key:...

Definition at line 289 of file event.h.

◆ setMenu()

void fcitx::Action::setMenu ( Menu menu)

Set the sub menu of this action.

Some status area implemenation only supports one level of menu, so it is preferred that only one level of menu is used.

Definition at line 76 of file action.cpp.

◆ setRawKey()

void fcitx::KeyEventBase::setRawKey ( const Key key)
inline

It is designed for faking the key event.

Normally should not be used.

Parameters
keykey event to override.
Since
5.0.4

Definition at line 300 of file event.h.

◆ setSeparator()

Action & fcitx::Action::setSeparator ( bool  separator)

Set whether this action is a separator.

How separator is displayed depends on the user interface implementation. The separator may be not displayed at all.

Definition at line 39 of file action.cpp.

◆ setText()

void fcitx::SurroundingText::setText ( const std::string &  text,
unsigned int  cursor,
unsigned int  anchor 
)

Set current of surrounding text.

If cursor and anchor are out of range, it will be reset to invalid state.

Parameters
texttext
cursoroffset of cursor in character.
anchoroffset of anchor in character.

Definition at line 73 of file surroundingtext.cpp.

◆ showVirtualKeyboard()

void fcitx::UserInterfaceManager::showVirtualKeyboard ( ) const

Show the virtual keyboard.

This is a no-op if active addon is not a virtual keyboard addon.

Definition at line 333 of file userinterfacemanager.cpp.

◆ splitByLine()

std::vector< Text > fcitx::Text::splitByLine ( ) const

Split Text object into lines.

Returns
lines.
Since
5.0.6

Definition at line 130 of file text.cpp.

◆ statusArea()

const StatusArea & fcitx::InputContext::statusArea ( ) const

Returns the associated StatusArea.

Since
5.0.22

Definition at line 485 of file inputcontext.cpp.

◆ surroundingText()

SurroundingText & fcitx::InputContext::surroundingText ( )

Returns the mutable surrounding text of the input context.

updateSurroundingText() need to be called after changes by frontend.

See also
InputContext::updateSurroundingText SurroundingText

Definition at line 361 of file inputcontext.cpp.

◆ type()

EventType fcitx::Event::type ( ) const
inline

Type of event, can be used to decide event class.

Returns
fcitx::EventType

Definition at line 222 of file event.h.

◆ unload()

void fcitx::AddonManager::unload ( )

Destruct all addon, all information is cleared to the initial state.

But depending on the addon it loads, it may have some leftover data in the memory.

Definition at line 297 of file addonmanager.cpp.

◆ unregisterLoader()

void fcitx::AddonManager::unregisterLoader ( const std::string &  name)

Unregister addon loader.

Parameters
namename of addon type.

Definition at line 246 of file addonmanager.cpp.

◆ update() [1/2]

void fcitx::UserInterfaceManager::update ( UserInterfaceComponent  component,
InputContext inputContext 
)

Mark a user interface component to be updated for given input context.

The update will not happen immediately.

  • component user interface component
  • inputContext Input Context

Definition at line 236 of file userinterfacemanager.cpp.

◆ update() [2/2]

void fcitx::Action::update ( InputContext ic)

Notify that this action is required to be updated of given input context.

Parameters
icthe input context that need to update this action.

Definition at line 99 of file action.cpp.

◆ updateClientSideUIImpl()

void fcitx::InputContext::updateClientSideUIImpl ( )
protectedvirtual

Send the UI update to client.

See also
CapabilityFlag::ClientSideUI

Definition at line 490 of file inputcontext.cpp.

◆ updatePreedit()

void fcitx::InputContext::updatePreedit ( )

Notifies client about changes in clientPreedit.

See also
InputPanel::clientPreedit

Definition at line 450 of file inputcontext.cpp.

◆ updatePreeditImpl()

virtual void fcitx::InputContext::updatePreeditImpl ( )
protectedpure virtual

Send the preedit update to the client.

See also
updatePreedit

◆ updateProperty() [1/2]

void fcitx::InputContext::updateProperty ( const std::string &  name)

Notifies the change of a given input context property.

Parameters
namename of the input context property.
See also
InputContextProperty::copyTo

Definition at line 134 of file inputcontext.cpp.

◆ updateProperty() [2/2]

void fcitx::InputContext::updateProperty ( const InputContextPropertyFactory factory)

Notifies the change of a given input context property by its factory.

Parameters
namename of the input context property.
See also
InputContextProperty::copyTo

Definition at line 143 of file inputcontext.cpp.

◆ updateUserInterface()

void fcitx::InputContext::updateUserInterface ( UserInterfaceComponent  component,
bool  immediate = false 
)

Notifies UI about changes in user interface.

Parameters
componentThe components of UI that need to be updated.
immediateimmediately flush the update to UI.
See also
UserInterfaceComponent InputPanel StatusArea

Definition at line 464 of file inputcontext.cpp.

◆ updateVirtualKeyboardVisibility()

void fcitx::UserInterfaceManager::updateVirtualKeyboardVisibility ( )

Invoke by user interface addon to notify if there is any virtual keyboard visibility change.

User interface addon must call this function to make user interface manager update its cached visibility.

Definition at line 369 of file userinterfacemanager.cpp.

◆ virtualKeyboardEvent()

bool fcitx::InputContext::virtualKeyboardEvent ( VirtualKeyboardEvent event)

Send a virtual keyboard event to current input context.

Parameters
eventvirtual keyboard event
Returns
whether event is accepted.
Since
5.1.0

Definition at line 330 of file inputcontext.cpp.