ZFFramework
 
Loading...
Searching...
No Matches
ZFUIWindow.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUIWindow_h_
7#define _ZFI_ZFUIWindow_h_
8
9#include "ZFUIRootWindow.h"
11
12// ============================================================
13// ZFUIWindow
14zfclassFwd _ZFP_ZFUIWindowPrivate;
36zfclass ZFLIB_ZFUIKit ZFUIWindow : zfextend ZFUIView {
37 ZFOBJECT_DECLARE(ZFUIWindow, ZFUIView)
39
40 // ============================================================
41 // observer events
42public:
49 ZFEVENT(RootWindowOnUpdate)
50
56 ZFEVENT(WindowOnShow)
62 ZFEVENT(WindowOnHide)
63
69 ZFEVENT(WindowOwnerWindowOnRotate)
70
71public:
76 , ZFMP_IN(ZFUIView *, forView)
77 )
78
84 , ZFMP_IN(ZFUIView *, view)
85 )
86
87protected:
94 virtual void objectOnInit(void);
96 virtual void objectOnDealloc(void);
97
98 // ============================================================
99 // properties
100public:
108
114
115public:
123 , ZFMP_IN(ZFUIRootWindow *, rootWindow)
132protected:
134 virtual inline void rootWindowOnUpdate(ZF_IN ZFUIRootWindow *rootWindowOld) {
135 this->observerNotify(ZFUIWindow::E_RootWindowOnUpdate(), rootWindowOld);
136 }
137
138public:
151
152public:
161
162public:
167
168protected:
170 virtual inline void windowOnShow(void) {
172 }
173
174 virtual inline void windowOnHide(void) {
176 }
177
179 virtual inline void ownerWindowOnRotate(void) {
181 }
182
183protected:
185 virtual void viewOnAddToParent(ZF_IN ZFUIView *parent);
187 virtual void viewOnRemoveFromParent(ZF_IN ZFUIView *parent);
188
189private:
190 _ZFP_ZFUIWindowPrivate *d;
191 friend zfclassFwd ZFUIRootWindow;
192};
193
195#endif // #ifndef _ZFI_ZFUIWindow_h_
196
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
_ZFT_t_zfint zfint
same as int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:165
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_DECLARE_STATIC_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:870
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:316
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:128
#define ZFPROPERTY_ON_UPDATE_DECLARE(Type, Name)
see ZFPROPERTY_ON_INIT_DECLARE
Definition ZFPropertyDeclare.h:238
#define ZFSTYLE_DEFAULT_DECLARE(YourStyle)
used to declare a default style, see ZFStyleable
Definition ZFStyleable.h:260
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
root native window
void observerNotify(zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
notify the observer with eventId
base class of all layout param in ZFUIView
Definition ZFUIViewType.h:123
virtual zfanyT< ZFUIView > parent()
parent view or null if none
virtual void windowOnShow(void)
see E_WindowOnShow
Definition ZFUIWindow.h:170
virtual void objectOnDealloc(void)
override this to destroy your object
virtual zfbool showing()
whether the window is showing
virtual void rootWindow(ZFUIRootWindow *rootWindow)
change owner ZFUIRootWindow, must be called before show is called
virtual void objectOnInit(ZFUIRootWindow *rootWindow)
init with custom rootWindow, null to use ZFUIRootWindow::keyWindow
virtual void show()
show the window, automatically retain the window
virtual void windowMoveToBottom()
move window to bottom of all same level window
static zfidentity E_RootWindowOnUpdate(void)
see ZFObject::observerNotify
virtual void viewOnRemoveFromParent(ZFUIView *parent)
see E_ViewOnRemoveFromParent
virtual void ownerWindowOnRotate(void)
see E_WindowOwnerWindowOnRotate
Definition ZFUIWindow.h:179
static zfidentity E_WindowOwnerWindowOnRotate(void)
see ZFObject::observerNotify
static zfidentity E_WindowOnShow(void)
see ZFObject::observerNotify
static zfanyT< ZFUIRootWindow > rootWindowForView(ZFUIView *view)
util method to get owner sys window for the view, return null if not in view tree or failed to get
virtual zfbool & windowMarginShouldApply()
whether this window update layout according to ZFUIRootWindow::windowMargin, true by default
Definition ZFUIWindow.h:113
virtual void viewOnAddToParent(ZFUIView *parent)
see E_ViewOnAddToParent
virtual void layoutParam(ZFUILayoutParam *layoutParam)
manually set layout param
static zfanyT< ZFUIWindow > windowForView(ZFUIView *forView)
util method to get window of a view, or null if not in a window
virtual void windowOnHide(void)
see E_WindowOnHide
Definition ZFUIWindow.h:174
virtual zfint & windowLevel()
window's level, 0 by default
Definition ZFUIWindow.h:106
virtual void hide()
hide the window, automatically release the window
virtual void rootWindowOnUpdate(ZFUIRootWindow *rootWindowOld)
see E_RootWindowOnUpdate
Definition ZFUIWindow.h:134
static zfidentity E_WindowOnHide(void)
see ZFObject::observerNotify
virtual void windowMoveToTop()
move window to top of all same level window
see zfany
Definition zfany.h:113