mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
mime-wordsel.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
54 #ifdef _MGNCSCTRL_IMWORDSEL
55 
56 #ifndef _MGUI_IM_WORDSEL_H
57 #define _MGUI_IM_WORDSEL_H
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #define NCSCTRL_IMWORDSEL NCSCLASSNAME("imwordsel")
64 
65 typedef struct _mIMWordSelClass mIMWordSelClass;
66 typedef struct _mIMWordSel mIMWordSel;
67 typedef struct _mIMWordSelRenderer mIMWordSelRenderer;
68 
69 #define mIMWordSelClassHeader(clss, super) \
70  mWidgetClassHeader(clss, super) \
71  BOOL (*nextPage)(clss*); \
72  BOOL (*prevPage)(clss*); \
73  BOOL (*selNext)(clss*); \
74  BOOL (*selPrev)(clss*);
75 
76 #define mIMWordSelHeader(clss) \
77  mWidgetHeader(clss) \
78  mIMIterator* ime_it; \
79  BOOL isactive; \
80  int cur_sel; \
81  int page_start:16; \
82  int page_end:16; \
83 // CHARSET_CONVERTER * charset_converter;
84 
85 struct _mIMWordSelClass {
86  mIMWordSelClassHeader(mIMWordSel, mWidget)
87 };
88 
89 struct _mIMWordSel {
90  mIMWordSelHeader(mIMWordSel)
91 };
92 
93 MGNCS_EXPORT extern mIMWordSelClass g_stmIMWordSelCls;
94 
95 #define mIMWordSelRendererHeader(clss, super) \
96  mWidgetRendererHeader(clss, super)
97 
98 struct _mIMWordSelRenderer {
99  mIMWordSelRendererHeader(mIMWordSel, mWidget)
100 };
101 
102 enum mIMWordSelProp {
103  NCSP_IMWS_ITERATOR = NCSP_WIDGET_MAX + 1,
104  NCSP_IMWS_CURSEL,
105  NCSP_IMWS_CURWORD, //return mIMIterator*, whose current value is the word selected
106  NCSP_IMWS_CURRAWWORD, //raw word, not convert it to the encoding need by application
107 // NCSP_IMWS_CHARSETCONVERTER,
108  NCSP_IMWS_ISEMPTY,
109  NCSP_IMWS_ISACTIVE,
110  NCSP_IMWS_MAX
111 };
112 
113 #define mIMWordSel_isEmpty(self) \
114  (BOOL)(_c((mIMWordSel*)(self))->getProperty((mIMWordSel*)(self), NCSP_IMWS_ISEMPTY))
115 
116 #define mIMWordSel_getCurSel(self) \
117  ((int)(NCS_GET_PROP(self, NCSP_IMWS_CURSEL)))
118 #define mIMWordSel_setCurSel(self, int_v) \
119  NCS_SET_PROP(self, NCSP_IMWS_CURSEL,(DWORD)(int_v))
120 
121 #define mIMWordSel_getCurWord(self) \
122  ((const char*)(NCS_GET_PROP(self, NCSP_IMWS_CURWORD)))
123 #define mIMWordSel_setCurWord(self, const_char_v) \
124  NCS_SET_PROP(self, NCSP_IMWS_CURWORD, (DWORD)(const_char_v))
125 
126 enum mIMWordSelEvent {
127  NCSN_IMWS_SELCHANGED = NCSN_WIDGET_MAX + 1,
128  NCSN_IMWS_MAX
129 };
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif
136 #endif //_MGNCSCTRL_IMWORDSEL
137 
mWidget
define the mWidget members, inherit from mComponent