Tizen Native API
5.0
|
Abstracts class to define scroll axes. More...
Public Types | |
enum | RulerType |
Enumeration for the type of the ruler. More... | |
Public Member Functions | |
Ruler () | |
Constructs ruler, enabled by default, with limitless domain. | |
virtual float | Snap (float x, float bias=0.5f) const =0 |
Snaps (x) in accordance to the ruler settings. | |
virtual float | GetPositionFromPage (unsigned int page, unsigned int &volume, bool wrap) const =0 |
Returns position from page, based on whatever the ruler defines as a page. | |
virtual unsigned int | GetPageFromPosition (float position, bool wrap) const =0 |
Returns page from position, based on whatever the ruler defines as a page. | |
virtual unsigned int | GetTotalPages () const =0 |
Returns the total number of pages within this Ruler. | |
virtual RulerExtension * | GetExtension () |
Gets the extension interface of the Ruler. | |
Ruler::RulerType | GetType () const |
Gets the ruler type. | |
bool | IsEnabled () const |
Returns whether this axis has been enabled or not. | |
void | Enable () |
Enables ruler (ruler must be enabled in order to traverse along it). | |
void | Disable () |
Disables ruler. | |
void | SetDomain (RulerDomain domain) |
Sets the Domain. | |
const RulerDomain & | GetDomain () const |
Gets the Domain. | |
void | DisableDomain () |
Disables Domain (minimum/maximum extents for this axis). | |
float | Clamp (float x, float length=0.0f, float scale=1.0f) const |
Clamps value (x) from (min) to (max). | |
float | Clamp (float x, float length, float scale, ClampState &clamped) const |
Clamps value (x) from (min) to (max). | |
float | SnapAndClamp (float x, float bias=0.5f, float length=0.0f, float scale=1.0f) const |
Snaps and Clamps (x) in accordance to ruler settings. | |
float | SnapAndClamp (float x, float bias, float length, float scale, ClampState &clamped) const |
Snaps and Clamps (x) in accordance to ruler settings. | |
Protected Member Functions | |
virtual | ~Ruler () |
Destructor - A reference counted object may only be deleted by calling Unreference(). | |
Protected Attributes | |
RulerType | mType |
Type of Ruler (Fixed or Free). | |
bool | mEnabled |
If the ruler is enabled. | |
RulerDomain | mDomain |
The domain of the ruler. |
Abstracts class to define scroll axes.
It can specify whether they are traversable, where their snap points are and their domain.
Constructs ruler, enabled by default, with limitless domain.
virtual Dali::Toolkit::Ruler::~Ruler | ( | ) | [protected, virtual] |
Destructor - A reference counted object may only be deleted by calling Unreference().
float Dali::Toolkit::Ruler::Clamp | ( | float | x, |
float | length = 0.0f , |
||
float | scale = 1.0f |
||
) | const |
Clamps value (x) from (min) to (max).
An optional length parameter can be specified to suggest that the subject is not a point but a line that should be clamped.
[in] | x | X point to be clamped between (min) and (max) extents |
[in] | length | (optional) The Length of the line from (x) to (x + length) to be clamped |
[in] | scale | Scaling parameter which treats domain as scaled in calculations |
float Dali::Toolkit::Ruler::Clamp | ( | float | x, |
float | length, | ||
float | scale, | ||
ClampState & | clamped | ||
) | const |
Clamps value (x) from (min) to (max).
An optional length parameter can be specified to suggest that the subject is not a point but a line to that should be clamped.
[in] | x | X point to be clamped between (min) and (max) extents |
[in] | length | (optional) The Length of the line from (x) to (x + length) to be clamped |
[in] | scale | Scaling parameter which treats domain as scaled in calculations |
[out] | clamped | Whether clamping occurred and which size (None, Min or Max) |
void Dali::Toolkit::Ruler::Disable | ( | ) |
Disables ruler.
void Dali::Toolkit::Ruler::DisableDomain | ( | ) |
Disables Domain (minimum/maximum extents for this axis).
void Dali::Toolkit::Ruler::Enable | ( | ) |
Enables ruler (ruler must be enabled in order to traverse along it).
const RulerDomain& Dali::Toolkit::Ruler::GetDomain | ( | ) | const |
Gets the Domain.
virtual RulerExtension* Dali::Toolkit::Ruler::GetExtension | ( | ) | [virtual] |
virtual unsigned int Dali::Toolkit::Ruler::GetPageFromPosition | ( | float | position, |
bool | wrap | ||
) | const [pure virtual] |
Returns page from position, based on whatever the ruler defines as a page.
If (wrap) is true, then will return a page wrapped within the domain.
[in] | position | The position on the domain |
[in] | wrap | Enable wrap mode |
Implemented in Dali::Toolkit::FixedRuler, and Dali::Toolkit::DefaultRuler.
virtual float Dali::Toolkit::Ruler::GetPositionFromPage | ( | unsigned int | page, |
unsigned int & | volume, | ||
bool | wrap | ||
) | const [pure virtual] |
Returns position from page, based on whatever the ruler defines as a page.
If (wrap) is true, then will set volume to the number of times page has exceeded the domain's volume (volume being the number of pages within the domain), while wrapping the position within the domain.
[in] | page | The page index |
[out] | volume | The overflow volume when the page exceeds the domain (wrap must be enabled) |
[in] | wrap | Enable wrap mode |
Implemented in Dali::Toolkit::FixedRuler, and Dali::Toolkit::DefaultRuler.
virtual unsigned int Dali::Toolkit::Ruler::GetTotalPages | ( | ) | const [pure virtual] |
Returns the total number of pages within this Ruler.
Implemented in Dali::Toolkit::FixedRuler, and Dali::Toolkit::DefaultRuler.
Gets the ruler type.
bool Dali::Toolkit::Ruler::IsEnabled | ( | ) | const |
Returns whether this axis has been enabled or not.
void Dali::Toolkit::Ruler::SetDomain | ( | RulerDomain | domain | ) |
virtual float Dali::Toolkit::Ruler::Snap | ( | float | x, |
float | bias = 0.5f |
||
) | const [pure virtual] |
Snaps (x) in accordance to the ruler settings.
[in] | x | The input value on the ruler to be snapped |
[in] | bias | (optional) The biasing employed for snapping 0 floor input (floor x) "Used for Flick Left" 0.5 round input (floor x + 0.5) "Used for Release" 1 ceil input (floor x + 1.0) "Used for Flick Right" |
Implemented in Dali::Toolkit::FixedRuler, and Dali::Toolkit::DefaultRuler.
float Dali::Toolkit::Ruler::SnapAndClamp | ( | float | x, |
float | bias = 0.5f , |
||
float | length = 0.0f , |
||
float | scale = 1.0f |
||
) | const |
Snaps and Clamps (x) in accordance to ruler settings.
[in] | x | X value to be snapped in accordance to ruler snap value, and clamped in accordance to the ruler's domain (if set) |
[in] | bias | (optional) The biasing employed for snapping 0 floor input (floor x) "Used for Flick Left" 0.5 round input (floor x + 0.5) "Used for Release" 1 ceil input (floor x + 1.0) "Used for Flick Right" |
[in] | length | (optional) The Length of the line from (x) to (x + length) to be clamped |
[in] | scale | Scaling parameter which treats domain as scaled in calculations |
float Dali::Toolkit::Ruler::SnapAndClamp | ( | float | x, |
float | bias, | ||
float | length, | ||
float | scale, | ||
ClampState & | clamped | ||
) | const |
Snaps and Clamps (x) in accordance to ruler settings.
[in] | x | X value to be snapped in accordance to ruler snap value, and clamped in accordance to the ruler's domain (if set) |
[in] | bias | (optional) The biasing employed for snapping 0 floor input (floor x) "Used for Flick Left" 0.5 round input (floor x + 0.5) "Used for Release" 1 ceil input (floor x + 1.0) "Used for Flick Right" |
[in] | length | (optional) The Length of the line from (x) to (x + length) to be clamped |
[in] | scale | Scaling parameter which treats domain as scaled in calculations |
[out] | clamped | Whether clamping occurred and which size (None, Min or Max) |