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

Files

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::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::InvokeActionEvent
 
class  fcitx::InputContextSwitchInputMethodEvent
 
class  fcitx::ResetEvent
 
class  fcitx::InputContextUpdateUIEvent
 
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::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_DECLARE_FUNCTION(NAME, FUNCTION, SIGNATURE...)
 
#define FCITX_ADDON_EXPORT_FUNCTION(CLASS, FUNCTION)
 
#define FCITX_ADDON_FACTORY(ClassName)
 
#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

typedef std::array< uint8_t, 16 > fcitx::ICUUID
 
typedef std::function< bool(InputContext *ic)> fcitx::InputContextVisitor
 
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, 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

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>
auto fcitx::AddonInstance::callWithMetaString (Args &&...args)
 
template<typename MetaType , typename... Args>
auto 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
 
 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...
 
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...
 
 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...
 
 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::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::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=StandardPath::global())
 
 fcitx::IconTheme::IconTheme (const std::string &name, const StandardPath &standardPath=StandardPath::global())
 
 fcitx::IconTheme::IconTheme (const StandardPath &standardPath=StandardPath::global())
 
 fcitx::IconTheme::FCITX_DECLARE_VIRTUAL_DTOR_MOVE (IconTheme)
 
std::string fcitx::IconTheme::findIcon (const std::string &iconName, unsigned int desiredSize, int scale=1, const std::vector< std::string > &extensions={ ".svg", ".png", ".xpm"})
 
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
 
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::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...
 
 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...
 
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)
 
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_
 
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_
 
std::string fcitx::InputMethodNotificationEvent::name_
 
const CapabilityFlags fcitx::CapabilityEvent::oldFlags_
 
const CapabilityFlags fcitx::CapabilityEvent::newFlags_
 

Friends

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::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)> { \
typedef std::remove_reference_t<decltype(std::declval<SIGNATURE>())> \
type; \
}; \
namespace I##NAME { \
struct FUNCTION { \
typedef fcitxMakeMetaString(#NAME "::" #FUNCTION) Name; \
using Signature = AddonFunctionSignatureType<Name>; \
}; \
} \
}
#define fcitxMakeMetaString(STRING)
Create meta string from string literal.
Definition: metastring.h:183
Definition: action.cpp:12

Definition at line 131 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 167 of file addoninstance.h.

◆ FCITX_ADDON_EXPORT_FUNCTION

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

Definition at line 146 of file addoninstance.h.

◆ FCITX_ADDON_FACTORY

#define FCITX_ADDON_FACTORY (   ClassName)
Value:
extern "C" { \
FCITXCORE_EXPORT \
::fcitx::AddonFactory *fcitx_addon_factory_instance() { \
static ClassName factory; \
return &factory; \
} \
}
Base class for addon factory.
Definition: addonfactory.h:24

Definition at line 157 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 515 of file event.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 138 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 60 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 36 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 23 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 224 of file event.h.

◆ 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 321 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 335 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 217 of file addonmanager.cpp.

◆ capabilityFlags()

CapabilityFlags fcitx::InputContext::capabilityFlags ( ) const

Returns the current capability flags.

See also
CapabilityFlag

Definition at line 216 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 465 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 383 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

◆ 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 74 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 81 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 81 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 102 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 274 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 373 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 234 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 350 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 426 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 557 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 446 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 333 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 79 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 291 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 392 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 332 of file userinterfacemanager.cpp.

◆ inputPanel()

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

Returns the associated input panel.

Since
5.0.22

Definition at line 457 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 357 of file addonmanager.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 241 of file event.h.

◆ key()

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

Normalized key event.

Returns
fcitx::Key

Definition at line 274 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 142 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 217 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 245 of file addonmanager.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 208 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 217 of file userinterfacemanager.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 144 of file text.cpp.

◆ origKey()

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

Key event regardless of keyboard layout conversion.

Returns
fcitx::Key

Definition at line 313 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 97 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 264 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 277 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 322 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 242 of file inputmethodmanager.cpp.

◆ registerAction() [1/2]

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 184 of file userinterfacemanager.cpp.

◆ registerAction() [2/2]

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

Register an anonymous action.

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

Definition at line 169 of file userinterfacemanager.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 238 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 224 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 353 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 412 of file inputmethodmanager.cpp.

◆ saveAll()

void fcitx::AddonManager::saveAll ( )

Save all addon configuration.

See also
fcitx::AddonInstance::save

Definition at line 307 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 374 of file inputcontext.cpp.

◆ setCapabilityFlags()

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

Update the capability flags of the input context.

See also
CapabilityFlag

Definition at line 200 of file inputcontext.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 259 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 86 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 311 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 368 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 254 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 306 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 323 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 457 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 553 of file event.h.

◆ 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 282 of file event.h.

◆ 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 293 of file event.h.

◆ 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 319 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 122 of file text.cpp.

◆ statusArea()

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

Returns the associated StatusArea.

Since
5.0.22

Definition at line 467 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 359 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 215 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 290 of file addonmanager.cpp.

◆ unregisterLoader()

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

Unregister addon loader.

Parameters
namename of addon type.

Definition at line 233 of file addonmanager.cpp.

◆ update()

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 226 of file userinterfacemanager.cpp.

◆ updateClientSideUIImpl()

void fcitx::InputContext::updateClientSideUIImpl ( )
protectedvirtual

Send the UI update to client.

See also
CapabilityFlag::ClientSideUI

Definition at line 472 of file inputcontext.cpp.

◆ updatePreedit()

void fcitx::InputContext::updatePreedit ( )

Notifies client about changes in clientPreedit.

See also
InputPanel::clientPreedit

Definition at line 432 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 132 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 141 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 446 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 345 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 328 of file inputcontext.cpp.