ZFFramework
 
Loading...
Searching...
No Matches
ZFProtocolZFUIRootWindow.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFProtocolZFUIRootWindow_h_
7#define _ZFI_ZFProtocolZFUIRootWindow_h_
8
9#include "ZFCore/ZFProtocol.h"
10#include "../ZFUIRootWindow.h"
12
17 // ============================================================
18 // main window impl
19public:
40
41 // ============================================================
42public:
46 virtual void nativeWindowOnCleanup(ZF_IN ZFUIRootWindow *rootWindow) {
47 }
48
56 ZF_IN ZFUIRootWindow *rootWindow
57 , ZF_OUT_OPT void *&nativeParentView
63
71 virtual void modalWindowHide(
73 , ZF_IN ZFUIRootWindow *toHide
75
80 virtual void layoutParamOnInit(ZF_IN ZFUIRootWindow *rootWindow) {
81 }
82
85 virtual void layoutParamOnUpdate(ZF_IN ZFUIRootWindow *rootWindow) {
86 }
87
97 ZF_IN ZFUIRootWindow *rootWindow
98 , ZF_IN const ZFUIOrientationFlags &flags
100
104 virtual void windowColor(
105 ZF_IN ZFUIRootWindow *rootWindow
106 , ZF_IN const ZFUIColor &color
107 ) {
108 rootWindow->rootView()->bgColor(color);
109 }
110
111 // ============================================================
112 // callbacks that implementations must notify
113public:
119 ZF_IN ZFUIRootWindow *rootWindow
120 , ZF_IN const ZFUIRect &rootRefRect
121 , ZF_IN const ZFUIMargin &windowMargin
122 ) {
123 rootWindow->_ZFP_ZFUIRootWindow_windowMargin(windowMargin);
124 return rootWindow->_ZFP_ZFUIRootWindow_measureWindow(rootRefRect);
125 }
126
130 ZF_IN ZFUIRootWindow *rootWindow
131 , ZF_IN void *nativeWindow
132 ) {
133 rootWindow->_ZFP_ZFUIRootWindow_onCreate(nativeWindow);
134 }
135
139 rootWindow->_ZFP_ZFUIRootWindow_onDestroy();
140 }
141
146 rootWindow->_ZFP_ZFUIRootWindow_onResume();
147 }
148
153 rootWindow->_ZFP_ZFUIRootWindow_onPause();
154 }
155
159 rootWindow->_ZFP_ZFUIRootWindow_onRotate();
160 }
161
165 ZF_IN ZFUIRootWindow *rootWindow
166 , ZF_IN ZFUIKeyEvent *event
167 ) {
168 rootWindow->_ZFP_ZFUIRootWindow_keyEvent(event);
169 }
171
173#endif // #ifndef _ZFI_ZFProtocolZFUIRootWindow_h_
174
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:196
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfpurevirtual
dummy macro shows that a method is pure virtual method
Definition ZFCoreTypeDef_ClassType.h:68
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
protocol definitions for ZFFramework
#define ZFPROTOCOL_INTERFACE_END(ModuleName)
for more information, please refer to ZFPROTOCOL_INTERFACE_BEGIN
Definition ZFProtocol.h:412
#define ZFPROTOCOL_INTERFACE_BEGIN(ZFLIB_, ModuleName)
declare a protocol interface for ZFFramework
Definition ZFProtocol.h:406
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
root native window
v_ZFUIOrientation::ZFEnumType ZFUIOrientation
see v_ZFUIOrientation
Definition ZFUITypeDef.h:1145
_zft_ZFUIColor ZFUIColor
color with AARRGGBB format
Definition ZFUITypeDef.h:1184
virtual void mainWindowOnDestroy(void)=0
called when main window destroyed by notifyOnDestroy
virtual ZFUIRootWindow * mainWindow(void)=0
see ZFUIRootWindow::mainWindow
ZFUIRect notifyMeasureWindow(ZFUIRootWindow *rootWindow, const ZFUIRect &rootRefRect, const ZFUIMargin &windowMargin)
implementation must call this method to measure window's frame, and layout window using the result fr...
Definition ZFProtocolZFUIRootWindow.h:118
virtual zfauto modalWindowShow(ZFUIRootWindow *owner)=0
see ZFUIRootWindow::modalWindowShow
virtual void layoutParamOnInit(ZFUIRootWindow *rootWindow)
called to update suggested window layout param, fill with no margin by default
Definition ZFProtocolZFUIRootWindow.h:80
void notifyOnCreate(ZFUIRootWindow *rootWindow, void *nativeWindow)
implementation must call this to notify after window create
Definition ZFProtocolZFUIRootWindow.h:129
void notifyOnRotate(ZFUIRootWindow *rootWindow)
implementation must call this to notify when window rotate
Definition ZFProtocolZFUIRootWindow.h:158
virtual void nativeWindowRootViewOnRemove(ZFUIRootWindow *rootWindow)=0
called to remove root view to native window container
virtual void windowOrientationFlags(ZFUIRootWindow *rootWindow, const ZFUIOrientationFlags &flags)=0
see ZFUIRootWindow::windowOrientationFlags, impl should have v_ZFUIOrientation::e_Top as init value
virtual void nativeWindowRootViewOnAdd(ZFUIRootWindow *rootWindow, void *&nativeParentView)=0
called to add root view to native window container
void notifyOnResume(ZFUIRootWindow *rootWindow)
implementation must call this to notify after window resume, note that rotate a window should not not...
Definition ZFProtocolZFUIRootWindow.h:145
virtual void layoutParamOnUpdate(ZFUIRootWindow *rootWindow)
called when window layout param changed
Definition ZFProtocolZFUIRootWindow.h:85
virtual void modalWindowHide(ZFUIRootWindow *owner, ZFUIRootWindow *toHide)=0
see ZFUIRootWindow::modalWindowHide
virtual ZFUIOrientation windowOrientation(ZFUIRootWindow *rootWindow)=0
see ZFUIRootWindow::windowOrientation
virtual void windowColor(ZFUIRootWindow *rootWindow, const ZFUIColor &color)
called when ZFUIRootWindow::windowColor changed
Definition ZFProtocolZFUIRootWindow.h:104
virtual void mainWindowOnCleanup(void)=0
called to cleanup native main window
void notifyOnPause(ZFUIRootWindow *rootWindow)
implementation must call this to notify before window pause, note that rotate a window should not not...
Definition ZFProtocolZFUIRootWindow.h:152
void notifyOnDestroy(ZFUIRootWindow *rootWindow)
implementation must call this to notify before window destroy
Definition ZFProtocolZFUIRootWindow.h:138
void notifyKeyEvent(ZFUIRootWindow *rootWindow, ZFUIKeyEvent *event)
implementation must call this to notify key event
Definition ZFProtocolZFUIRootWindow.h:164
virtual void nativeWindowOnCleanup(ZFUIRootWindow *rootWindow)
called when owner ZFUIRootWindow is about to destroy
Definition ZFProtocolZFUIRootWindow.h:46
key event for ui elements
Definition ZFUIKeyEvent.h:17
margin
Definition ZFUITypeDef.h:147
see v_ZFUIOrientation, ZFUIOrientationFlagsToString, ZFUIOrientationFlagsFromString
Definition ZFUITypeDef.h:1145
2D rectangle
Definition ZFUITypeDef.h:636
root native window
Definition ZFUIRootWindow.h:34
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34