summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-03-31 14:33:35 +0800
committerPeng Wu <alexepico@gmail.com>2014-03-31 14:33:35 +0800
commitffd43eecbd73ef9031709d17663ece95aa84c411 (patch)
tree753cea07179d71e3dfe273012a5134c5b91d4293
parent1b1d7bb7591d2b30d11c7a264c5ae2a36eae6793 (diff)
downloadibus-libzhuyin-ffd43eecbd73ef9031709d17663ece95aa84c411.tar.gz
ibus-libzhuyin-ffd43eecbd73ef9031709d17663ece95aa84c411.tar.xz
ibus-libzhuyin-ffd43eecbd73ef9031709d17663ece95aa84c411.zip
design class SymbolSection
-rw-r--r--src/ZYZPhoneticEditor.h4
-rw-r--r--src/ZYZSymbolSection.h49
2 files changed, 53 insertions, 0 deletions
diff --git a/src/ZYZPhoneticEditor.h b/src/ZYZPhoneticEditor.h
index 875c0ec..00ae215 100644
--- a/src/ZYZPhoneticEditor.h
+++ b/src/ZYZPhoneticEditor.h
@@ -28,7 +28,11 @@
namespace ZY {
+class SymbolSection;
+
class PhoneticEditor : public EnhancedEditor {
+ friend class SymbolSection;
+
public:
PhoneticEditor (ZhuyinProperties & props, Config & config);
virtual ~PhoneticEditor ();
diff --git a/src/ZYZSymbolSection.h b/src/ZYZSymbolSection.h
new file mode 100644
index 0000000..2acad2f
--- /dev/null
+++ b/src/ZYZSymbolSection.h
@@ -0,0 +1,49 @@
+/* vim:set et ts=4 sts=4:
+ *
+ * ibus-libzhuyin - New Zhuyin engine based on libzhuyin for IBus
+ *
+ * Copyright (c) 2014 Peng Wu <alexepico@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __ZY_LIB_ZHUYIN_SYMBOL_SECTION_H_
+#define __ZY_LIB_ZHUYIN_SYMBOL_SECTION_H_
+
+#include "ZYString.h"
+#include "ZYZPhoneticEditor.h"
+
+namespace ZY {
+
+class SymbolSection {
+public:
+ SymbolSection (PhoneticEditor & editor);
+ virtual ~SymbolSection ();
+
+public:
+ virtual bool initCandidates (const String & hint) = 0;
+ virtual bool populateCandidates () = 0;
+ virtual bool selectCandidate (guint index) = 0;
+
+protected:
+ LookupTable & getLookupTable () { return m_editor.m_lookup_table; }
+
+protected:
+ PhoneticEditor & m_editor;
+};
+
+};
+
+#endif