Tizen Native API

Alignment is a container which provides an easy way to align other actors inside its boundary. More...

Inheritance diagram for Dali::Toolkit::Alignment:
Dali::Toolkit::Control Dali::CustomActor Dali::Actor Dali::Handle Dali::BaseHandle

Classes

struct  Padding
 Structure describing the padding values. More...

Public Types

enum  Type
 Different types of alignment. More...
enum  Scaling
 Scaling determines how actors are scaled, to match the alignment's boundary. More...

Public Member Functions

 Alignment ()
 Create an Alignment handle; this can be initialised with Alignment::New().
 Alignment (const Alignment &alignment)
 Copy constructor. Creates another handle that points to the same real object.
 ~Alignment ()
 Destructor.
void SetAlignmentType (Type type)
 Sets the new alignment. By default ( HorizontalCenter | VerticalCenter ).
Type GetAlignmentType () const
 Get the current alignment combined into a single value.
void SetScaling (Scaling scaling)
 Sets how added actors scale to fit the alignment's boundary.
Scaling GetScaling () const
 Retrieves the scaling property.
void SetPadding (const Padding &padding)
 Set a padding value.
const PaddingGetPadding () const
 Get the padding values.
Alignmentoperator= (const Alignment &alignment)
 Assignment operator.

Static Public Member Functions

static Alignment New (Type horizontal=HorizontalCenter, Type vertical=VerticalCenter)
 Creates an alignment control.
static Alignment DownCast (BaseHandle handle)
 Downcast a handle to Alignment handle.

Detailed Description

Alignment is a container which provides an easy way to align other actors inside its boundary.

Additionaly it provides a scaling property to resize the contained actors

See also:
Scaling.
Since :
2.4
Note:
The use of scaling property will override all constraints applied to actors.

All actors added to an alignment are going to be set with the same anchor point and parent origin. And, if the scaling property is set to a value different than ScaleNone, constraints as well.


Member Enumeration Documentation

Scaling determines how actors are scaled, to match the alignment's boundary.

Since :
2.4
Enumerator:
ScaleNone 

The original size is kept.

Since :
2.4
ScaleToFill 

Scale added actors to fill alignment's boundary. Aspect ratio is not maintained.

Since :
2.4
ScaleToFitKeepAspect 

Scale added actors to fit within the alignment's boundary. Aspect ratio is maintained.

Since :
2.4
ScaleToFillKeepAspect 

Scale added actors to fill the alignment's boundary. Aspect ratio is maintained, and the actor may exceed the alignment's boundary.

Since :
2.4
ShrinkToFit 

If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is not maintained.

Since :
2.4
ShrinkToFitKeepAspect 

If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is maintained.

Since :
2.4

Different types of alignment.

Since :
2.4
Enumerator:
HorizontalLeft 

Horizontal left alignment.

Since :
2.4
HorizontalCenter 

Horizontal center alignment.

Since :
2.4
HorizontalRight 

Horizontal right alignment.

Since :
2.4
VerticalTop 

Vertical top alignment.

Since :
2.4
VerticalCenter 

Vertical center alignment.

Since :
2.4
VerticalBottom 

Vertical bottom alignment.

Since :
2.4

Constructor & Destructor Documentation

Create an Alignment handle; this can be initialised with Alignment::New().

Calling member functions with an uninitialised handle is not allowed.

Since :
2.4

Copy constructor. Creates another handle that points to the same real object.

Since :
2.4
Parameters:
[in]alignmentObject to copy

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since :
2.4

Member Function Documentation

Downcast a handle to Alignment handle.

If handle points to a Alignment the downcast produces valid handle. If not the returned handle is left uninitialized.

Since :
2.4
Parameters:
[in]handleHandle to an object
Returns:
A handle to a Alignment or an uninitialized handle

Reimplemented from Dali::Toolkit::Control.

Get the current alignment combined into a single value.

The values can be tested by using the & operator and the desired flag. e.g.

   if (GetAlignmentType() & HorizontalCentre)
   {
     ...
   }
Since :
2.4
Returns:
The alignment value

Get the padding values.

Since :
2.4
Returns:
The left, right, top, bottom padding values

Retrieves the scaling property.

Since :
2.4
Returns:
The scaling
See also:
Scaling.
static Alignment Dali::Toolkit::Alignment::New ( Type  horizontal = HorizontalCenter,
Type  vertical = VerticalCenter 
) [static]

Creates an alignment control.

Since :
2.4
Parameters:
[in]horizontalSpecifies how to align actors horizontally. Could be HorizontalLeft, HorizontalCenter or HorizontalRight. By default HorizontalCenter.
[in]verticalSpecifies how to align actors vertically. Could be VerticalTop, VerticalCenter or VerticalBottom. By default VerticalCenter.
Returns:
A handle to the Alignment control
Alignment& Dali::Toolkit::Alignment::operator= ( const Alignment alignment)

Assignment operator.

Changes this handle to point to another real object.

Since :
2.4
Parameters:
[in]alignmentObject to copy
Returns:
A reference to this

Sets the new alignment. By default ( HorizontalCenter | VerticalCenter ).

Since :
2.4
Parameters:
[in]typeThe new alignment option
Note:
There should only be one horizontal and one vertical policy.
void Dali::Toolkit::Alignment::SetPadding ( const Padding padding)

Set a padding value.

Since :
2.4
Parameters:
[in]paddingThe left, right, top, bottom padding values

Sets how added actors scale to fit the alignment's boundary.

Since :
2.4
Parameters:
[in]scalingThe scaling property
See also:
Scaling.