ZFFramework
 
Loading...
Searching...
No Matches
ZFUIScroller.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFUIScroller_h_
7#define _ZFI_ZFUIScroller_h_
8
9#include "ZFUITypeDef.h"
11
12// ============================================================
13// ZFUIScroller
29zfinterface ZFLIB_ZFUIKit ZFUIScroller : zfextend ZFInterface {
30 ZFINTERFACE_DECLARE(ZFUIScroller, ZFInterface)
31
32public:
43
44public:
54 ZF_IN zfbool scrollBounce
55 , ZF_IN zfbool scrollBounceAlways
57
61 virtual void scrollAlignToPageOnUpdate(ZF_IN zfbool scrollAlignToPage) zfpurevirtual;
62
68 ZF_IN zffloat contentOffset
69 , ZF_IN zffloat contentSize
71
72public:
76 virtual void scrollToFitRange(void) zfpurevirtual;
80 virtual void scrollStop(void) {
82 }
83
110
116
122
123public:
136
137public:
143 virtual void scrollOnDragBegin(
144 ZF_IN zffloat mousePos
145 , ZF_IN zftimet mouseTime
152 virtual void scrollOnDrag(
153 ZF_IN zffloat mousePos
154 , ZF_IN zftimet mouseTime
163 virtual void scrollOnDragEnd(
164 ZF_IN zftimet mouseTime
165 , ZF_IN zfbool needScrollAni
167
168public:
173};
174
175// ============================================================
182 , ZFMP_IN(const ZFClass *, cls)
188
190#endif // #ifndef _ZFI_ZFUIScroller_h_
191
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#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:180
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_zft_zftimet zftimet
time unit, ensured at least 64 bit, ensured signed
Definition ZFCoreTypeDef_CoreType.h:203
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_FUNC_DECLARE_0(ZFLIB_, ReturnType, MethodName)
declare function type of ZFMethod
Definition ZFMethodFuncDeclare.h:493
#define ZFMETHOD_FUNC_DECLARE_1(ZFLIB_, ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:624
#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 zfinterface
shows the type is an interface, see ZFInterface
Definition ZFObjectInterface.h:20
#define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface,...)
see ZFInterface
Definition ZFObjectInterface.h:100
#define ZFLIB_ZFUIKit
used to export symbols
Definition ZFUIKitDef.h:16
void ZFUIScrollerClass(const ZFClass *cls)
change default scroller
necessary header file for all ZFUIKit member
ZFObject's class info.
Definition ZFClass.h:67
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
virtual void scrollOnDrag(zffloat mousePos, zftimet mouseTime)=0
drag
virtual zffloat scrollBySpeedEndPointPredicted(void)=0
return end position of scrollBySpeed, must return current content offset if not scrolling
virtual zffloat scrollContentSize(void)=0
used to get current content size
virtual zfbool scrollRequireFocus(void)=0
whether this direction's scroller want higher priority, typically true if currently under progress to...
virtual void scrollAniOnUpdate(zftimet time)=0
called to update scroll animation
virtual void scrollOwnerSizeOnUpdate(zffloat ownerSize)=0
called when owner scroll view's size changed, you should fix content frame to match bounds if necessa...
virtual void scrollOnDragEnd(zftimet mouseTime, zfbool needScrollAni)=0
drag end
virtual zffloat scrollOwnerSize(void)=0
used to get current owner size
virtual void scrollBounceOnUpdate(zfbool scrollBounce, zfbool scrollBounceAlways)=0
whether use bounce
ZFListener scrollAniStopCallback
used to stop scroll animation's timer
Definition ZFUIScroller.h:42
ZFListener scrollAniStartCallback
used to start scroll animation's timer
Definition ZFUIScroller.h:38
virtual zffloat scrollContentOffset(void)=0
used to get current content offset
virtual zffloat scrollBySpeedCurrentSpeed(void)=0
return current speed of scrollBySpeed
virtual void scrollBySpeed(zffloat speed)=0
see ZFUIScrollView::scrollBySpeed
virtual void scrollAlignToPageOnUpdate(zfbool scrollAlignToPage)=0
whether align to page
virtual zffloat scrollByPointEndPoint(void)=0
return end position of scrollByPoint, must return current content offset if not scrolling
virtual void scrollContentOnUpdate(zffloat contentOffset, zffloat contentSize)=0
used to update scroll content, you should keep or update previous scroll animation if necessary
virtual void scrollToFitRange(void)=0
cancel over scroll and ensure content offset in range
virtual void scrollWithoutAnimation(zffloat contentOffset)=0
scroll without scroll animation, you should stop old scroll animation if necessary
virtual void scrollByPoint(zffloat point)=0
see ZFUIScrollView::scrollByPoint
virtual void scrollStop(void)
util method to stop scroll animation
Definition ZFUIScroller.h:80
virtual zffloat scrollEndPointPredicted(void)=0
return end position, must return current content offset if not scrolling
virtual void scrollOnDragBegin(zffloat mousePos, zftimet mouseTime)=0
drag begin