#include <ZFProtocolZFUIView.h>
Public Member Functions | |
virtual const zfchar * | protocolName (void) const |
get the name of the protocol module, e.g. "ZFObject" | |
virtual zfbool | nativeViewCacheOnSave (void *nativeView) |
called to save native view cache | |
virtual void | nativeViewCacheOnRestore (ZFUIView *view, void *nativeView) |
see nativeViewCacheOnSave | |
virtual void * | nativeViewCreate (ZFUIView *view)=0 |
called when a ZFUIView created, to register native view to ZFUIView | |
virtual void | nativeViewDestroy (void *nativeView)=0 |
called when a ZFUIView destroyed, the internal nativeView could be accessed by ZFUIView.nativeView | |
virtual void | nativeImplView (ZFUIView *view, void *nativeImplViewOld, void *nativeImplView, zfindex virtualIndex, zfbool nativeImplViewRequireVirtualIndex)=0 |
attach a native view to this view, see ZFUINativeViewWrapper | |
virtual void | nativeImplViewFrame (ZFUIView *view, const ZFUIRect &rect)=0 |
see ZFUIView::nativeImplViewMarginUpdate | |
virtual zffloat | UIScaleForImpl (void *nativeView)=0 |
get proper scale for the view | |
virtual zffloat | UIScaleForPixel (void *nativeView)=0 |
get proper scale for physical pixel | |
virtual void | visible (ZFUIView *view, zfbool visible)=0 |
see ZFUIView | |
virtual void | alpha (ZFUIView *view, zffloat alpha)=0 |
see ZFUIView | |
virtual void | viewUIEnable (ZFUIView *view, zfbool viewUIEnable)=0 |
see ZFUIView | |
virtual void | viewUIEnableTree (ZFUIView *view, zfbool viewUIEnableTree)=0 |
see ZFUIView | |
virtual void | mouseHoverEnable (ZFUIView *view, zfbool mouseHoverEnable) |
see ZFUIView | |
virtual void | bgColor (ZFUIView *view, const ZFUIColor &bgColor)=0 |
see ZFUIView | |
virtual void | child (ZFUIView *parent, ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayer childLayer, zfindex childLayerIndex)=0 |
add view, no need to worry about layout param or internal views | |
virtual void | childRemove (ZFUIView *parent, ZFUIView *child, zfindex virtualIndex, ZFUIViewChildLayer childLayer, zfindex childLayerIndex)=0 |
remove view, no need to worry about layout param or ZFUIView's internal views | |
virtual void | childRemoveAllForDealloc (ZFUIView *parent)=0 |
called to remove all children during parent dealloc for performance | |
virtual void | viewFrame (ZFUIView *view, const ZFUIRect &rect)=0 |
set view's frame, no need to worry about layout param or auto resizing | |
virtual void | layoutRequest (ZFUIView *view)=0 |
called by ZFUIView to notify the implementation that the view needs layout | |
virtual void | measureNativeView (ZFUISize &ret, void *nativeView, const ZFUISize &sizeHint)=0 |
measure a native view, only called by ZFUINativeViewWrapper | |
void | notifyLayoutView (ZFUIView *view, const ZFUIRect &rect) |
implementations must notify when need layout if view's parent isn't ZFUIView | |
void | notifyUIEvent (ZFUIView *view, ZFUIEvent *uiEvent) |
implementation must notify when UI event occurred | |
![]() | |
virtual void | protocolOnInit (void) |
called to init the protocol | |
virtual void | protocolOnInitFinish (void) |
see protocolOnInit | |
virtual void | protocolOnDeallocPrepare (void) |
see protocolOnInit | |
virtual void | protocolOnDealloc (void) |
see protocolOnInit | |
virtual ZFProtocolInstanceState | protocolInstanceState (void) |
protocol instance's state | |
virtual const zfchar * | protocolImplName (void) const |
get the name of the protocol implementation, e.g. "ZFObject_default" | |
virtual ZFProtocolLevel | protocolImplLevel (void) const |
get the level of the protocol implementation | |
virtual const zfchar * | protocolImplPlatformHint (void) const |
get type hint of the implementation or empty string if not defined, e.g. "iOS:NSString" for iOS's string impl, use ZFPROTOCOL_IMPLEMENTATION_PLATFORM_HINT to register | |
virtual void | objectInfoT (zfstring &ret) const |
see objectInfo | |
virtual zfstring | objectInfo (void) const |
get a short info about this object | |
Protected Types | |
typedef ZFProtocol | zfsuper |
class ref to super | |
typedef ZFPInterface_ZFUIView | zfself |
class ref to self | |
protocol for ZFUIView
|
inlinevirtual |
get the name of the protocol module, e.g. "ZFObject"
Reimplemented from ZFProtocol.
|
inlinevirtual |
called to save native view cache
reset your native view's state and return true if your impl support cache
here's a list of state you should take care to reset:
|
pure virtual |
called when a ZFUIView created, to register native view to ZFUIView
return a native view token, which is automatically saved to ZFUIView.nativeView
|
pure virtual |
called when a ZFUIView destroyed, the internal nativeView could be accessed by ZFUIView.nativeView
it's ensured that view has been remove from parent before destroy
|
pure virtual |
attach a native view to this view, see ZFUINativeViewWrapper
set null to remove the attached native view, and it's ensured set null before view destroy
nativeImplView has two use:
|
pure virtual |
see ZFUIView::nativeImplViewMarginUpdate
note, may be called even if nativeImplView is null
|
pure virtual |
add view, no need to worry about layout param or internal views
you should not retain or release those views
virtualIndex shows the absolute index of the child, impl should not care about the actual meanning of this index, simply add to the specified index
|
pure virtual |
|
pure virtual |
called to remove all children during parent dealloc for performance
see ZFUIView::implChildOnRemoveAllForDealloc
you must remove all children EXCEPT the nativeImplView
|
pure virtual |
called by ZFUIView to notify the implementation that the view needs layout
implementations should ensure next layout step would layout the view by calling notifyLayoutView
you have no need worry about parent, parent's layoutRequest would be called by ZFUIView if necessary
implementation must notify when UI event occurred
here is a list of UI events you may want to take care: