00001
00025 #ifdef _MGNCSCTRL_LIST
00026
00027 #ifndef _MGUI_NCSCTRL_LIST_H
00028 #define _MGUI_NCSCTRL_LIST_H
00029
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00044 #define NCSCTRL_LIST NCSCLASSNAME("list")
00045
00046 typedef struct _mList mList;
00047 typedef struct _mListClass mListClass;
00048 typedef struct _mListRenderer mListRenderer;
00049
00054 #define NCSS_LIST_LOOP (0x0001<<NCSS_ASTLST_SHIFT)
00055
00060 #define NCSS_LIST_MULTIPLE (0x0002<<NCSS_ASTLST_SHIFT)
00061
00066 #define NCSS_LIST_SHIFT (NCSS_ASTLST_SHIFT+2)
00067
00068 #define mListHeader(clsName) \
00069 mAbstractListHeader(clsName) \
00070 list_t selList; \
00071 mListLayout *layout; \
00072 mNode *hiliteNode; \
00073 Uint16 nodesHeight; \
00074 Uint16 nodesWidth;
00075
00092 struct _mList
00093 {
00094 mListHeader(mList)
00095 };
00096
00097 #define mListClassHeader(clsName, superCls) \
00098 mAbstractListClassHeader(clsName, superCls) \
00099 void (*resetContent)(clsName*); \
00100 void (*removeAll)(clsName*); \
00101 void (*enterSubList)(clsName*, mNode* selNode); \
00102 void (*backUpList)(clsName*, mNode* selNode); \
00103 BOOL (*setNodeDefSize)(clsName*, int defW,int defH);\
00104 BOOL (*setLayout)(clsName*, mListLayout* layout, int defNodeW, int defNodeH); \
00105 mListLayout* (*getLayout)(clsName*);
00106
00138 struct _mListClass
00139 {
00140 mListClassHeader(mList, mAbstractList)
00141 };
00142
00143 #define mListRendererHeader(clsName, parentClass) \
00144 mAbstractListRendererHeader(clsName, parentClass)
00145
00151 struct _mListRenderer {
00152 mListRendererHeader(mList, mAbstractList)
00153 };
00154
00155
00160 enum ncsListLayoutID
00161 {
00165 NCS_LIST_LLIST = 0,
00166
00170 NCS_LIST_LICONV,
00171
00172 NCS_LIST_LICONH,
00173
00174 NCS_LIST_LCBOXH,
00175
00176 NCS_LIST_LGROUP,
00177
00178 NCS_LIST_LUSERDEFINED,
00182 NCS_LIST_MAX,
00183 };
00184
00185 enum mListEvent
00186 {
00187 NCSE_LIST_FONTCHANGED = 100,
00188 NCSE_LIST_SIZECHANGED,
00189 NCSE_LIST_ROOTCHANGING,
00190 NCSE_LIST_ROOTCHANGED,
00191 };
00192
00193 enum mListDirKeyFlags{
00194 NCSF_LIST_UP = 0x01,
00195 NCSF_LIST_DOWN = 0x02,
00196 NCSF_LIST_LEFT = 0x04,
00197 NCSF_LIST_RIGHT = 0x08,
00198 NCSF_LIST_HOME = 0x10,
00199 NCSF_LIST_END = 0x20,
00200 NCSF_LIST_LOOP = 0x100,
00201 NCSF_LIST_DIRMASK= 0xFF,
00202 };
00207 enum mListProp
00208 {
00212 NCSP_LIST_LAYOUT = NCSP_ASTLST_MAX + 1,
00213
00217 NCSP_LIST_DEFNODEWIDTH,
00218
00222 NCSP_LIST_DEFNODEHEIGHT,
00223
00227 NCSP_LIST_MAX,
00228 };
00229
00234 enum mListNotify
00235 {
00240 NCSN_LIST_SELCHANGED = NCSN_ASTLST_MAX + 1,
00241
00246 NCSN_LIST_ENTER,
00247
00252 NCSN_LIST_BACKSPACE,
00253
00258 NCSN_LIST_ENTERSUBLIST,
00259
00264 NCSN_LIST_BACKUPLIST,
00265
00266 NCSN_LIST_ROOTNODECHANGED,
00270 NCSN_LIST_MAX,
00271 };
00272
00279 MGNCS_EXPORT extern mListClass g_stmListCls;
00280
00285 MGNCS_EXPORT void mList_foreachNode(mList *list, void (*foreach)(mNode *node, void* param), void* param);
00286
00289 #ifdef __cplusplus
00290 }
00291 #endif
00292
00293 #endif
00294 #endif //_MGNCSCTRL_LIST