mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mime-wordsel.h
Go to the documentation of this file.
1 
42 #ifdef _MGNCSCTRL_IMWORDSEL
43 
44 #ifndef _MGUI_IM_WORDSEL_H
45 #define _MGUI_IM_WORDSEL_H
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #define NCSCTRL_IMWORDSEL NCSCLASSNAME("imwordsel")
52 
53 typedef struct _mIMWordSelClass mIMWordSelClass;
54 typedef struct _mIMWordSel mIMWordSel;
55 typedef struct _mIMWordSelRenderer mIMWordSelRenderer;
56 
57 #define mIMWordSelClassHeader(clss, super) \
58  mWidgetClassHeader(clss, super) \
59  BOOL (*nextPage)(clss*); \
60  BOOL (*prevPage)(clss*); \
61  BOOL (*selNext)(clss*); \
62  BOOL (*selPrev)(clss*);
63 
64 #define mIMWordSelHeader(clss) \
65  mWidgetHeader(clss) \
66  mIMIterator* ime_it; \
67  BOOL isactive; \
68  int cur_sel; \
69  int page_start:16; \
70  int page_end:16; \
71 // CHARSET_CONVERTER * charset_converter;
72 
73 struct _mIMWordSelClass {
74  mIMWordSelClassHeader(mIMWordSel, mWidget)
75 };
76 
77 struct _mIMWordSel {
78  mIMWordSelHeader(mIMWordSel)
79 };
80 
81 MGNCS_EXPORT extern mIMWordSelClass g_stmIMWordSelCls;
82 
83 #define mIMWordSelRendererHeader(clss, super) \
84  mWidgetRendererHeader(clss, super)
85 
86 struct _mIMWordSelRenderer {
87  mIMWordSelRendererHeader(mIMWordSel, mWidget)
88 };
89 
90 enum mIMWordSelProp {
91  NCSP_IMWS_ITERATOR = NCSP_WIDGET_MAX + 1,
92  NCSP_IMWS_CURSEL,
93  NCSP_IMWS_CURWORD, //return mIMIterator*, whose current value is the word selected
94  NCSP_IMWS_CURRAWWORD, //raw word, not convert it to the encoding need by application
95 // NCSP_IMWS_CHARSETCONVERTER,
96  NCSP_IMWS_ISEMPTY,
97  NCSP_IMWS_ISACTIVE,
98  NCSP_IMWS_MAX
99 };
100 
101 #define mIMWordSel_isEmpty(self) \
102  (BOOL)(_c((mIMWordSel*)(self))->getProperty((mIMWordSel*)(self), NCSP_IMWS_ISEMPTY))
103 
104 #define mIMWordSel_getCurSel(self) \
105  ((int)(NCS_GET_PROP(self, NCSP_IMWS_CURSEL)))
106 #define mIMWordSel_setCurSel(self, int_v) \
107  NCS_SET_PROP(self, NCSP_IMWS_CURSEL,(DWORD)(int_v))
108 
109 #define mIMWordSel_getCurWord(self) \
110  ((const char*)(NCS_GET_PROP(self, NCSP_IMWS_CURWORD)))
111 #define mIMWordSel_setCurWord(self, const_char_v) \
112  NCS_SET_PROP(self, NCSP_IMWS_CURWORD, (DWORD)(const_char_v))
113 
114 enum mIMWordSelEvent {
115  NCSN_IMWS_SELCHANGED = NCSN_WIDGET_MAX + 1,
116  NCSN_IMWS_MAX
117 };
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif
124 #endif //_MGNCSCTRL_IMWORDSEL
125 
define the mWidget members, inherit from mComponent