Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / ui / FUi_VerticalBoxLayoutImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FUi_VerticalBoxLayoutImpl.h
19  * @brief       This is the header file for _VerticalBoxLayoutImpl class.
20  *
21  * This header file contains the declaration of _VerticalBoxLayoutImpl class.
22  */
23
24 #ifndef _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H
25 #define _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H
26
27 #include <FUiVerticalBoxLayout.h>
28 #include "FUi_LayoutImpl.h"
29 #include "FUi_LayoutLinearLayout.h"
30
31 namespace Tizen { namespace Ui
32 {
33
34 class VerticalBoxLayout;
35
36 class _VerticalBoxLayoutImpl
37         : public _LayoutImpl
38 {
39 public:
40         /**
41          * This is the destructor for this class.
42          *
43          * @since               2.0
44          */
45         virtual ~_VerticalBoxLayoutImpl(void);
46
47         /**
48          * Creates the instance of _VerticalBoxLayoutImpl.
49          *
50          * @since 2.0
51          * @return              The instance of _VerticalBoxLayoutImpl.
52          * @param[in]   pPublicLayout   The public class of vertical box layout.
53          * @param[in]   direction               The direction of vertical box layout.
54          * @exception   E_SUCCESS               The method was successful.
55          * @exception   E_OUT_OF_MEMORY Insufficient memory.
56          */
57         static _VerticalBoxLayoutImpl* CreateVerticalBoxLayoutImplN(VerticalBoxLayout* pPublicLayout, VerticalDirection direction = VERTICAL_DIRECTION_DOWNWARD);
58
59         /**
60          * Gets the name of public class.
61          *
62          * @since 2.0
63          * @return              The name of public class.
64          */
65         virtual const char* GetPublicClassName(void) const;
66
67         /**
68          * Gets the public class.
69          *
70          * @since 2.0
71          * @return              The public class.
72          */
73         virtual const VerticalBoxLayout& GetPublic(void) const;
74
75         /**
76          * Gets the public class.
77          *
78          * @since 2.0
79          * @return              The public class.
80          */
81         virtual VerticalBoxLayout& GetPublic(void);
82
83         /**
84          * Gets the public class.
85          *
86          * @since 2.0
87          * @return              The public class.
88          */
89         virtual const _Layout::LinearLayout& GetCore(void) const;
90
91         /**
92          * Gets the public class.
93          *
94          * @since 2.0
95          * @return              The public class.
96          */
97         virtual _Layout::LinearLayout& GetCore(void);
98
99         /**
100          * Gets the _VerticalBoxLayoutImpl instance for the VerticalBoxLayout.
101          *
102          * @since 2.0
103          * @return              The _VerticalBoxLayoutImpl instance.
104          * @param[in]   pLayout         The VerticalBoxLayout instance.
105          */
106         static const _VerticalBoxLayoutImpl* GetInstance(const VerticalBoxLayout& layout);
107
108         /**
109          * Gets the _VerticalBoxLayoutImpl instance for the VerticalBoxLayout.
110          *
111          * @since 2.0
112          * @return              The _VerticalBoxLayoutImpl instance.
113          * @param[in]   pLayout         The VerticalBoxLayout instance.
114          */
115         static _VerticalBoxLayoutImpl* GetInstance(VerticalBoxLayout& layout);
116
117         /**
118          * Gets the direction of the VerticalBoxLayout.
119          *
120          * @since               2.0
121          * @return              An error code
122          * @param[out]  direction               The direction in which the children are attached
123          * @exception   E_SUCCESS               The method was successful.
124          * @exception   E_INVALID_STATE This instance is in an invalid state.
125          */
126         result GetDirection(VerticalDirection& direction) const;
127
128         /**
129          * Sets the horizontal alignment of the specified control.
130          *
131          * @since               2.0
132          * @return              An error code
133          * @param[in]   control                 The control for which the alignment is set
134          * @param[in]   alignment               The horizontal alignment
135          * @exception   E_SUCCESS               The method was successful.
136          * @exception   E_INVALID_STATE This instance is in an invalid state.
137          * @exception   E_INVALID_ARG   The alignment parameter is invalid.
138          */
139         result SetHorizontalAlignment(_ControlImpl& control, LayoutHorizontalAlignment horAlign);
140
141         /**
142          * Sets the space between the specified control and its predecessor.
143          *
144          * @since               2.0
145          * @return              An error code
146          * @param[in]   control                 The control for which the space is set
147          * @param[in]   space                   The space
148          * @exception   E_SUCCESS               The method was successful.
149          * @exception   E_INVALID_ARG   The specified input parameter is invalid.
150          * @exception   E_INVALID_STATE This instance is in an invalid state.
151          */
152         result SetSpacing(_ControlImpl& control, int space);
153
154         /**
155          * Sets the horizontal margins of the specified control.
156          *
157          * @since               2.0
158          * @return              An error code
159          * @param[in]   control                 The control for which the margins are set
160          * @param[in]   top                             The top margin
161          * @param[in]   bottom                  The bottom margin
162          * @exception   E_SUCCESS               The method was successful.
163          * @exception   E_INVALID_STATE This instance is in an invalid state.
164          */
165         result SetHorizontalMargin(_ControlImpl& control, int left, int right);
166
167         /**
168          * Sets the width of the specified control with the fixed length.
169          *
170          * @since               2.0
171          * @return              An error code
172          * @param[in]   control                 The control for which the width is set
173          * @param[in]   virWidth            This is not used.
174          * @param[in]   phyWidth                The value of the width
175          * @exception   E_SUCCESS               The method was successful.
176          * @exception   E_INVALID_STATE This instance is in an invalid state.
177          */
178         result SetWidth(_ControlImpl& control, int width);
179
180         /**
181          * Sets the width of the specified control with the fitting policy.
182          *
183          * @since               2.0
184          * @return              An error code
185          * @param[in]   control                 The control for which the width is set
186          * @param[in]   policy                  The fitting policy for the width
187          * @exception   E_SUCCESS               The method was successful.
188          * @exception   E_INVALID_STATE This instance is in an invalid state.
189          */
190         result SetItemHorizontalFitPolicy(_ControlImpl& control, FitPolicy policy);
191
192         /**
193          * Sets the height of the specified control with fixed length.
194          *
195          * @since               2.0
196          * @return              An error code
197          * @param[in]   control                 The control for which the height is set
198          * @param[in]   virHeight               This is not used.
199          * @param[in]   phyHeight               The value of the height
200          * @exception   E_SUCCESS               The method was successful.
201          * @exception   E_INVALID_STATE This instance is in an invalid state.
202          */
203         result SetHeight(_ControlImpl& control, int height);
204
205         /**
206          * Sets the height of the specified control with the fitting policy.
207          *
208          * @since               2.0
209          * @return              An error code
210          * @param[in]   control                 The control for which the height is set
211          * @param[in]   policy                  The fitting policy for the height
212          * @exception   E_SUCCESS               The method was successful.
213          * @exception   E_INVALID_STATE This instance is in an invalid state.
214          */
215         result SetItemVerticalFitPolicy(_ControlImpl& control, FitPolicy policy);
216
217         /**
218          * Sets the weight of the specified control.
219          *
220          * @since               2.0
221          * @return              An error code
222          * @param[in]   control                 The control for which the weight is set
223          * @param[in]   weight                  The weight that indicates how much extra space the control occupies
224          *                              in proportion to it, in the HorizontalBoxLayout.
225          * @exception   E_SUCCESS               The method was successful.
226          * @exception   E_INVALID_ARG   The specified input parameter is invalid.
227          * @exception   E_INVALID_STATE This instance is in an invalid state.
228          */
229         result SetWeight(_ControlImpl& control, float weight);
230
231         /**
232          * Gets the type of the layout.
233          *
234          * @since               2.0
235          * @return      The layout type
236          */
237         virtual LayoutType GetLayoutType(void) const;
238
239 protected:
240         /**
241          * This is the default constructor for this class.
242          *
243          * @since               2.0
244          */
245         _VerticalBoxLayoutImpl(VerticalBoxLayout* pPublicLayout, _Layout::LinearLayout* pCoreLayout);
246
247 private:
248         /**
249          * This is the copy constructor for this class.
250          *
251          * @since       2.0
252          */
253         _VerticalBoxLayoutImpl(const _VerticalBoxLayoutImpl&);
254
255         /**
256          * This is the substitution operator for this class.
257          *
258          * @since       2.0
259          */
260         _VerticalBoxLayoutImpl& operator =(const _VerticalBoxLayoutImpl&);
261
262         /**
263          * Initializes this instance of _VerticalBoxLayoutImpl with the specified parameters.
264          *
265          * @since               2.0
266          * @return              An error code
267          * @param[in]   direction                       The direction of vertical box layout.
268          * @exception   E_SUCCESS                       The method was successful.
269          * @exception   E_INVALID_STATE         This instance is in an invalid state.
270          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
271          * @exception   E_SYSTEM                        A system error occurred.
272          */
273         result Construct(VerticalDirection direction);
274 }; // _VerticalBoxLayoutImpl
275
276 }} // Tizen::Ui
277
278 #endif // _FUI_INTERNAL_VERTICAL_BOX_LAYOUT_IMPL_H