ZFFramework
 
Loading...
Searching...
No Matches
ZFUIDialog.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUIDialog_h_
7#define _ZFI_ZFUIDialog_h_
8
9#include "ZFUIButton.h"
12
14
15// ============================================================
42
43// ============================================================
44// ZFUIDialog
45zfclassFwd _ZFP_I_ZFUIDialogPrivate;
53zfclass ZFLIB_ZFUIWidget ZFUIDialog : zfextend ZFStyle {
54 ZFOBJECT_DECLARE(ZFUIDialog, ZFStyle)
56
57public:
58 // ============================================================
59 // events
65 ZFEVENT(DialogBeforeShow)
71 ZFEVENT(DialogAfterShow)
77 ZFEVENT(DialogBeforeHide)
83 ZFEVENT(DialogAfterHide)
91 ZFEVENT(DialogFocusOnUpdate)
92
93public:
94 // ============================================================
95 // properties
101
113
118
123
128
134 ZFPROPERTY_RETAIN(zfanyT<ZFUIImage>, bgImage, zfres("ZFUIWidget/ZFUIDialog_bg.xml"))
136
143
148
153
164
171
182
183public:
209 , ZFMP_IN(ZFUIButton *, button)
211
212public:
219
220protected:
234
235protected:
237 virtual inline void dialogBeforeShow(void) {
239 }
240
241 virtual inline void dialogAfterShow(void) {
243 }
244
245 virtual inline void dialogBeforeHide(void) {
247 }
248
249 virtual inline void dialogAfterHide(void) {
251 }
252
261
262protected:
264 virtual void objectOnInit(void);
266 virtual void objectOnDealloc(void);
267
268private:
269 _ZFP_I_ZFUIDialogPrivate *d;
270 friend zfclassFwd _ZFP_I_ZFUIDialogPrivate;
271};
272
274#endif // #ifndef _ZFI_ZFUIDialog_h_
275
#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 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 zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define ZFEXPORT_VAR_DECLARE(ZFLIB_, Type, Name)
util to export global variable
Definition ZFExport.h:68
#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_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_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:316
zfauto ZFObjectCreator(const ZFListener &impl, const ZFArgs &zfargs=ZFArgs())
util to create object from custom impl
Definition ZFObjectUtil.h:153
#define ZFPROPERTY_RETAIN(Type, Name,...)
declare a retain property
Definition ZFPropertyDeclare.h:104
#define ZFPROPERTY_ON_DETACH_DECLARE(Type, Name)
see ZFPROPERTY_ON_INIT_DECLARE
Definition ZFPropertyDeclare.h:258
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:128
#define ZFPROPERTY_RETAIN_READONLY(Type, Name, InitValueOrEmpty)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:110
#define ZFPROPERTY_ON_ATTACH_DECLARE(Type, Name)
see ZFPROPERTY_ON_INIT_DECLARE
Definition ZFPropertyDeclare.h:248
zfauto zfres(const zfchar *resFilePath, const ZFPathInfo &pathInfo=(zft_zfnull))
load resource by ZFObjectIOLoad
#define ZFSTYLE_DEFAULT_DECLARE(YourStyle)
used to declare a default style, see ZFStyleable
Definition ZFStyleable.h:260
abstract button
ZFListener & ZFUIDialogAniShowCreator(void)
default animation for ZFUIDialog::aniShow
Definition ZFUIDialog.h:30
zfint & ZFUIDialogWindowLevel(void)
default ZFUIWindow::windowLevel for ZFUIDialog, 1000 by default
Definition ZFUIDialog.h:41
ZFListener & ZFUIDialogAniHideCreator(void)
default animation for ZFUIDialog::aniHide
Definition ZFUIDialog.h:37
ZFListener & ZFUIDialogLayoutParamCreator(void)
default layout param for ZFUIDialog::layoutParam
Definition ZFUIDialog.h:23
a scroll container that automatically fits content's position according ZFUIOnScreenKeyboardState
auto fit ZFUIWindow according to ZFUIOnScreenKeyboardState
_zft_ZFUIColor ZFUIColor
color with AARRGGBB format
Definition ZFUITypeDef.h:1184
#define ZFLIB_ZFUIWidget
used to export symbols
Definition ZFUIWidgetDef.h:17
base class of all animation
Definition ZFAnimation.h:22
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
void observerNotify(zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
notify the observer with eventId
abstract button
Definition ZFUIButton.h:42
virtual void dialogBeforeShow(void)
see E_DialogBeforeShow
Definition ZFUIDialog.h:237
virtual zfbool & windowAutoDim()
whether auto dim window background by an alpha change animation, true by default
Definition ZFUIDialog.h:112
static zfidentity E_DialogAfterHide(void)
see ZFObject::observerNotify
virtual void autoHideForButton(ZFUIButton *button)
util method to attach click listener to specified button, which would simply hide the dialog
virtual void dialogAfterShow(void)
see E_DialogAfterShow
Definition ZFUIDialog.h:241
virtual void hideImmediately()
stop any animation and hide the dialog immediately, usually used to destroy a dialog immediately
static zfanyT< ZFUIDialog > DefaultStyle(void)
virtual ZFUIOnScreenKeyboardAutoFitLayout * windowAutoFitLayout()
see windowAutoFit
virtual zfbool & hideWhenClickBack()
whether hide when clicked back or esc key, false by default
Definition ZFUIDialog.h:152
virtual ZFUIWindow * window()
directly access the window of this dialog
virtual void objectOnDealloc(void)
override this to destroy your object
virtual zfbool & windowMarginShouldApply()
whether this dialog update layout according to ZFUIRootWindow::windowMargin, true by default
Definition ZFUIDialog.h:100
virtual void objectOnInit(void)
override this to init your object
virtual zfanyT< ZFAnimation > const & aniHide()
dialog's hide animation
Definition ZFUIDialog.h:127
virtual void dialogBeforeHide(void)
see E_DialogBeforeHide
Definition ZFUIDialog.h:245
virtual void show()
show the dialog
virtual zfbool & hideWhenTouchOutside()
whether hide when touched outside of the dialog, false by default
Definition ZFUIDialog.h:147
virtual zfanyT< ZFUIView > const & content()
dialog content, null by default
Definition ZFUIDialog.h:161
virtual zfbool & autoFocus()
whether automatically focus to dialog content, true by default
Definition ZFUIDialog.h:142
static zfidentity E_DialogBeforeShow(void)
see ZFObject::observerNotify
virtual ZFUIView * dialogContainer()
the dialog content container which hold the ZFUIDialog::content
virtual void hide()
hide the dialog
virtual zfanyT< ZFAnimation > const & aniShow()
dialog's show animation
Definition ZFUIDialog.h:122
static zfidentity E_DialogAfterShow(void)
see ZFObject::observerNotify
virtual void dialogAfterHide(void)
see E_DialogAfterHide
Definition ZFUIDialog.h:249
static zfidentity E_DialogBeforeHide(void)
see ZFObject::observerNotify
virtual zfbool & windowAutoFit()
whether automatically fix frame according to ZFUIOnScreenKeyboardAutoFitLayout, false by default
Definition ZFUIDialog.h:178
virtual zfbool & windowAutoResize()
whether automatically fix frame according to ZFUIOnScreenKeyboardAutoResizeStart, true by default
Definition ZFUIDialog.h:169
virtual zfanyT< ZFUIView > dialogFocusOnUpdate(void)
see E_DialogFocusOnUpdate
virtual ZFUIColor & windowColor()
dialog's background color, ZFUIGlobalStyle::colorMask by default
Definition ZFUIDialog.h:105
virtual zfanyT< ZFUIImage > const & bgImage()
dialog's background image
Definition ZFUIDialog.h:134
virtual ZFUIView * dialogBackgroundContainer()
the dialog background container which hold the ZFUIDialog::bgImage
virtual zfanyT< ZFUILayoutParam > const & layoutParam()
dialog's layout param
Definition ZFUIDialog.h:117
virtual zfbool showing()
true if dialog is showing
global style for ui elements
Definition ZFUIGlobalStyle.h:15
image storage
Definition ZFUIImage.h:30
base class of all layout param in ZFUIView
Definition ZFUIViewType.h:123
a scroll container that automatically fits content's position according ZFUIOnScreenKeyboardState
Definition ZFUIOnScreenKeyboardAutoFit.h:20
base class of all UI views
Definition ZFUIView.h:90
window as a ZFUIView
Definition ZFUIWindow.h:36
see zfany
Definition zfany.h:113