Tizen(Headed) Native API
6.5
|
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. |
Detailed Description
Abstracts class to define scroll axes.
It can specify whether they are traversable, where their snap points are and their domain.
- Since:
- 2.4, DALi version 1.0.0
Member Enumeration Documentation
Constructor & Destructor Documentation
Constructs ruler, enabled by default, with limitless domain.
- Since:
- 2.4, DALi version 1.0.0
virtual Dali::Toolkit::Ruler::~Ruler | ( | ) | [protected, virtual] |
Destructor - A reference counted object may only be deleted by calling Unreference().
- Since:
- 2.4, DALi version 1.0.0
Member Function Documentation
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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
- Returns:
- The clamped value
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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)
- Returns:
- The clamped value
void Dali::Toolkit::Ruler::Disable | ( | ) |
Disables ruler.
- Since:
- 2.4, DALi version 1.0.0
void Dali::Toolkit::Ruler::DisableDomain | ( | ) |
Disables Domain (minimum/maximum extents for this axis).
- Since:
- 2.4, DALi version 1.0.0
void Dali::Toolkit::Ruler::Enable | ( | ) |
Enables ruler (ruler must be enabled in order to traverse along it).
- Since:
- 2.4, DALi version 1.0.0
const RulerDomain& Dali::Toolkit::Ruler::GetDomain | ( | ) | const |
Gets the Domain.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- 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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] position The position on the domain [in] wrap Enable wrap mode
- Returns:
- The page where this position resides
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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
- Returns:
- The position representing this page point
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.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- The number of pages in the Ruler
Implemented in Dali::Toolkit::FixedRuler, and Dali::Toolkit::DefaultRuler.
Gets the ruler type.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- The ruler type
bool Dali::Toolkit::Ruler::IsEnabled | ( | ) | const |
Returns whether this axis has been enabled or not.
- Since:
- 2.4, DALi version 1.0.0
- Returns:
- true if axis is enabled
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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"
- Returns:
- The position of the one dimensional point passed in once snapped.
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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
- Returns:
- The clamped value after snapping
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.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[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)
- Returns:
- The clamped value after snapping