OSDN Git Service

import the last version of the original mayu extracted by following command:
[yamy/yamy.git] / function.h
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
2 // keymap.h\r
3 \r
4 \r
5 #ifndef _FUNCTION_H\r
6 #  define _FUNCTION_H\r
7 \r
8 \r
9 class SettingLoader;\r
10 class Engine;\r
11 class FunctionParam;\r
12 \r
13 ///\r
14 class FunctionData\r
15 {\r
16 public:\r
17   /// virtual destructor\r
18   virtual ~FunctionData() = 0;\r
19   ///\r
20   virtual void load(SettingLoader *i_sl) = 0;\r
21   ///\r
22   virtual void exec(Engine *i_engine, FunctionParam *i_param) const = 0;\r
23   ///\r
24   virtual const _TCHAR *getName() const = 0;\r
25   ///\r
26   virtual tostream &output(tostream &i_ost) const = 0;\r
27   ///\r
28   virtual FunctionData *clone() const = 0;\r
29 };\r
30 \r
31 /// stream output\r
32 extern tostream &operator<<(tostream &i_ost, const FunctionData *i_data);\r
33 \r
34 \r
35 // create function\r
36 extern FunctionData *createFunctionData(const tstring &i_name);\r
37 \r
38 ///\r
39 enum VKey\r
40 {\r
41   VKey_extended = 0x100,                        ///\r
42   VKey_released = 0x200,                        ///\r
43   VKey_pressed  = 0x400,                        ///\r
44 };\r
45 \r
46 /// stream output\r
47 extern tostream &operator<<(tostream &i_ost, VKey i_data);\r
48 \r
49 \r
50 ///\r
51 enum ToWindowType\r
52 {\r
53   ToWindowType_toBegin            = -2,         ///\r
54   ToWindowType_toMainWindow       = -2,         ///\r
55   ToWindowType_toOverlappedWindow = -1,         ///\r
56   ToWindowType_toItself           = 0,          ///\r
57   ToWindowType_toParentWindow     = 1,          ///\r
58 };\r
59 \r
60 /// stream output\r
61 extern tostream &operator<<(tostream &i_ost, ToWindowType i_data);\r
62 \r
63 // get value of ToWindowType\r
64 extern bool getTypeValue(ToWindowType *o_type, const tstring &i_name);\r
65 \r
66 \r
67 ///\r
68 enum GravityType\r
69 {\r
70   GravityType_C = 0,                            /// center\r
71   GravityType_N = 1 << 0,                       /// north\r
72   GravityType_E = 1 << 1,                       /// east\r
73   GravityType_W = 1 << 2,                       /// west\r
74   GravityType_S = 1 << 3,                       /// south\r
75   GravityType_NW = GravityType_N | GravityType_W, /// north west\r
76   GravityType_NE = GravityType_N | GravityType_E, /// north east\r
77   GravityType_SW = GravityType_S | GravityType_W, /// south west\r
78   GravityType_SE = GravityType_S | GravityType_E, /// south east\r
79 };\r
80 \r
81 /// stream output\r
82 extern tostream &operator<<(tostream &i_ost, GravityType i_data);\r
83 \r
84 /// get value of GravityType\r
85 extern bool getTypeValue(GravityType *o_type, const tstring &i_name);\r
86 \r
87 \r
88 /// enum MouseHookType is defined in hook.h\r
89 extern enum MouseHookType;\r
90 \r
91 /// stream output\r
92 extern tostream &operator<<(tostream &i_ost, MouseHookType i_data);\r
93 \r
94 /// get value of MouseHookType\r
95 extern bool getTypeValue(MouseHookType *o_type, const tstring &i_name);\r
96 \r
97 \r
98 ///\r
99 enum MayuDialogType\r
100 {\r
101   MayuDialogType_investigate = 0x10000,         /// \r
102   MayuDialogType_log         = 0x20000,         /// \r
103   MayuDialogType_mask        = 0xffff0000,      /// \r
104 };\r
105 \r
106 /// stream output\r
107 extern tostream &operator<<(tostream &i_ost, MayuDialogType i_data);\r
108 \r
109 // get value of MayuDialogType\r
110 bool getTypeValue(MayuDialogType *o_type, const tstring &i_name);\r
111 \r
112   \r
113 ///\r
114 enum ModifierLockType\r
115 {\r
116   ModifierLockType_Lock0 = Modifier::Type_Lock0, /// \r
117   ModifierLockType_Lock1 = Modifier::Type_Lock1, /// \r
118   ModifierLockType_Lock2 = Modifier::Type_Lock2, /// \r
119   ModifierLockType_Lock3 = Modifier::Type_Lock3, /// \r
120   ModifierLockType_Lock4 = Modifier::Type_Lock4, /// \r
121   ModifierLockType_Lock5 = Modifier::Type_Lock5, /// \r
122   ModifierLockType_Lock6 = Modifier::Type_Lock6, /// \r
123   ModifierLockType_Lock7 = Modifier::Type_Lock7, /// \r
124   ModifierLockType_Lock8 = Modifier::Type_Lock8, /// \r
125   ModifierLockType_Lock9 = Modifier::Type_Lock9, /// \r
126 };\r
127 \r
128 ///\r
129 enum ToggleType\r
130 {\r
131   ToggleType_toggle     = -1, /// \r
132   ToggleType_off        = 0, /// \r
133   ToggleType_on         = 1, /// \r
134 };\r
135 \r
136 /// stream output\r
137 extern tostream &operator<<(tostream &i_ost, ToggleType i_data);\r
138   \r
139 // get value of ShowCommandType\r
140 extern bool getTypeValue(ToggleType *o_type, const tstring &i_name);\r
141 \r
142 \r
143 /// stream output\r
144 extern tostream &operator<<(tostream &i_ost, ModifierLockType i_data);\r
145 \r
146 // get value of ModifierLockType\r
147 extern bool getTypeValue(ModifierLockType *o_type, const tstring &i_name);\r
148 \r
149 \r
150 ///\r
151 enum ShowCommandType\r
152 {\r
153   ShowCommandType_hide                  = SW_HIDE, /// \r
154   ShowCommandType_maximize              = SW_MAXIMIZE, /// \r
155   ShowCommandType_minimize              = SW_MINIMIZE, /// \r
156   ShowCommandType_restore               = SW_RESTORE, /// \r
157   ShowCommandType_show                  = SW_SHOW, /// \r
158   ShowCommandType_showDefault           = SW_SHOWDEFAULT, /// \r
159   ShowCommandType_showMaximized         = SW_SHOWMAXIMIZED, /// \r
160   ShowCommandType_showMinimized         = SW_SHOWMINIMIZED, /// \r
161   ShowCommandType_showMinNoActive       = SW_SHOWMINNOACTIVE, /// \r
162   ShowCommandType_showNA                = SW_SHOWNA, /// \r
163   ShowCommandType_showNoActivate        = SW_SHOWNOACTIVATE, /// \r
164   ShowCommandType_showNormal            = SW_SHOWNORMAL, /// \r
165 };\r
166 \r
167 /// stream output\r
168 extern tostream &operator<<(tostream &i_ost, ShowCommandType i_data);\r
169   \r
170 // get value of ShowCommandType\r
171 extern bool getTypeValue(ShowCommandType *o_type, const tstring &i_name);\r
172 \r
173 \r
174 ///\r
175 enum TargetWindowType\r
176 {\r
177   TargetWindowType_overlapped   = 0, /// \r
178   TargetWindowType_mdi          = 1, /// \r
179 };\r
180 \r
181 /// stream output\r
182 extern tostream &operator<<(tostream &i_ost, TargetWindowType i_data);\r
183   \r
184 // get value of ShowCommandType\r
185 extern bool getTypeValue(TargetWindowType *o_type, const tstring &i_name);\r
186 \r
187 \r
188 ///\r
189 enum BooleanType\r
190 {\r
191   BooleanType_false     = 0, /// \r
192   BooleanType_true      = 1, /// \r
193 };\r
194 \r
195 /// stream output\r
196 extern tostream &operator<<(tostream &i_ost, BooleanType i_data);\r
197   \r
198 // get value of ShowCommandType\r
199 extern bool getTypeValue(BooleanType *o_type, const tstring &i_name);\r
200 \r
201 \r
202 ///\r
203 enum LogicalOperatorType\r
204 {\r
205   LogicalOperatorType_or        = 0, /// \r
206   LogicalOperatorType_and       = 1, /// \r
207 };\r
208 \r
209 /// stream output\r
210 extern tostream &operator<<(tostream &i_ost, LogicalOperatorType i_data);\r
211   \r
212 // get value of LogicalOperatorType\r
213 extern bool getTypeValue(LogicalOperatorType *o_type, const tstring &i_name);\r
214 \r
215 \r
216 ///\r
217 enum WindowMonitorFromType\r
218 {\r
219   WindowMonitorFromType_primary = 0, ///\r
220   WindowMonitorFromType_current = 1, ///\r
221 };\r
222 \r
223 // stream output\r
224 extern tostream &operator<<(tostream &i_ost, WindowMonitorFromType i_data);\r
225 \r
226 // get value of WindowMonitorFromType\r
227 extern bool getTypeValue(WindowMonitorFromType *o_type, const tstring &i_name);\r
228 \r
229 \r
230 /// stream output\r
231 extern tostream &operator<<(tostream &i_ost,\r
232                             const std::list<tstringq> &i_data);\r
233 \r
234 \r
235 /// string type expression\r
236 class StrExpr;\r
237 \r
238 \r
239 /// string type expression for function arguments\r
240 class StrExprArg\r
241 {\r
242 private:\r
243   StrExpr *m_expr;\r
244 public:\r
245   enum Type\r
246   {\r
247     Literal,\r
248     Builtin,\r
249   };\r
250   StrExprArg();\r
251   StrExprArg(const StrExprArg &i_data);\r
252   StrExprArg(const tstringq &i_symbol, Type i_type);\r
253   ~StrExprArg();\r
254   StrExprArg &operator=(const StrExprArg &i_data);\r
255   tstringq eval() const;\r
256   static void setEngine(const Engine *i_engine);\r
257 };\r
258 \r
259 \r
260 /// stream output\r
261 tostream &operator<<(tostream &i_ost, const StrExprArg &i_data);\r
262 \r
263 \r
264 #endif // !_FUNCTION_H\r