Fcitx
Public Member Functions | Protected Member Functions | Friends | List of all members
fcitx::TempMode Class Referenceabstract

A temporary mode that can take over key handling for a short period. More...

#include <fcitx/tempmode.h>

Inheritance diagram for fcitx::TempMode:
Inheritance graph
[legend]

Public Member Functions

bool isRegistered () const
 Return whether this temp mode is registered with a manager.
 
void unregister ()
 Unregister this temp mode from its manager.
 
virtual bool isActive (InputContext *inputContext) const =0
 Return whether this temp mode is currently active.
 
virtual bool triggerTempMode (const KeyEvent &keyEvent)=0
 Handle a potential trigger key event. More...
 
virtual bool keyEvent (const KeyEvent &keyEvent)=0
 Handle a key event while the temp mode is active. More...
 
virtual bool invokeAction (InvokeActionEvent &event)
 Handle an action invoked while the temp mode is active. More...
 
virtual void reset (InputContext *inputContext)=0
 Reset the temp mode state for an input context. More...
 
virtual std::string_view name () const =0
 Return the input context property name.
 

Protected Member Functions

virtual InputContextPropertycreateProperty (InputContext &inputContext)=0
 Create the property object stored for each input context.
 
InputContextPropertygenericProperty (InputContext *inputContext) const
 Return the registered temp mode state for an input context.
 

Friends

class TempModeManager
 
class TempModePrivate
 

Detailed Description

A temporary mode that can take over key handling for a short period.

A temp mode is typically activated by a hotkey, handles subsequent key events while active, and then returns control to the regular input method.

Definition at line 45 of file tempmode.h.

Member Function Documentation

◆ invokeAction()

bool fcitx::TempMode::invokeAction ( InvokeActionEvent event)
virtual

Handle an action invoked while the temp mode is active.

Parameters
eventaction event
Returns
whether the action event should be accepted

Definition at line 26 of file tempmode.cpp.

◆ keyEvent()

virtual bool fcitx::TempMode::keyEvent ( const KeyEvent keyEvent)
pure virtual

Handle a key event while the temp mode is active.

Parameters
keyEventkey event
Returns
whether the key event should be accepted

◆ reset()

virtual void fcitx::TempMode::reset ( InputContext inputContext)
pure virtual

Reset the temp mode state for an input context.

Parameters
inputContextinput context

Implemented in fcitx::SimpleTempMode< PropertyBaseType >.

◆ triggerTempMode()

virtual bool fcitx::TempMode::triggerTempMode ( const KeyEvent keyEvent)
pure virtual

Handle a potential trigger key event.

The default implementation checks triggerKeys() against the key event and activates the mode on a matching key press.

Parameters
keyEventkey event
Returns
whether the key event activates the temp mode

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