mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mexnode.h
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 /*
14  * \file mexnode.h
15  * \author miniStudio team of FMSoft
16  * \date 2010/10/09
17  *
18  \verbatim
19 
20  This file is part of mGNCS4Touch, one of MiniGUI components.
21 
22  Copyright (C) 2008-2018 FMSoft (http://www.fmsoft.cn).
23 
24  This program is free software: you can redistribute it and/or modify
25  it under the terms of the GNU General Public License as published by
26  the Free Software Foundation, either version 3 of the License, or
27  (at your option) any later version.
28 
29  This program is distributed in the hope that it will be useful,
30  but WITHOUT ANY WARRANTY; without even the implied warranty of
31  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32  GNU General Public License for more details.
33 
34  You should have received a copy of the GNU General Public License
35  along with this program. If not, see <http://www.gnu.org/licenses/>.
36 
37  Or,
38 
39  As this program is a library, any link to this program must follow
40  GNU General Public License version 3 (GPLv3). If you cannot accept
41  GPLv3, you need to be licensed from FMSoft.
42 
43  If you have got a commercial license of this program, please use it
44  under the terms and conditions of the commercial license.
45 
46  For more information about the commercial license, please refer to
47  <http://www.minigui.com/blog/minigui-licensing-policy/>.
48 
49  \endverbatim
50 */
51 
52 #ifndef _MGUI_NCS4TOUCH_ENOD_H_
53 #define _MGUI_NCS4TOUCH_ENOD_H_
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
59 typedef struct _mExNode mExNode;
60 typedef struct _mExNodeClass mExNodeClass;
61 
62 #define mExNodeHeader(clsName) \
63  mObjectHeader(clsName) \
64  mObject *body; \
65  mObject *parent; \
66  list_t children; \
67  list_t sibling; \
68  Uint16 flags; \
69  Uint16 count; \
70  int style; \
71  int height; \
72  char *text; \
73  char *subTitle; \
74  char *detail; \
75  DWORD addData;
76 
77 
78 struct _mExNode
79 {
80  mExNodeHeader(mExNode)
81 };
82 
83 #define mExNodeClassHeader(clsName, superCls) \
84  mObjectClassHeader(clsName, superCls) \
85  BOOL (*setProperty)(clsName*, int id, DWORD value); \
86  DWORD (*getProperty)(clsName*, int id); \
87  BOOL (*computeSize)(clsName*, HDC hdc, SIZE *size); \
88  BOOL (*canAsRoot)(clsName*); \
89  int (*addNode)(clsName*, mNode *node); \
90  int (*removeNode)(clsName*, mNode *node); \
91  int (*insertNode)(clsName*, mNode *node, mNode *prev, mNode *next, int index);\
92  int (*moveNode)(clsName*, mNode *curNode, int count, mNode *prevNode); \
93  mNode* (*findNode)(mNode *self, DWORD info, int type, BOOL recursion, int startIndex);\
94  mNode* (*findNodeEx)(mNode *self, DWORD info, int type, \
95  BOOL recursion, int startIndex, int (*cb)(mNode *node, DWORD info)); \
96  void (*removeAll)(clsName*); \
97  void (*sendEvent)(clsName*, int eventId); \
98  mNode* (*getNode)(clsName*, int index); \
99  int (*indexOf)(clsName*); \
100  mNode* (*getPrev)(clsName*); \
101  mNode* (*getNext)(clsName*); \
102  BOOL (*isEnabled)(clsName*); \
103  BOOL (*isSelected)(clsName*); \
104  BOOL (*hasChildren)(clsName*); \
105  BOOL (*setText)(clsName*, const char* text); \
106  BOOL (*setImage)(clsName*, const PBITMAP image); \
107  const char* (*getText)(clsName*); \
108  PBITMAP (*getImage)(clsName*); \
109  void (*paint)(clsName*, HDC hdc, const RECT *rect, mObject *owner); \
110  int (*msgHandler)(clsName*, int msg, WPARAM wParam, LPARAM lParam, mObject *owner);\
111  void (*setTitle) (clsName *, const char *); \
112  void (*setSubTitle) (clsName *, const char *); \
113  void (*setDetail) (clsName *, const char *);
114 
115 
116 struct _mExNodeClass
117 {
118  mExNodeClassHeader(mExNode, mObject)
119 };
120 
121 #define NCSS_ENOD_NORMAL (0x00)
122 #define NCSS_ENOD_BOOLEAN (0x01)
123 #define NCSS_ENOD_DETAIL (0x02)
124 #define NCSS_ENOD_CHECKABLE (0x04)
125 #define NCSS_ENOD_DELETABLE (0x08)
126 #define NCSS_ENOD_NODETAIL (0x10)
127 #define NCSS_ENOD_NOSUBTITLE (0x20)
128 #define NCSS_ENOD_NOICON (0x40)
129 #define NCSS_ENOD_SHIFT (7)
130 
131 enum mExNodeProp
132 {
133  NCSP_ENOD_TITLE = 0,
134  NCSP_ENOD_SUBTITLE,
135  NCSP_ENOD_DETAIL,
136  NCSP_ENOD_ICON,
137  NCSP_ENOD_MAX
138 };
139 
140 enum eExNodeNotify
141 {
142  NCSN_ENOD_CHANGED = 0,
143  NCSN_ENOD_MAX
144 };
145 
146 MTOUCH_EXPORT extern mExNodeClass g_stmExNodeCls;
147 
148 #ifdef __cplusplus
149 }
150 #endif /* __cplusplus */
151 
152 #endif /* _MGUI_NCS4TOUCH_ENOD_H_ */
153