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

An input context represents a client of Fcitx. More...

#include <fcitx/inputcontext.h>

Inheritance diagram for fcitx::InputContext:
Inheritance graph
[legend]
Collaboration diagram for fcitx::InputContext:
Collaboration graph
[legend]

Public Member Functions

 InputContext (InputContextManager &manager, const std::string &program={})
 
 InputContext (InputContext &&other)=delete
 
virtual const char * frontend () const =0
 Returns the underlying implementation of Input Context.
 
const ICUUID & uuid () const
 Returns the uuid of this input context.
 
const std::string & program () const
 Returns the program name of input context. More...
 
std::string display () const
 Returns the display server of the client. More...
 
const RectcursorRect () const
 Returns the cursor position of the client.
 
double scaleFactor () const
 Return the client scale factor.
 
void focusIn ()
 Called When input context gains the input focus.
 
void focusOut ()
 Called when input context losts the input focus.
 
void setFocusGroup (FocusGroup *group)
 Set the focus group of this input context. More...
 
FocusGroupfocusGroup () const
 Returns the current focus group of input context.
 
FCITXCORE_DEPRECATED void reset (ResetReason reason)
 Called when input context state need to be reset.
 
void reset ()
 Called when input context state need to be reset. More...
 
void setCapabilityFlags (CapabilityFlags flags)
 Update the capability flags of the input context. More...
 
CapabilityFlags capabilityFlags () const
 Returns the current capability flags. More...
 
void setEnablePreedit (bool enable)
 Override the preedit hint from client.
 
bool isPreeditEnabled () const
 Check if preedit is manually disalbed.
 
void setCursorRect (Rect rect)
 Update the current cursor rect of the input context.
 
void setCursorRect (Rect rect, double scale)
 Update the client rect with scale factor.
 
bool keyEvent (KeyEvent &event)
 Send a key event to current input context.
 
bool hasFocus () const
 Returns whether the input context holds the input focus. More...
 
void invokeAction (InvokeActionEvent &event)
 Invoke an action on the preedit.
 
SurroundingTextsurroundingText ()
 Returns the mutable surrounding text of the input context. More...
 
const SurroundingTextsurroundingText () const
 Returns the immutable surrounding text of the input context.
 
void updateSurroundingText ()
 Notifies the surrounding text modification from the client.
 
void commitString (const std::string &text)
 Commit a string to the client.
 
void deleteSurroundingText (int offset, unsigned int size)
 Ask client to delete a range of surrounding text.
 
void forwardKey (const Key &rawKey, bool isRelease=false, int time=0)
 Send a key event to client.
 
void updatePreedit ()
 Notifies client about changes in clientPreedit. More...
 
void updateUserInterface (UserInterfaceComponent component, bool immediate=false)
 Notifies UI about changes in user interface. More...
 
void setBlockEventToClient (bool block)
 Prevent event deliver to input context, and re-send the event later. More...
 
bool hasPendingEvents () const
 
InputContextPropertyproperty (const std::string &name)
 Returns the input context property by name.
 
InputContextPropertyproperty (const InputContextPropertyFactory *factory)
 Returns the input context property by factory.
 
InputPanelinputPanel ()
 Returns the associated input panel.
 
StatusAreastatusArea ()
 Returns the associated StatusArea.
 
template<typename T >
T * propertyAs (const std::string &name)
 Helper function to return the input context property in specific type. More...
 
template<typename T >
T::PropertyType * propertyFor (const T *factory)
 Helper function to return the input context property in specific type by given factory. More...
 
void updateProperty (const std::string &name)
 Notifes the change of a given input context property. More...
 
void updateProperty (const InputContextPropertyFactory *factory)
 Notifes the change of a given input context property by its factory. More...
 
- Public Member Functions inherited from fcitx::TrackableObject< InputContext >
 TrackableObject (const TrackableObject &)=delete
 
TrackableObjectReference< InputContextwatch ()
 
TrackableObjectReference< const InputContextwatch () const
 

Protected Member Functions

virtual void commitStringImpl (const std::string &text)=0
 Send the committed string to client. More...
 
virtual void deleteSurroundingTextImpl (int offset, unsigned int size)=0
 Send the delete Surrounding Text request to client. More...
 
virtual void forwardKeyImpl (const ForwardKeyEvent &key)=0
 Send the forwarded key to client. More...
 
virtual void updatePreeditImpl ()=0
 Send the preedit update to the client. More...
 
virtual void updateClientSideUIImpl ()
 Send the UI update to client. More...
 
void destroy ()
 Notifies the destruction of the input context. More...
 
void created ()
 Notifies the creation of input context. More...
 

Friends

class InputContextManagerPrivate
 
class FocusGroup
 
class UserInterfaceManager
 

Detailed Description

An input context represents a client of Fcitx.

It can be a Window, or a text field depending on the application.

Definition at line 49 of file inputcontext.h.


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