Tizen 2.0 Release
[framework/uifw/ise-engine-anthy.git] / src / scim_anthy_factory.h
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  *  Copyright (C) 2004 Hiroyuki Ikezoe
4  *  Copyright (C) 2004 Takuro Ashie
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 /*
22  * The original code is scim_uim_imengine.cpp in scim-uim-0.1.3. 
23  * Copyright (C) 2004 James Su <suzhe@tsinghua.org.cn>
24  */
25
26 #ifndef __SCIM_ANTHY_FACTORY_H__
27 #define __SCIM_ANTHY_FACTORY_H__
28
29 #define Uses_SCIM_IMENGINE
30 #define Uses_SCIM_CONFIG_BASE
31 #include <anthy/anthy.h>
32 #include <scim.h>
33 #include "scim_anthy_action.h"
34 #include "scim_anthy_style_file.h"
35 #include "scim_anthy_key2kana_table.h"
36
37 using namespace scim;
38 using namespace scim_anthy;
39
40 class AnthyFactory : public IMEngineFactoryBase
41 {
42 public:
43     AnthyFactory (const String &lang,
44                   const String &uuid,
45                   const ConfigPointer &config);
46     virtual ~AnthyFactory ();
47
48     virtual WideString  get_name      () const;
49     virtual WideString  get_authors   () const;
50     virtual WideString  get_credits   () const;
51     virtual WideString  get_help      () const;
52     virtual String      get_uuid      () const;
53     virtual String      get_icon_file () const;
54
55     virtual IMEngineInstancePointer create_instance (const String& encoding,
56                                                      int id = -1);
57
58     virtual void append_config_listener (AnthyInstance *listener);
59     virtual void remove_config_listener (AnthyInstance *listener);
60
61 private:
62     void reload_config (const ConfigPointer &config);
63
64 private:
65     String                      m_uuid;
66     Connection                  m_reload_signal_connection;
67     std::vector<AnthyInstance*> m_config_listeners;
68
69 public:
70     /* config */
71     ConfigPointer m_config;
72
73     /* for preferece */
74     String         m_input_mode;
75     String         m_typing_method;
76     String         m_conversion_mode;
77     String         m_period_style;
78     String         m_symbol_style;
79     String         m_space_type;
80     String         m_ten_key_type;
81     String         m_behavior_on_period;
82     String         m_behavior_on_focus_out;
83
84     bool           m_show_candidates_label;
85     bool           m_close_cand_win_on_select;
86     int            m_cand_win_page_size;
87     int            m_n_triggers_to_show_cand_win;
88
89     bool           m_learn_on_manual_commit;
90     bool           m_learn_on_auto_commit;
91
92     bool           m_romaji_half_symbol;
93     bool           m_romaji_half_number;
94     bool           m_romaji_allow_split;
95
96     bool           m_romaji_pseudo_ascii_mode;
97     bool           m_romaji_pseudo_ascii_blank_behavior;
98
99     int            m_nicola_time;
100     KeyEventList   m_left_thumb_keys;
101     KeyEventList   m_right_thumb_keys;
102
103     String         m_dict_encoding;
104     String         m_dict_admin_command;
105     String         m_add_word_command;
106
107     bool           m_predict_on_input;
108     bool           m_use_direct_key_on_predict;
109
110     bool           m_show_input_mode_label;
111     bool           m_show_conv_mode_label;
112     bool           m_show_typing_method_label;
113     bool           m_show_period_style_label;
114     bool           m_show_symbol_style_label;
115     bool           m_show_dict_label;
116     bool           m_show_dict_admin_label;
117     bool           m_show_add_word_label;
118
119     String         m_preedit_style;
120     unsigned int   m_preedit_fg_color;
121     unsigned int   m_preedit_bg_color;
122     String         m_conversion_style;
123     unsigned int   m_conversion_fg_color;
124     unsigned int   m_conversion_bg_color;
125     String         m_selected_segment_style;
126     unsigned int   m_selected_segment_fg_color;
127     unsigned int   m_selected_segment_bg_color;
128
129     Key2KanaTable *m_custom_romaji_table;
130     Key2KanaTable *m_custom_kana_table;
131     Key2KanaTable *m_custom_nicola_table;
132
133     String         m_kana_layout_ro_key;
134
135     /* for key bindings */
136     std::vector<Action> m_actions;
137 };
138
139 #endif /* __SCIM_ANTHY_FACTORY_H__ */
140 /*
141 vi:ts=4:nowrap:ai:expandtab
142 */