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
101 // ============================================================
102 // callbacks that implementations must notify
103public:
109 ZF_IN ZFUIRootWindow *rootWindow
110 , ZF_IN const ZFUIRect &rootRefRect
111 , ZF_IN const ZFUIMargin &windowMargin
112 ) {
113 rootWindow->_ZFP_ZFUIRootWindow_windowMargin(windowMargin);
114 return rootWindow->_ZFP_ZFUIRootWindow_measureWindow(rootRefRect);
115 }
116
120 ZF_IN ZFUIRootWindow *rootWindow
121 , ZF_IN void *nativeWindow
122 ) {
123 rootWindow->_ZFP_ZFUIRootWindow_onCreate(nativeWindow);
124 }
125
129 rootWindow->_ZFP_ZFUIRootWindow_onDestroy();
130 }
131
136 rootWindow->_ZFP_ZFUIRootWindow_onResume();
137 }
138
143 rootWindow->_ZFP_ZFUIRootWindow_onPause();
144 }
145
149 rootWindow->_ZFP_ZFUIRootWindow_onRotate();
150 }
151
155 ZF_IN ZFUIRootWindow *rootWindow
156 , ZF_IN ZFUIKeyEvent *event
157 ) {
158 rootWindow->_ZFP_ZFUIRootWindow_keyEvent(event);
159 }
161
163#endif // #ifndef _ZFI_ZFProtocolZFUIRootWindow_h_
164
#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
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:108
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:119
void notifyOnRotate(ZFUIRootWindow *rootWindow)
implementation must call this to notify when window rotate
Definition ZFProtocolZFUIRootWindow.h:148
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:135
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 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:142
void notifyOnDestroy(ZFUIRootWindow *rootWindow)
implementation must call this to notify before window destroy
Definition ZFProtocolZFUIRootWindow.h:128
void notifyKeyEvent(ZFUIRootWindow *rootWindow, ZFUIKeyEvent *event)
implementation must call this to notify key event
Definition ZFProtocolZFUIRootWindow.h:154
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