1 #ifndef __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__
2 #define __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <dali-toolkit/public-api/controls/control-impl.h>
22 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
36 * Alignment is a control to position and resize actors inside other container actors.
37 * @see Dali::Toolkit::Alignment for more details.
39 class Alignment : public Control
44 * Create an initialized Alignment.
45 * @param type Type of alignment.
46 * @return A handle to a newly allocated Dali resource.
48 static Toolkit::Alignment New( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
51 * @copydoc Dali::Toolkit::Alignment::SetAlignmentType()
53 void SetAlignmentType( Toolkit::Alignment::Type type );
56 * @copydoc Dali::Toolkit::Alignment::GetAlignmentType()
58 Toolkit::Alignment::Type GetAlignmentType() const;
61 * @copydoc Dali::Toolkit::Alignment::SetScaling()
63 void SetScaling( Toolkit::Alignment::Scaling scaling );
66 * @copydoc Dali::Toolkit::Alignment::GetScaling()
68 Toolkit::Alignment::Scaling GetScaling() const;
71 * @copydoc Dali::Toolkit::Alignment::SetPadding()
73 void SetPadding( const Toolkit::Alignment::Padding& padding );
76 * @copydoc Dali::Toolkit::Alignment::GetPadding()
78 const Toolkit::Alignment::Padding& GetPadding() const;
81 private: // From Control
84 * @copydoc Control::OnRelaidOut()
86 virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container );
92 * It initializes Alignment members.
94 Alignment( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
97 * A reference counted object may only be deleted by calling Unreference()
104 Alignment(const Alignment&);
105 Alignment& operator=(const Alignment&);
108 Toolkit::Alignment::Type mHorizontal; ///< Type of alignment.
109 Toolkit::Alignment::Type mVertical; ///< Type of alignment.
110 Toolkit::Alignment::Scaling mScaling; ///< Stores the geometry scaling.
111 Toolkit::Alignment::Padding mPadding; ///< Stores the padding values.
114 } // namespace Internal
117 // Helpers for public-api forwarding methods
119 inline Toolkit::Internal::Alignment& GetImpl( Toolkit::Alignment& alignment )
121 DALI_ASSERT_ALWAYS( alignment );
123 Dali::RefObject& handle = alignment.GetImplementation();
125 return static_cast<Toolkit::Internal::Alignment&>( handle );
128 inline const Toolkit::Internal::Alignment& GetImpl( const Toolkit::Alignment& alignment )
130 DALI_ASSERT_ALWAYS( alignment );
132 const Dali::RefObject& handle = alignment.GetImplementation();
134 return static_cast<const Toolkit::Internal::Alignment&>( handle );
137 } // namespace Toolkit
141 #endif // __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__