12#ifndef __SSTACKVIEW__H__
13#define __SSTACKVIEW__H__
16#include <interface/SCtrl-i.h>
18#include <proxy/SWindowProxy.h>
50 STDMETHOD_(IValueAnimator *,
clone)(THIS) SCONST OVERRIDE
59 STDMETHOD_(
void, onEvaluateValue)(THIS_
float fraction) OVERRIDE;
65 STDMETHOD_(
void, start)(THIS_ ITimelineHandlersMgr *pTimerlineMgr) OVERRIDE;
106 void OnOwnerResize();
113 void SetOwnerSizeRange(SIZE szFrom, SIZE szTo);
136 SIZE GetOwnerSize()
const;
151 void initEvaluator();
174 DEF_SOBJECT(
SWindow, L
"stackPage")
208 ATTR_ENUM_BEGIN(L
"aniType", StackViewAniStyle, FALSE)
209 ATTR_ENUM_VALUE(L
"none", kAniNone)
210 ATTR_ENUM_VALUE(L
"fade", kFadeInOut)
211 ATTR_ENUM_VALUE(L
"move", kMoveInOut)
212 ATTR_ENUM_VALUE(L
"push", kPushInOut)
228 : public TWindowProxy<IStackView>
229 , public IAnimatorListener {
230 friend class SViewSwitchAnimator;
251 STDMETHOD_(BOOL,
SelectPage)(THIS_
int iView, BOOL enableAnimate DEF_VAL(TRUE)) OVERRIDE;
257 STDMETHOD_(
void,
SetAniStyle)(THIS_ StackViewAniStyle aniStyle) OVERRIDE;
263 STDMETHOD_(
void,
SetAniDir)(THIS_ BOOL bVert) OVERRIDE;
269 STDMETHOD_(IWindow *,
GetSelPage)(CTHIS) SCONST OVERRIDE;
276 STDMETHOD_(IWindow *,
GetPage)(CTHIS_
int iPage) SCONST OVERRIDE;
284 STDMETHOD_(IWindow *,
GetIChild)(THIS_
int iChild) SCONST OVERRIDE;
312 STDMETHOD_(
void, onAnimationEnd)(THIS_ IValueAnimator *pAnimator) OVERRIDE;
316 ATTR_INT(L
"curSel",
m_iSel, FALSE)
318 ATTR_ENUM_BEGIN(L
"aniType", StackViewAniStyle, FALSE)
319 ATTR_ENUM_VALUE(L
"none", kAniNone)
320 ATTR_ENUM_VALUE(L
"fade", kFadeInOut)
321 ATTR_ENUM_VALUE(L
"move", kMoveInOut)
322 ATTR_ENUM_VALUE(L
"push", kPushInOut)
325 ATTR_CHAIN_CLASS(__baseCls)
340 void OnSize(UINT nType, CSize size);
Provides a simple timing engine for running animations which calculate animated values and set them o...
Smart pointer class for managing COM-style reference-counted objects.
BOOL IsVertAnimate() const
Checks if vertical animation is enabled.
StackViewAniStyle GetAnimateStyle() const
Gets the animation style.
StackViewAniStyle m_aniStyle
SStackPage()
Constructor for SStackPage.
A stack view that can contain multiple pages.
BOOL IsVertChildAnimate(int iChild) const
Checks if vertical animation is enabled for a child.
SIZE MeasureChildren(int nParentWid, int nParentHei) override
Measures the size of child windows.
IWindow * GetIChild(int iChild) SCONST OVERRIDE
Gets a child window by index.
void OnSize(UINT nType, CSize size)
Handles the size change of the window.
void OnDestroy()
Handles the destruction of the window.
SViewSwitchAnimator m_animator
IWindow * GetSelPage() SCONST OVERRIDE
Gets the selected page.
void BuildChildsArray(BOOL updateSel)
Builds the array of child windows.
BOOL SelectPage(int iView, BOOL enableAnimate=TRUE) OVERRIDE
Selects a page.
StackViewAniStyle GetChildAnimateStyle(int iChild) const
Gets the animation style of a child.
void onAnimationRepeat(IValueAnimator *pAnimator) OVERRIDE
Handles the repetition of an animation.
StackViewAniStyle m_aniStyle
BOOL CreateChildren(SXmlNode xmlNode) override
Creates child windows from an XML node.
SArray< SWindow * > m_childs
void OnContainerChanged(ISwndContainer *pOldContainer, ISwndContainer *pNewContainer) override
Handles the change of the container.
void OnAfterRemoveChild(SWindow *pChild) override
Handles the removal of a child window.
void onAnimationStart(IValueAnimator *pAnimator) OVERRIDE
Handles the start of an animation.
void SetAniStyle(StackViewAniStyle aniStyle) OVERRIDE
Sets the animation style.
void OnAfterInsertChild(SWindow *pChild) override
Handles the insertion of a child window.
SStackView(void)
Constructor for SStackView.
CSize GetChildSize(IWindow *pPage) const
Gets the size of a child window.
IWindow * GetPage(int iPage) SCONST OVERRIDE
Gets a page by index.
void SetAniDir(BOOL bVert) OVERRIDE
Sets the animation direction.
void UpdateChildrenPosition() OVERRIDE
Updates the positions of child windows.
StackViewAniStyle m_aniStyle
int GetTo() const
Gets the ending child index.
SViewSwitchAnimator(SStackView *pOwner)
Constructor for SViewSwitchAnimator.
void DisableOwnerResize()
Disables owner resize.
int GetFrom() const
Gets the starting child index.
TypeEvaluator< SIZE > m_evalOwnerSize
IValueAnimator * clone() SCONST OVERRIDE
Clones the animator.
void SetTo(int iChild)
Sets the ending child index.
void SetFrom(int iChild)
Sets the starting child index.
StackViewAniStyle GetAniStyle() const
Gets the animation style.
TypeEvaluator< RECT > m_evalRcTo
SAutoRefPtr< IWindow > m_pFrom
BOOL IsOwnerResize() const
Checks if owner resize is enabled.
SAutoRefPtr< IWindow > m_pTo
TypeEvaluator< BYTE > m_evalAlphaTo
Class representing an XML node.
TValueAnimator(float from, float to)
Template class for evaluating interpolated values between a start and end value.
SOUI Window Container Interface.