10 #include "fcitx-utils/macros.h" 13 #include "inputcontextmanager.h" 14 #include "tempmode_p.h" 18 TempMode::TempMode() : d_ptr(
std::make_unique<TempModePrivate>(this)) {}
19 TempMode::~TempMode() { unregister(); }
23 return d->handle_ !=
nullptr;
33 d->stateFactory_.unregister();
40 return inputContext->
propertyFor(&d->stateFactory_);
bool isRegistered() const
Return whether this temp mode is registered with a manager.
Temporary input modes for Fcitx.
void unregister()
Unregister this temp mode from its manager.
T::PropertyType * propertyFor(const T *factory)
Helper function to return the input context property in specific type by given factory.
InputContextProperty * genericProperty(InputContext *inputContext) const
Return the registered temp mode state for an input context.
virtual bool invokeAction(InvokeActionEvent &event)
Handle an action invoked while the temp mode is active.
An input context represents a client of Fcitx.
This is a class that designed to store state that is specific to certain input context.