remove (dead) ImageView UI control
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / alignment / alignment-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__
2 #define __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control-impl.h>
23 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 class Alignment;
32
33 namespace Internal
34 {
35
36 /**
37  * Alignment is a control to position and resize actors inside other container actors.
38  * @see Dali::Toolkit::Alignment for more details.
39  */
40 class Alignment : public Control
41 {
42 public:
43
44   /**
45    * Create an initialized Alignment.
46    * @param type Type of alignment.
47    * @return A handle to a newly allocated Dali resource.
48    */
49   static Toolkit::Alignment New( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
50
51   /**
52    * @copydoc Dali::Toolkit::Alignment::SetAlignmentType()
53    */
54   void SetAlignmentType( Toolkit::Alignment::Type type );
55
56   /**
57    * @copydoc Dali::Toolkit::Alignment::GetAlignmentType()
58    */
59   Toolkit::Alignment::Type GetAlignmentType() const;
60
61   /**
62    * @copydoc Dali::Toolkit::Alignment::SetScaling()
63    */
64   void SetScaling( Toolkit::Alignment::Scaling scaling );
65
66   /**
67    * @copydoc Dali::Toolkit::Alignment::GetScaling()
68    */
69   Toolkit::Alignment::Scaling GetScaling() const;
70
71   /**
72    * @copydoc Dali::Toolkit::Alignment::SetPadding()
73    */
74   void SetPadding( const Toolkit::Alignment::Padding& padding );
75
76   /**
77    * @copydoc Dali::Toolkit::Alignment::GetPadding()
78    */
79   const Toolkit::Alignment::Padding& GetPadding() const;
80
81
82 private: // From Control
83
84   /**
85    * @copydoc Control::OnRelayout()
86    */
87   virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
88
89 private:
90
91   /**
92    * Constructor.
93    * It initializes Alignment members.
94    */
95   Alignment( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical );
96
97   /**
98    * A reference counted object may only be deleted by calling Unreference()
99    */
100   virtual ~Alignment();
101
102 private:
103
104   // Undefined
105   Alignment(const Alignment&);
106   Alignment& operator=(const Alignment&);
107
108 private:
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.
113 };
114
115 } // namespace Internal
116
117
118 // Helpers for public-api forwarding methods
119
120 inline Toolkit::Internal::Alignment& GetImpl( Toolkit::Alignment& alignment )
121 {
122   DALI_ASSERT_ALWAYS( alignment );
123
124   Dali::RefObject& handle = alignment.GetImplementation();
125
126   return static_cast<Toolkit::Internal::Alignment&>( handle );
127 }
128
129 inline const Toolkit::Internal::Alignment& GetImpl( const Toolkit::Alignment& alignment )
130 {
131   DALI_ASSERT_ALWAYS( alignment );
132
133   const Dali::RefObject& handle = alignment.GetImplementation();
134
135   return static_cast<const Toolkit::Internal::Alignment&>( handle );
136 }
137
138 } // namespace Toolkit
139
140 } // namespace Dali
141
142 #endif // __DALI_TOOLKIT_INTERNAL_ALIGNMENT_H__