summaryrefslogtreecommitdiffstats
path: root/src/Engine.h
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-05-30 21:04:22 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-05-30 21:17:53 +0800
commit9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7 (patch)
treed60c43f1a360c0a285715c676dc49c4d895c8ebb /src/Engine.h
parent44f4960fb84fbb3643d523932bc8612bff5ff18c (diff)
downloadibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.tar.gz
ibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.tar.xz
ibus-libpinyin-9211cbcd3d580cf96a2bea7d8dd3ec8beefca9a7.zip
Refine coding style
Diffstat (limited to 'src/Engine.h')
-rw-r--r--src/Engine.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/Engine.h b/src/Engine.h
index 0c0ca64..297acaf 100644
--- a/src/Engine.h
+++ b/src/Engine.h
@@ -37,76 +37,86 @@ GType ibus_pinyin_engine_get_type (void);
class Engine {
public:
- Engine (IBusEngine *engine) : m_engine (engine) {
- }
-
+ Engine (IBusEngine *engine) : m_engine (engine) { }
virtual ~Engine (void);
+ // virtual functions
virtual gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers) = 0;
virtual void focusIn (void) = 0;
virtual void focusOut (void) = 0;
virtual void reset (void) = 0;
-
virtual void enable (void) = 0;
virtual void disable (void) = 0;
virtual void pageUp (void) = 0;
virtual void pageDown (void) = 0;
virtual void cursorUp (void) = 0;
virtual void cursorDown (void) = 0;
-
virtual gboolean propertyActivate (const gchar *prop_name, guint prop_state) = 0;
virtual void candidateClicked (guint index, guint button, guint state) = 0;
protected:
- void commitText (Text & text) {
+ void commitText (Text & text) const
+ {
ibus_engine_commit_text (m_engine, text);
}
- void updatePreeditText (Text & text, guint cursor, gboolean visible) {
+ void updatePreeditText (Text & text, guint cursor, gboolean visible) const
+ {
ibus_engine_update_preedit_text (m_engine, text, cursor, visible);
}
- void showPreeditText (void) {
+ void showPreeditText (void) const
+ {
ibus_engine_show_preedit_text (m_engine);
}
- void hidePreeditText (void) {
+ void hidePreeditText (void) const
+ {
ibus_engine_hide_preedit_text (m_engine);
}
- void updateAuxiliaryText (Text & text, gboolean visible) {
+ void updateAuxiliaryText (Text & text, gboolean visible) const
+ {
ibus_engine_update_auxiliary_text (m_engine, text, visible);
}
- void showAuxiliaryText (void) {
+ void showAuxiliaryText (void) const
+ {
ibus_engine_show_auxiliary_text (m_engine);
}
- void hideAuxiliaryText (void) {
+ void hideAuxiliaryText (void) const
+ {
ibus_engine_hide_auxiliary_text (m_engine);
}
- void updateLookupTable (LookupTable &table, gboolean visible) {
+ void updateLookupTable (LookupTable &table, gboolean visible) const
+ {
ibus_engine_update_lookup_table (m_engine, table, visible);
}
- void updateLookupTableFast (LookupTable &table, gboolean visible) {
+ void updateLookupTableFast (LookupTable &table, gboolean visible) const
+ {
ibus_engine_update_lookup_table_fast (m_engine, table, visible);
}
- void showLookupTable (void) {
+ void showLookupTable (void) const
+ {
ibus_engine_show_lookup_table (m_engine);
}
- void hideLookupTable (void) {
+ void hideLookupTable (void) const
+ {
ibus_engine_hide_lookup_table (m_engine);
}
- void registerProperties (PropList & props) {
+ void registerProperties (PropList & props) const
+ {
ibus_engine_register_properties (m_engine, props);
}
- void updateProperty (Property & prop) {
+ void updateProperty (Property & prop) const
+ {
ibus_engine_update_property (m_engine, prop);
}