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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali-toolkit/public-api/controls/control-impl.h>
23 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
37 * Alignment is a control to position and resize actors inside other container actors.
38 * @see Dali::Toolkit::Alignment for more details.
40 class Alignment : public Control
45 * Create an initialized Alignment.
46 * @param type Type of alignment.
47 * @return A handle to a newly allocated Dali resource.
49 static Toolkit::Alignment New( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
52 * @copydoc Dali::Toolkit::Alignment::SetAlignmentType()
54 void SetAlignmentType( Toolkit::Alignment::Type type );
57 * @copydoc Dali::Toolkit::Alignment::GetAlignmentType()
59 Toolkit::Alignment::Type GetAlignmentType() const;
62 * @copydoc Dali::Toolkit::Alignment::SetScaling()
64 void SetScaling( Toolkit::Alignment::Scaling scaling );
67 * @copydoc Dali::Toolkit::Alignment::GetScaling()
69 Toolkit::Alignment::Scaling GetScaling() const;
72 * @copydoc Dali::Toolkit::Alignment::SetPadding()
74 void SetPadding( const Toolkit::Alignment::Padding& padding );
77 * @copydoc Dali::Toolkit::Alignment::GetPadding()
79 const Toolkit::Alignment::Padding& GetPadding() const;
82 private: // From Control
85 * @copydoc Control::OnRelayout()
87 virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
93 * It initializes Alignment members.
95 Alignment( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
98 * A reference counted object may only be deleted by calling Unreference()
100 virtual ~Alignment();
105 Alignment(const Alignment&);
106 Alignment& operator=(const Alignment&);
109 Toolkit::Alignment::Type mHorizontal; ///< Type of alignment.
110 Toolkit::Alignment::Type mVertical; ///< Type of alignment.
111 Toolkit::Alignment::Scaling mScaling; ///< Stores the geometry scaling.
112 Toolkit::Alignment::Padding mPadding; ///< Stores the padding values.
115 } // namespace Internal
118 // Helpers for public-api forwarding methods
120 inline Toolkit::Internal::Alignment& GetImpl( Toolkit::Alignment& alignment )
122 DALI_ASSERT_ALWAYS( alignment );
124 Dali::RefObject& handle = alignment.GetImplementation();
126 return static_cast<Toolkit::Internal::Alignment&>( handle );
129 inline const Toolkit::Internal::Alignment& GetImpl( const Toolkit::Alignment& alignment )
131 DALI_ASSERT_ALWAYS( alignment );
133 const Dali::RefObject& handle = alignment.GetImplementation();
135 return static_cast<const Toolkit::Internal::Alignment&>( handle );
138 } // namespace Toolkit
142 #endif // __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__