mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mdatepicker.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 mdatepicker.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 __MGNCS4TOUCH_DPCK_H__
53 #define __MGNCS4TOUCH_DPCK_H__
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
59 #define NCSCTRL_DATEPICKER NCSCLASSNAME("datepicker")
60 
61 typedef struct _mDatePicker mDatePicker;
62 typedef struct _mDatePickerClass mDatePickerClass;
63 typedef struct _mDatePickerRenderer mDatePickerRenderer;
64 
65 #define mDatePickerHeader(clsName) \
66  mComboPickerHeader(clsName) \
67  PUBLIC int idYear; \
68  PUBLIC int idMonth; \
69  PUBLIC int idDay ; \
70  PUBLIC int year; \
71  PUBLIC int month; \
72  PUBLIC int day;
73 
74 struct _mDatePicker {
75  mDatePickerHeader(mDatePicker)
76 };
77 
78 #define mDatePickerClassHeader(clsName, parentClass) \
79  mComboPickerClassHeader(clsName, parentClass) \
80  PUBLIC void (*setDate)(clsName*, int year, int month, int day); \
81  PUBLIC BOOL (*getDate)(clsName*, int* year, int* month, int* day);
82 
83 struct _mDatePickerClass {
84  mDatePickerClassHeader(mDatePicker, mComboPicker)
85 };
86 
87 #define mDatePickerRendererHeader(clsName, parentClass) \
88  mComboPickerRendererHeader(clsName, parentClass)
89 
90 struct _mDatePickerRenderer {
91  mDatePickerRendererHeader(mDatePicker, mComboPicker)
92 };
93 
94 #define NCSS_DPCK_YYYYMMDD (0 << NCSS_CMBPCK_SHIFT)
95 #define NCSS_DPCK_MMDDYYYY (1 << NCSS_CMBPCK_SHIFT)
96 #define NCSS_DPCK_YYMMDD (2 << NCSS_CMBPCK_SHIFT)
97 #define NCSS_DPCK_MMDDYY (4 << NCSS_CMBPCK_SHIFT)
98 
99 #define NCSS_DPCK_SHIFT (3 + NCSS_CMBPCK_SHIFT)
100 
101 enum mDatePickerProp {
102  NCSP_DPCK_YEAR = NCSP_CMBPCK_MAX + 1,
103  NCSP_DPCK_MONTH,
104  NCSP_DPCK_DAY,
105  NCSP_DPCK_MAX
106 };
107 
108 enum mDatePickerNotify {
109  NCSN_DPCK_DATECHANGED = NCSN_CMBPCK_MAX + 1,
110  NCSN_DPCK_MAX
111 };
112 
113 MTOUCH_EXPORT extern mDatePickerClass g_stmDatePickerCls;
114 
115 #ifdef __cplusplus
116 }
117 #endif /* __cplusplus */
118 
119 #endif /* __MGNCS4TOUCH_DPCK_H__ */
120 
NCSN_CMBPCK_MAX
@ NCSN_CMBPCK_MAX
Definition: mcombopicker.h:158