return TRUE;
}
-gboolean
-LibPinyinBopomofoEditor::removeCharBefore (void)
-{
- if (G_UNLIKELY (m_cursor == 0))
- return FALSE;
-
- m_cursor --;
- m_text.erase (m_cursor, 1);
- update();
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::removeCharAfter (void)
-{
- if (G_UNLIKELY (m_cursor == m_text.length ()))
- return FALSE;
-
- m_text.erase (m_cursor, 1);
- update ();
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::removeWordBefore (void)
-{
- if (G_UNLIKELY (m_cursor == 0))
- return FALSE;
-
- /* TODO: to be implemented. */
- g_assert(FALSE);
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::removeWordAfter (void)
-{
- if (G_UNLIKELY (m_cursor == m_text.length ()))
- return FALSE;
-
- /* TODO: remove one word instead of the sentence. */
- g_assert(FALSE);
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorLeft (void)
-{
- if (G_UNLIKELY (m_cursor == 0))
- return FALSE;
-
- m_cursor --;
- update ();
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorRight (void)
-{
- if (G_UNLIKELY (m_cursor == m_text.length ()))
- return FALSE;
-
- m_cursor ++;
- update ();
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorLeftByWord (void)
-{
- if (G_UNLIKELY (m_cursor == 0))
- return FALSE;
-
- /* TODO: to be implemented. */
- g_assert(FALSE);
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorRightByWord (void)
-{
- if (G_UNLIKELY (m_cursor == m_text.length ()))
- return FALSE;
-
- /* TODO: to be implemented. */
- g_assert(FALSE);
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorToBegin (void)
-{
- if (G_UNLIKELY (m_cursor == 0))
- return FALSE;
-
- m_cursor = 0;
- update();
-
- return TRUE;
-}
-
-gboolean
-LibPinyinBopomofoEditor::moveCursorToEnd (void)
-{
- if (G_UNLIKELY (m_cursor == m_text.length ()))
- return FALSE;
-
- m_cursor = m_text.length ();
- update();
- return TRUE;
-}
gboolean
LibPinyinBopomofoEditor::processGuideKey (guint keyval, guint keycode,
gboolean processBopomofo (guint keyval, guint keycode, guint modifiers);
gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
+
+ virtual void updateAuxiliaryText ();
+ virtual void updatePinyin (void);
+
#if 0
- void updateAuxiliaryText ();
void updateLookupTable ();
void updatePreeditText ();
+#endif
- void update ();
void commit ();
-#endif
void reset ();
gboolean insert (gint ch);
gint keyvalToBopomofo (gint ch);
- gboolean removeCharBefore (void);
- gboolean removeCharAfter (void);
- gboolean removeWordBefore (void);
- gboolean removeWordAfter (void);
-
- gboolean moveCursorLeft (void);
- gboolean moveCursorRight (void);
- gboolean moveCursorLeftByWord (void);
- gboolean moveCursorRightByWord (void);
- gboolean moveCursorToBegin (void);
- gboolean moveCursorToEnd (void);
-
};
};
virtual gboolean processKeyEvent (guint keyval, guint keycode, guint modifiers);
- virtual void updatePinyin (void) = 0;
+ virtual void updatePinyin (void);
guint getCursorLeftByWord (void);
guint getCursorRightByWord (void);