ZFFramework
 
Loading...
Searching...
No Matches
ZFPInterface_ZFUIScrollView Class Referenceabstract

protocol for ZFUIScrollView More...

#include <ZFProtocolZFUIScrollView.h>

Inheritance diagram for ZFPInterface_ZFUIScrollView:
ZFProtocol

Public Member Functions

virtual const zfcharprotocolName (void) const
 get the name of the protocol module, e.g. "ZFObject"
 
virtual void * nativeScrollViewCreate (ZFUIScrollView *scrollView, zfbool &nativeImplViewRequireVirtualIndex)=0
 create native scroll view
 
virtual void nativeScrollViewDestroy (ZFUIScrollView *scrollView, void *nativeScrollView)=0
 destroy native scroll view
 
virtual void scrollEnable (ZFUIScrollView *scrollView, zfbool scrollEnable)=0
 see ZFUIScrollView::scrollEnable
 
virtual void scrollBounce (ZFUIScrollView *scrollView, zfbool scrollBounceHorizontal, zfbool scrollBounceVertical, zfbool scrollBounceHorizontalAlways, zfbool scrollBounceVerticalAlways)=0
 see ZFUIScrollView::scrollBounceHorizontal
 
virtual void scrollContentFrame (ZFUIScrollView *scrollView, const ZFUIRect &frame)=0
 change content's frame
 
void scrollContentFrameUpdateByImpl (ZFUIScrollView *scrollView, const ZFUIRect &frame)
 for impl to update scroll content frame without activating any other event
 
virtual zftimet scrollAnimationStart (ZFUIScrollView *scrollView, zftimet recommendTimerInterval)
 used to start scroll animation for performance
 
virtual void scrollAnimationStop (ZFUIScrollView *scrollView)
 see scrollAnimationStart
 
virtual void scrollChildAdd (ZFUIScrollView *parent, ZFUIView *child, zfindex atIndex)=0
 add child view
 
virtual void scrollChildRemove (ZFUIScrollView *parent, ZFUIView *child, zfindex atIndex)=0
 remove child view
 
virtual void scrollChildRemoveAllForDealloc (ZFUIScrollView *parent)=0
 called to remove all children during parent dealloc for performance
 
void notifyScrollViewDragBegin (ZFUIScrollView *scrollView, const ZFUIPoint &mousePos, zftimet mouseTime)
 see scrollContentFrame for how to implement scroll logic
 
void notifyScrollViewDrag (ZFUIScrollView *scrollView, const ZFUIPoint &mousePos, zftimet mouseTime)
 see scrollContentFrame for how to implement scroll logic
 
void notifyScrollViewDragEnd (ZFUIScrollView *scrollView, zftimet mouseTime, zfbool needScrollAni)
 see scrollContentFrame for how to implement scroll logic
 
void notifyScrollViewScrollAnimation (ZFUIScrollView *scrollView, zftimet relativeTimeInMiliseconds)
 see scrollAnimationStart for how to implement scroll animation logic
 
- Public Member Functions inherited from ZFProtocol
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 zfcharprotocolImplName (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 zfcharprotocolImplPlatformHint (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_ZFUIScrollView zfself
 class ref to self
 

Detailed Description

protocol for ZFUIScrollView

Member Function Documentation

◆ protocolName()

virtual const zfchar * ZFPInterface_ZFUIScrollView::protocolName ( void ) const
inlinevirtual

get the name of the protocol module, e.g. "ZFObject"

Reimplemented from ZFProtocol.

◆ scrollBounce()

virtual void ZFPInterface_ZFUIScrollView::scrollBounce ( ZFUIScrollView * scrollView,
zfbool scrollBounceHorizontal,
zfbool scrollBounceVertical,
zfbool scrollBounceHorizontalAlways,
zfbool scrollBounceVerticalAlways )
pure virtual

see ZFUIScrollView::scrollBounceHorizontal

actual bounce logic would be done by ZFUIScrollView for you, this is only a hint for implementation, for example, a none bounceable scroll view won't start drag action

◆ scrollContentFrame()

virtual void ZFPInterface_ZFUIScrollView::scrollContentFrame ( ZFUIScrollView * scrollView,
const ZFUIRect & frame )
pure virtual

change content's frame

scroll view's content frame logic, including scrolling animation logic, would be done by ZFUIScrollView for you, what you should do, is to supply proper mouse intercept logic, make sure mouse down/up is paired both to the scroll view and its children, and notify necessary events:

◆ scrollAnimationStart()

virtual zftimet ZFPInterface_ZFUIScrollView::scrollAnimationStart ( ZFUIScrollView * scrollView,
zftimet recommendTimerInterval )
inlinevirtual

used to start scroll animation for performance

you should schedule a timer task that repeatly call notifyScrollViewScrollAnimation, return a relative time in miliseconds to represents scroll animation's timing
timer interval should be decided by implementation internally, according to runtime performance, and typically 50 miliseconds would suit for most cases

by default, we would use ZFTimer to supply a default implementation, which may have worse performance, and depends on ZFTimer and ZFTime

◆ scrollChildAdd()

virtual void ZFPInterface_ZFUIScrollView::scrollChildAdd ( ZFUIScrollView * parent,
ZFUIView * child,
zfindex atIndex )
pure virtual

add child view

you should not retain or release those views
atIndex is ensured valid, range [0, curChildCount], meaning if 0 add to first and if curChildCount add to last

◆ scrollChildRemove()

virtual void ZFPInterface_ZFUIScrollView::scrollChildRemove ( ZFUIScrollView * parent,
ZFUIView * child,
zfindex atIndex )
pure virtual

remove child view

you should not retain or release those views
atIndex is ensured valid, range [0, curChildCount)

◆ scrollChildRemoveAllForDealloc()

virtual void ZFPInterface_ZFUIScrollView::scrollChildRemoveAllForDealloc ( ZFUIScrollView * parent)
pure virtual

called to remove all children during parent dealloc for performance

see ZFUIView::implChildOnRemoveAllForDealloc


The documentation for this class was generated from the following file: