Fcitx
Public Member Functions | List of all members
fcitx::InputMethodEngine Class Referenceabstract
Inheritance diagram for fcitx::InputMethodEngine:
Inheritance graph
[legend]
Collaboration diagram for fcitx::InputMethodEngine:
Collaboration graph
[legend]

Public Member Functions

virtual std::vector< InputMethodEntrylistInputMethods ()
 List the input methods provided by this engine. More...
 
virtual void keyEvent (const InputMethodEntry &entry, KeyEvent &keyEvent)=0
 Main function where the input method handles a key event. More...
 
virtual void activate (const InputMethodEntry &entry, InputContextEvent &event)
 Called when the input context is switched to this input method. More...
 
virtual void deactivate (const InputMethodEntry &entry, InputContextEvent &event)
 Called when input context switch its input method. More...
 
virtual void reset (const InputMethodEntry &entry, InputContextEvent &event)
 Being called when the input context need to reset it state. More...
 
virtual void filterKey (const InputMethodEntry &entry, KeyEvent &event)
 If a key event is not handled by all other handler, it will be passed to this function. More...
 
virtual FCITXCORE_DEPRECATED void updateSurroundingText (const InputMethodEntry &)
 
virtual std::string subMode (const InputMethodEntry &entry, InputContext &inputContext)
 Return a localized name for the sub mode of input method. More...
 
virtual std::string overrideIcon (const InputMethodEntry &)
 Return an alternative icon for entry. More...
 
virtual const ConfigurationgetConfigForInputMethod (const InputMethodEntry &entry) const
 Return the configuration for this input method entry. More...
 
virtual void setConfigForInputMethod (const InputMethodEntry &entry, const RawConfig &config)
 Update the configuration for this input method entry. More...
 
std::string subModeIcon (const InputMethodEntry &entry, InputContext &ic)
 Return the icon name for the sub mode. More...
 
std::string subModeLabel (const InputMethodEntry &entry, InputContext &ic)
 Return the label for the sub mode. More...
 
void invokeAction (const InputMethodEntry &entry, InvokeActionEvent &event)
 Process InvokeActionEvent. More...
 
void virtualKeyboardEvent (const InputMethodEntry &entry, VirtualKeyboardEvent &VirtualKeyboardEvent)
 Process virtual keyboard event. More...
 
- Public Member Functions inherited from fcitx::AddonInstance
virtual void reloadConfig ()
 Reload configuration from disk.
 
virtual void save ()
 Save any relevant data. Usually, it will be invoked when fcitx exits.
 
virtual const ConfigurationgetConfig () const
 Get the configuration.
 
virtual void setConfig (const RawConfig &)
 Set configuration from Raw Config.
 
virtual const ConfigurationgetSubConfig (const std::string &) const
 
virtual void setSubConfig (const std::string &, const RawConfig &)
 
template<typename Signature , typename... Args>
std::function< Signature >::result_type callWithSignature (const std::string &name, Args &&...args)
 
template<typename MetaSignatureString , typename... Args>
AddonFunctionSignatureReturnType< MetaSignatureString > callWithMetaString (Args &&...args)
 
template<typename MetaType , typename... Args>
AddonFunctionSignatureReturnType< typename MetaType::Name > call (Args &&...args)
 Call an exported function for this addon.
 
void registerCallback (const std::string &name, AddonFunctionAdaptorBase *adaptor)
 
const AddonInfoaddonInfo () const
 
bool canRestart () const
 Check if this addon can safely restart. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fcitx::AddonInstance
void setCanRestart (bool canRestart)
 Set if this addon can safely restart. More...
 

Detailed Description

Definition at line 17 of file inputmethodengine.h.

Member Function Documentation

◆ activate()

virtual void fcitx::InputMethodEngine::activate ( const InputMethodEntry entry,
InputContextEvent event 
)
inlinevirtual

Called when the input context is switched to this input method.

Parameters
entryinput method entry
eventevent

Definition at line 43 of file inputmethodengine.h.

◆ deactivate()

virtual void fcitx::InputMethodEngine::deactivate ( const InputMethodEntry entry,
InputContextEvent event 
)
inlinevirtual

Called when input context switch its input method.

By default it will call reset.

Parameters
entryinput method entry
eventevent

