mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mitempiece.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
15  * \author FMSoft
16  * \date
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 _MGNCS_ITEMPIECE_H
53 #define _MGNCS_ITEMPIECE_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
59 #define ITEMPIECE_WIDTH 480
60 #define ITEMPIECE_HEIGHT 50
61 
62 typedef struct _mItemPiece mItemPiece;
63 typedef struct _mItemPieceClass mItemPieceClass;
64 
65 enum mItemPieceState {
66  ITEMPIECE_STATE_NORMAL,
67  ITEMPIECE_STATE_PUSHED,
68 };
69 
70 enum mItemPieceEvent {
71  NCSN_ITEMPIECE_CONTENT_CLICKED = USER_PIECE_EVENT_BEGIN + 0x700,
72  NCSN_ITEMPIECE_BUTTON_CLICKED,
73  NCSN_ITEMPIECE_CHECKBOX_ON,
74  NCSN_ITEMPIECE_CHECKBOX_OFF,
75 };
76 
77 enum mItemPieceAccessoryControlStyle {
78  ITEMPIECE_AC_INDICATORBUTTON,
79  ITEMPIECE_AC_SWITCH,
80  ITEMPIECE_AC_CHECKMARK,
81  ITEMPIECE_AC_RADIO,
82  ITEMPIECE_AC_INDICATOR,
83 };
84 
85 #define mItemPieceHeader(clss) \
86  mPanelPieceHeader(clss) \
87  HDC privateDC; \
88  int state; \
89  unsigned margin; \
90  unsigned border; \
91  unsigned clearance; \
92  int offsetLeft; \
93  int offsetRight; \
94  int align; \
95  int valign; \
96  BOOL isTitlePiece; \
97  ARGB titleColor; \
98  ARGB subTitleColor; \
99  ARGB detailColor; \
100  ARGB bkColor; \
101  PLOGFONT titleFont; \
102  PLOGFONT subTitleFont; \
103  PLOGFONT detailFont; \
104  PLOGFONT defaultTitleFont; \
105  PLOGFONT defaultSubTitleFont; \
106  PLOGFONT defaultDetailFont; \
107  mImagePiece *imagePiece; \
108  mTextPiece *titlePiece; \
109  mTextPiece *subTitlePiece; \
110  mTextPiece *detailPiece; \
111  mShapeTransRoundPiece *bkPiece; \
112  mHotPiece *accessoryControlPiece; \
113  int acStyle; \
114  int childAlign[6]; \
115  int childrenTotal;
116 
117 struct _mItemPiece
118 {
119  mItemPieceHeader(mItemPiece)
120 };
121 
122 #define mItemPieceClassHeader(clss, superCls) \
123  mPanelPieceClassHeader(clss, superCls) \
124  HDC myDC; \
125  void (*setLayout)(clss*, int); \
126  void (*activeLayout)(clss*); \
127  void (*setImage)(clss*, PBITMAP, int, int); \
128  void (*setTitle)(clss*, const char*, PLOGFONT, ARGB*); \
129  void (*setSubTitle)(clss*, const char*, PLOGFONT, ARGB*); \
130  void (*setDetail)(clss*, const char*, PLOGFONT, ARGB*); \
131  void (*setSubStance)(clss*, const char*, PLOGFONT, ARGB*); \
132  void (*setAccessoryControl)(clss*, const char*, BOOL, int, DWORD); \
133  void (*setCheckBoxState)(clss*, BOOL); \
134  int (*getCheckBoxState)(clss*); \
135  BOOL (*setItemRect)(clss*, const RECT*);
136 
137 struct _mItemPieceClass
138 {
139  mItemPieceClassHeader(mItemPiece, mPanelPiece)
140 };
141 
142 enum mItemPieceProperty {
143  NCSP_ITEMPIECE_MARGIN = USER_PIECE_PROP_BEGIN + 1,
144  NCSP_ITEMPIECE_BORDER,
145  NCSP_ITEMPIECE_CLEARANCE,
146  NCSP_ITEMPIECE_VALIGN,
147  NCSP_ITEMPIECE_BKCOLOR,
148  NCSP_ITEMPIECE_GRADIENT_BKCOLOR,
149  NCSP_ITEMPIECE_MAX
150 };
151 
152 MGNCS_EXPORT extern mItemPieceClass g_stmItemPieceCls;
153 
154 #ifdef __cplusplus
155 }
156 #endif /* __cplusplus */
157 
158 #endif /* _MGNCS_ITEMPIECE_H */