Tizen Native API  5.0

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
 Enumeration for different types of alignment. More...
enum  Scaling
 Scaling determines how actors are scaled to match the alignment's boundary. More...

Public Member Functions

 Alignment ()
 Creates an Alignment handle; this can be initialized 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
 Gets 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)
 Sets a padding value.
const PaddingGetPadding () const
 Gets 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)
 Downcasts a handle to Alignment handle.

Detailed Description

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

Additionally, it provides a scaling property to resize the contained actors

See also:
Scaling.
Since:
2.4, DALi version 1.0.0
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, DALi version 1.0.0
Enumerator:
ScaleNone 

The original size is kept.

Since:
2.4, DALi version 1.0.0
ScaleToFill 

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

Since:
2.4, DALi version 1.0.0
ScaleToFitKeepAspect 

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

Since:
2.4, DALi version 1.0.0
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, DALi version 1.0.0
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, DALi version 1.0.0
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, DALi version 1.0.0

Enumeration for different types of alignment.

Since:
2.4, DALi version 1.0.0
Enumerator:
HorizontalLeft 

Horizontal left alignment.

Since:
2.4, DALi version 1.0.0
HorizontalCenter 

Horizontal center alignment.

Since:
2.4, DALi version 1.0.0
HorizontalRight 

Horizontal right alignment.

Since:
2.4, DALi version 1.0.0
VerticalTop 

Vertical top alignment.

Since:
2.4, DALi version 1.0.0
VerticalCenter 

Vertical center alignment.

Since:
2.4, DALi version 1.0.0
VerticalBottom 

Vertical bottom alignment.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Creates an Alignment handle; this can be initialized with Alignment::New().

Calling member functions with an uninitialized handle is not allowed.

Since:
2.4, DALi version 1.0.0

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

Since:
2.4, DALi version 1.0.0
Parameters:
[in]alignmentObject to copy

Destructor.

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

Since:
2.4, DALi version 1.0.0

Member Function Documentation

Downcasts a handle to Alignment handle.

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

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

Reimplemented from Dali::Toolkit::Control.

Gets 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, DALi version 1.0.0
Returns:
the alignment value

Gets the padding values.

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

Retrieves the scaling property.

Since:
2.4, DALi version 1.0.0
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, DALi version 1.0.0
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, DALi version 1.0.0
Parameters:
[in]alignmentObject to copy
Returns:
A reference to this

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

Since:
2.4, DALi version 1.0.0
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)

Sets a padding value.

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

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

Since:
2.4, DALi version 1.0.0
Parameters:
[in]scalingThe scaling property
See also:
Scaling.