Definition at line 57 of file inputmethodengine.h.

◆ filterKey()

virtual void fcitx::InputMethodEngine::filterKey ( const InputMethodEntry entry,
KeyEvent event 
)
inlinevirtual

If a key event is not handled by all other handler, it will be passed to this function.

This is useful for input method to block all the keys that it doesn't want to handle.

Parameters
entryinput method entry
eventkey event

Definition at line 85 of file inputmethodengine.h.

◆ getConfigForInputMethod()

virtual const Configuration* fcitx::InputMethodEngine::getConfigForInputMethod ( const InputMethodEntry entry) const
inlinevirtual

Return the configuration for this input method entry.

The entry need to have Configurable=True By default it will return the addon's config.

Parameters
entryinput method entry
Returns
pointer to the configuration

Definition at line 127 of file inputmethodengine.h.

◆ invokeAction()

void fcitx::InputMethodEngine::invokeAction ( const InputMethodEntry entry,
InvokeActionEvent event 
)

Process InvokeActionEvent.

Parameters
entryinput method entry
eventInvoke action event
Since
5.0.11

Definition at line 56 of file inputmethodengine.cpp.

◆ keyEvent()

virtual void fcitx::InputMethodEngine::keyEvent ( const InputMethodEntry entry,
KeyEvent keyEvent 
)
pure virtual

Main function where the input method handles a key event.

Parameters
entryinput method entry
eventkey event

◆ listInputMethods()

virtual std::vector<InputMethodEntry> fcitx::InputMethodEngine::listInputMethods ( )
inlinevirtual

List the input methods provided by this engine.

If OnDemand=True, the input method will be provided by configuration file instead. Additional input method may be provided by configuration file.

Definition at line 27 of file inputmethodengine.h.

◆ overrideIcon()

virtual std::string fcitx::InputMethodEngine::overrideIcon ( const InputMethodEntry )
inlinevirtual

Return an alternative icon for entry.

Parameters
entryinput method entry
Returns
icon name
See also
InputMethodEngine::subModeIcon

Definition at line 115 of file inputmethodengine.h.

◆ reset()

virtual void fcitx::InputMethodEngine::reset ( const InputMethodEntry entry,
InputContextEvent event 
)
inlinevirtual

Being called when the input context need to reset it state.

reset will only be called if ic is focused

Parameters
entryinput method entry
eventevent

Definition at line 69 of file inputmethodengine.h.

◆ setConfigForInputMethod()

virtual void fcitx::InputMethodEngine::setConfigForInputMethod ( const InputMethodEntry entry,
const RawConfig config 
)
inlinevirtual

Update the configuration for this input method entry.

The entry need to have Configurable=True By default it will set the addon's config.

Parameters
entryinput method entry

Definition at line 140 of file inputmethodengine.h.

◆ subMode()

virtual std::string fcitx::InputMethodEngine::subMode ( const InputMethodEntry entry,
InputContext inputContext 
)
inlinevirtual

Return a localized name for the sub mode of input method.

Parameters
entryinput method entry
inputContextinput context
Returns
name of the sub mode.

Definition at line 100 of file inputmethodengine.h.

◆ subModeIcon()

std::string fcitx::InputMethodEngine::subModeIcon ( const InputMethodEntry entry,
InputContext ic 
)

Return the icon name for the sub mode.

Prefer subclass this method from InputMethodEngineV2 over overrideIcon.

Parameters
entryinput method entry
icinput context
Returns
std::string
See also
overrideIcon

Definition at line 14 of file inputmethodengine.cpp.

◆ subModeLabel()

std::string fcitx::InputMethodEngine::subModeLabel ( const InputMethodEntry entry,
InputContext ic 
)

Return the label for the sub mode.

Parameters
entryinput method entry
icinput context
Returns
std::string

Definition at line 22 of file inputmethodengine.cpp.

◆ virtualKeyboardEvent()

void fcitx::InputMethodEngine::virtualKeyboardEvent ( const InputMethodEntry entry,
VirtualKeyboardEvent VirtualKeyboardEvent 
)

Process virtual keyboard event.

Parameters
entryinput method entry
eventvirtual keyboard event
Since
5.1.0

Definition at line 30 of file inputmethodengine.cpp.


The documentation for this class was generated from the following files: