mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mtableviewitempiece.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_TABLEVIEWITEMPIECEPIECE_H
53 #define _MGNCS_TABLEVIEWITEMPIECEPIECE_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
59 typedef struct _mTableViewItemPiece mTableViewItemPiece;
60 typedef struct _mTableViewItemPieceClass mTableViewItemPieceClass;
61 
62 enum mTableViewItemPieceProp
63 {
64  NCSP_BACKGROUND_COLOR = USER_PIECE_PROP_BEGIN + 1,
65  NCSP_HIGHTLIGHT_COLOR,
66 };
67 
68 #define NCS_TABLEVIEWITEM_BKCOLOR_VALUE 0xFFFFFFFF
69 #define NCS_TABLEVIEWITEM_HIGHLIGHT_VALUE 0xFF0000FF
70 
71 enum mTableViewItemPieceMode {
72  NCS_TABLEVIEWITEMPIECE_NORMAL = 0,
73  NCS_TABLEVIEWITEMPIECE_EDIT,
74 };
75 
76 enum mTableViewItemPieceEvent {
77  NCSN_TABLEVIEWITEMPIECE_SWITCHCLICKED = USER_PIECE_EVENT_BEGIN + 0X200,
78  NCSN_TABLEVIEWITEMPIECE_DELBTNCLICKED,
79  NCSN_TABLEVIEWITEMPIECE_CONTENTCLICKED,
80 };
81 
82 #define mTableViewItemPieceHeader(clss) \
83  mPanelPieceHeader(clss) \
84  enum mTableViewItemPieceMode mode; \
85  mHotPiece *switchPiece; \
86  mHotPiece *userPiece; \
87  mHotPiece *deletePiece; \
88  POINT ptSwitchPiece[2]; \
89  POINT ptUserPiece[2]; \
90  POINT ptDeletePiece[2]; \
91  BOOL userPieceIsLocked; \
92  BOOL deletePieceIsAppear; \
93  DWORD add_data; \
94  const char* picture;\
95  const char* text; \
96  mHotPiece* accessory; \
97  BOOL highlight; \
98  BOOL pushDown; \
99  MGEFF_ANIMATION modeChangeAnimation; \
100  MGEFF_ANIMATION switchStateChangeAnimation; \
101  DWORD bkgnd_color; \
102  DWORD hilite_color;
103 
104 struct _mTableViewItemPiece
105 {
106  mTableViewItemPieceHeader(mTableViewItemPiece)
107 };
108 
109 #define mTableViewItemPieceClassHeader(clss, superCls) \
110  mPanelPieceClassHeader(clss, superCls) \
111  void (*changeMode)(clss*); \
112  void (*resetEditMode)(clss*); \
113  void (*setHighlight)(clss*, BOOL); \
114  void (*setUserPiece)(clss*, mHotPiece*); \
115  mHotPiece* (*getSwitchPiece)(clss*); \
116  mHotPiece* (*getUserPiece)(clss*); \
117  mHotPiece* (*getDeletePiece)(clss*);
118 
119 struct _mTableViewItemPieceClass
120 {
121  mTableViewItemPieceClassHeader(mTableViewItemPiece, mPanelPiece)
122 };
123 
124 MGNCS_EXPORT extern mTableViewItemPieceClass g_stmTableViewItemPieceCls;
125 
126 #ifdef __cplusplus
127 }
128 #endif /* __cplusplus */
129 
130 #endif /* _MGNCS_TABLEVIEWITEMPIECEPIECE_H */