mGNCS4Touch API Reference  v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
mnavigationitem.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_MNAVIGATION_ITEM_H
53 #define _MGNCS_MNAVIGATION_ITEM_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 
60 typedef struct _mNavigationItemClass mNavigationItemClass;
61 typedef struct _mNavigationItem mNavigationItem;
62 
63 
64 /* NavigationItem set and get properties */
65 #define NAVIGATIONITEM_PROP_BEGIN USER_PIECE_PROP_BEGIN + 1
66 enum {
67  NCSP_NAVIGATIONITEM_CONTENT = NAVIGATIONITEM_PROP_BEGIN,
68  NCSP_NAVIGATIONITEM_BACKGROUND,
69  NCSP_NAVIGATIONITEM_BAR_BKG,
70  NCSP_NAVIGATIONITEM_TITLE,
71  NCSP_NAVIGATIONITEM_STYLE,
72  NCSP_NAVIGATIONITEM_LEFT_BUTTON,
73  NCSP_NAVIGATIONITEM_TITLE_BUTTON,
74  NCSP_NAVIGATIONITEM_RIGHT_BUTTON,
75  NCSP_NAVIGATIONITEM_DEFAULT_BUTTON_FONT,
76 };
77 
78 /* navigation bar style */
79 typedef enum {
80  NAVIGATION_STYLE_NORMAL = 0x00, /* normal: the bar not overlapped the view, not transparent */
81  NAVIGATION_STYLE_FULLSCREEN = 0x01, /* full screen: the bar overlapped the view, transparent */
82  NAVIGATION_STYLE_HIDE_BAR = 0x02 /* full screen: the bar not show */
83 } navigation_bar_style;
84 
85 
86 /* NaviagtionItem methods */
87 #define mNavigationItemClassHeader(clss, superCls) \
88  mObjectClassHeader(clss, superCls) \
89  m3DButtonPiece* (*createDefaultButton)(clss*, const char*, DWORD); \
90  BOOL (*setProperty)(clss*, int, DWORD); \
91  DWORD(*getProperty)(clss*, int);
92 
93 /* static interface */
94 MGNCS_EXPORT extern mNavigationItem* ncsCreateNavigationItem (mHotPiece *content,
95  const char *title, unsigned int style);
96 MGNCS_EXPORT extern void ncsDestroyNavigationItem (mNavigationItem* item);
97 MGNCS_EXPORT extern void ncsAdjustNavigationItemRectWithTitle (mHotPiece *content, const char *title, PLOGFONT font);
98 
99 struct _mNavigationItemClass
100 {
101  mNavigationItemClassHeader(mNavigationItem, mObject)
102 };
103 
104 MGNCS_EXPORT extern mNavigationItemClass g_stmNavigationItemCls;
105 
106 
107 /* NaviagtioItem data members */
108 #define mNavigationItemHeader(clss) \
109  mObjectHeader(clss) \
110  mShapeTransRoundPiece* background; \
111  mHotPiece* content; \
112  mButtonPanelPiece* bar_left_button; \
113  mTextPiece* bar_title_button; \
114  mButtonPanelPiece* bar_right_button; \
115  PLOGFONT default_button_font; \
116  unsigned int style; \
117  char* title;
118 
119 struct _mNavigationItem
120 {
121  mNavigationItemHeader(mNavigationItem)
122 };
123 
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /*_MGNCS_MNAVIGATION_ITEM_H*/
130