Adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiContainer.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 /**
19  * @file        FUiContainer.h
20  * @brief       This is the header file for the %Container class.
21  *
22  * This header file contains the declarations of the %Container class.
23  */
24
25 #ifndef _FUI_CONTAINER_H_
26 #define _FUI_CONTAINER_H_
27
28 #include <FBaseTypes.h>
29 #include <FBaseColLinkedList.h>
30 #include <FUiControl.h>
31
32 namespace Tizen { namespace Ui {
33
34 class Layout;
35 class _ContainerImpl;
36
37 /**
38  * @class       Container
39  * @brief       This class is an abstract base class of all the generic containers of Controls.
40  *
41  * @since       2.0
42  *
43  * @remarks As the %Container is an abstract class, use the Tizen::Ui::Controls::Panel class or another class derived from
44  * %Container to apply the container functionality.
45  *
46  * The %Container class is the abstract base class of all generic Control containers. A container is a UI element which can contain
47  * other UI elements.
48  *
49  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/containers.htm">Containers</a>.
50  *
51
52  *
53  */
54 class _OSP_EXPORT_ Container
55         : public Control
56 {
57
58 public:
59         /**
60          * This destructor overrides Tizen::Base::Object::~Object().
61          *
62          * @since       2.0
63          */
64         virtual ~Container(void) = 0;
65
66 public:
67         /**
68          * Adds the control at the end of the list maintained by the container.
69          *
70          * @brief       <i> [Deprecated] </i>
71          * @deprecated  This API is deprecated.
72          * @since                       2.0
73          *
74          * @return              An error code
75          * @param[in]   control         The control to add to the container
76          * @exception   E_SUCCESS       The method is successful.
77          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
78          *                              The specified @c control is an instance of Window, or this control's parent container.
79          * @exception   E_MAX_EXCEEDED  The number of child controls has exceeded the maximum limit.
80          * @exception   E_SYSTEM        A system error has occurred.
81          * @remarks             When the control is added, it is placed at the top of the drawing stack maintained by the container.@n
82          *              This means the last control added is drawn last
83          * @remarks             A control becomes displayable only after it has been added to a displayable container. Some methods may not work normally if the methods
84          *                              of the control are called before adding the control to a container. After the control is added to a %Container, the OnInitializing()
85          *                              method of the control are called before adding the control to a container. After the control is added to a %Container, the
86          *                              OnInitializing() method of the control is invoked for the initialization of the control such as creating and adding child controls.
87          * @see                 Tizen::Ui::Control::OnInitializing()
88          * @see                 Tizen::Ui::Control::OnTerminating()
89          * @code
90          *      {
91          *              // Uses Panel instead of Container, because Container is an abstract class.
92          *              Panel* pPanel = new Panel();
93          *              pPanel->Construct(Rectangle(100, 250, 300, 300));
94          *
95          *              Form* pForm = new Form();
96          *              pForm->Construct(FORM_STYLE_NORMAL|FORM_STYLE_TITLE|FORM_STYLE_INDICATOR);
97          *              pForm->AddControl(*pPanel);
98          *
99          *              //...
100          *              pForm->Invalidate(true);
101          *              //...
102          *      }
103          * @endcode
104          */
105         result AddControl(const Control& control);
106
107         /**
108          * Adds the control at the end of the list maintained by the container.
109          *
110          * @since                              2.1
111          *
112          * @return        An error code
113          * @param[in]    control         The control to add to the container
114          * @param[in]    pControl         Pointer of the control to be added to the container
115          * @exception    E_SUCCESS       The method is successful.
116          * @exception    E_INVALID_ARG   The specified @c pControl is null.
117          *                              The specified @c control is an instance of Window, or this control's parent container.
118          * @exception    E_MAX_EXCEEDED          The number of child controls has exceeded the maximum limit.
119          * @exception    E_INVALID_ARG
120          * @exception    E_SYSTEM        A system error has occurred.
121          * @remarks                When the control is added, it is placed at the top of the drawing stack maintained by the container.@n
122          *              This means the last control added is drawn last
123          * @remarks                A control becomes displayable only after it has been added to a displayable container. Some methods may not work normally if the methods
124          *                                        of the control are called before adding the control to a container. After the control is added to a %Container, the OnInitializing()
125          *                                        method of the control are called before adding the control to a container. After the control is added to a %Container, the
126          *                                        OnInitializing() method of the control is invoked for the initialization of the control such as creating and adding child controls.
127          * @see                      Tizen::Ui::Control::OnInitializing()
128          * @see                      Tizen::Ui::Control::OnTerminating()
129          * @code
130          *        {
131          *                   // Uses Panel instead of Container, because Container is an abstract class.
132          *                   Panel* pPanel = new Panel();
133          *                   pPanel->Construct(Rectangle(100, 250, 300, 300));
134          *
135          *                   Form* pForm = new Form();
136          *                   pForm->Construct(FORM_STYLE_NORMAL|FORM_STYLE_TITLE|FORM_STYLE_INDICATOR);
137          *                   pForm->AddControl(pPanel);
138          *
139          *                   //...
140          *                   pForm->Invalidate(true);
141          *                   //...
142          *        }
143          * @endcode
144          */
145         result AddControl(Control* pControl);
146
147         /**
148          * Before the system calls OnDraw() method to allow the user to do custom drawing, this method is called to clear the canvas. The user can override this method to change this default behavior.
149          *
150          * @since 2.0
151          *
152          * @see         GetCanvasN()
153          */
154         virtual void OnClearBackground(void);
155
156         /**
157          * Called when the container needs to draw itself. @n
158          * Users can override this method to display user-specific drawings. @n
159          * This method is called after the container has drawn itself, but just before the container draws its child controls.
160          *
161          * @if OSPCOMPAT
162          * @brief <i> [Compatibility] </i>
163          * @endif
164          * @since                              2.0
165          *
166          * @if OSPCOMPAT
167          * @compatibility This method has compatibility issues with OSP compatible applications. @n
168          *                       For more information, see @ref CompOnDrawPage "here".
169          * @endif
170          *
171          * @return                  An error code
172          * @exception    E_SUCCESS        The method is successful.
173          * @exception    E_SYSTEM         A system error has occurred.
174          */
175         virtual result OnDraw(void);
176
177         /**
178          * @if OSPCOMPAT
179          * @page               CompOnDrawPage        Compatibility for OnDraw()
180          * @section            CompOnDrawPageIssueSection          Issues
181          * Implementing this method in OSP compatible applications has the following issues:   @n
182          * -# The platform draws the control by calling the parent's OnDraw() callback before invoking the control's OnDraw() callback. So, the users can't control the control's drawing behavior by overriding the OnDraw() callback.
183          *
184          * @section            CompOnDrawPageSolutionSection               Resolutions
185          * This issue has been resolved in Tizen.  @n
186          * -# The platform does not call the parent's OnDraw() callback before invoking the control's OnDraw() callback. Therefore, you needs to call   the parent container's OnDraw() callback in the OnDraw() callback if you override this method.
187          * @endif
188          */
189
190         /**
191          * Called to notify that the control's show state is changing.
192          *
193          * @since       2.0
194          *
195          * @param[in]   showState  The new show state of the control
196          * @see         Tizen::Ui::Control::SetShowState()
197          */
198         virtual void OnShowStateChanging(bool showState);
199
200         /**
201          * Called to notify that the control's show state is changed.
202          *
203          * @since       2.0
204          *
205          * @param[in]   showState  The new show state of the control
206          * @see         Tizen::Ui::Control::SetShowState()
207          */
208         virtual void OnShowStateChanged(bool showState);
209
210         /**
211          * Called to notify that the bounds of the control is changing.
212          *
213          * @since       2.0
214          *
215          * @return      An error code
216          * @param[in]   oldRect  The old position and size values of the control
217          * @param[in]   newRect  The new position and size values of the control
218          * @remarks     If the method returns an exception, the resulting exception
219          *              is propagated and the control's size is unchanged.@n
220          *              Provide control specific exceptions.
221          * @see         Tizen::Ui::Control::SetBounds()
222          * @see         Tizen::Ui::Control::SetSize()
223          */
224         virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect);
225
226         /**
227          * Called to notify that the bounds of the control is changed.
228          *
229          * @since       2.0
230          *
231          * @return      An error code
232          * @param[in]   oldRect  The old position and size values of the control
233          * @param[in]   newRect  The new position and size values of the control
234          * @see         Tizen::Ui::Control::SetBounds()
235          * @see         Tizen::Ui::Control::SetSize()
236          */
237         virtual void OnBoundsChanged(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect);
238
239         /**
240          * Overrides this method to indicate that the specified @c width and @c height
241          * can be supported or a new @c width and @c height should be applied instead
242          * of the specified values.
243          *
244          * @since           2.0
245          *
246          * @param[in, out]  evaluatedSize  The width and the height to evaluate
247          */
248         virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize);
249
250         /**
251          * Removes the specified control from the container.
252          *
253          * @brief       <i> [Deprecated] </i>
254          * @deprecated  This API is deprecated.
255          * @since                       2.0
256          *
257          * @return              An error code
258          * @param[in]   control                 The child control to remove
259          * @exception   E_SUCCESS               The method is successful.
260          * @exception   E_OBJ_NOT_FOUND         The specified instance is not found within the indicated range (that is, the @c control is not found).
261          * @exception   E_SYSTEM                A system error has occurred.
262          * @remarks             The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called.
263          *                              If OnTerminating() method is overrided and returns an exception, that exception will be propagated.
264          * @see                 Tizen::Ui::Control::OnTerminating()
265          */
266         result RemoveControl(const Control& control);
267
268          /**
269          * Removes the specified control from the container.
270          *
271          * @since                             2.1
272          *
273          * @return                 An error code
274          * @param[in]   pControl                Pointer of the child control to be removed
275          * @exception   E_SUCCESS               The method is successful.
276          * @exception   E_OBJ_NOT_FOUND The specified instance is not found within the indicated range (that is, the @c control is not found).
277          * @exception   E_INVALID_ARG   The specified @c pControl is null.
278          * @exception   E_SYSTEM                A system error has occurred.
279          * @remarks             The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called.
280          *                              If OnTerminating() method is overrided and returns an exception, that exception will be propagated.
281          * @see                               Tizen::Ui::Control::OnTerminating()
282          */
283         result RemoveControl(Control* pControl);
284
285         /**
286          * Removes the specified control from the container.
287          *
288          * @since                       2.0
289          *
290          * @return              An error code
291          * @param[in]   index                   The index of the control to remove
292          * @exception   E_SUCCESS                       The method is successful.
293          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
294          * @exception   E_SYSTEM                A system error has occurred.
295          * @remarks             The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called.
296          *                              If OnTerminating() method is overrided and returns an exception, that exception will be propagated.
297          * @see                 Tizen::Ui::Control::OnTerminating()
298          */
299         result RemoveControl(int index);
300
301         /**
302          * Removes all the controls from the container.
303          *
304          * @since                       2.0
305          *
306          * @remarks             The removed child controls are deleted from the memory. Before deletion, OnTerminating() of the child control is called.
307          * @see                         Tizen::Ui::Control::OnTerminating()
308          */
309         void RemoveAllControls(void);
310
311         /**
312          * Gets the control at the specified index of the list that is kept by the container.
313          *
314          * @since                       2.0
315          *
316          * @return              The control at the specified index of the list, @n
317          *              else @c null if the index is not valid
318          * @param[in]   index   The index of the control
319          */
320         Control* GetControl(int index) const;
321
322         /**
323          * Gets the control with the specified name. @n
324          * If there are multiple matches of the name, the first match is returned.
325          *
326          * @if OSPCOMPAT
327          * @brief <i> [Compatibility] </i>
328          * @endif
329          * @since                       2.0
330          *
331          * @if OSPCOMPAT
332          * @compatibility This method has compatibility issues with OSP compatible applications. @n
333          *                       For more information, see @ref CompGetControlPage "here".
334          * @endif
335          *
336          * @return              The control having the specified name, @n
337          *                              else @c null if the name is not valid
338          * @param[in]   name            The name of the control
339          * @param[in]   recursive       Set to @c true to find a match recursively, @n
340          *                                                      else @c false
341          */
342         Control* GetControl(const Tizen::Base::String& name, bool recursive = false) const;
343
344         /**
345          * @if OSPCOMPAT
346          * @page               CompGetControlPage        Compatibility for GetControl()
347          * @section            CompGetControlPageIssueSection          Issues
348          * Implementing this method in OSP compatible applications has the following issues: @n
349          * -# GetControl() method searches for itself first and then child controls in API version 2.0, whereas only @n
350          * child controls are searched for from 2.1.
351          *
352          * @section            CompGetControlPageSolutionSection               Resolutions
353          * This issue has been resolved in Tizen.  @n
354          * @endif
355          */
356
357         /**
358          * Gets the number of the controls in the container.
359          *
360          * @since                       2.0
361          *
362          * @return              The number of controls in the container
363          */
364         int GetControlCount(void) const;
365
366         /**
367          * Gets a list of the controls of the container.
368          *
369          * @since               2.0
370          *
371          * @return              The list of the controls of the container
372          */
373         Tizen::Base::Collection::IList* GetControls(void) const;
374
375         /**
376          * Gets the portrait layout of the container.
377          *
378          * @since                       2.0
379          *
380          * @return              The portrait layout of the container, @n
381          *                              else @c null if the layout does not exist
382          * @exception   E_SUCCESS               The method is successful.
383          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
384          * @remarks             The returned layout can be @c null, if it is not set.
385          */
386         Layout* GetPortraitLayoutN(void) const;
387
388         /**
389          * Gets the landscape layout of the container.
390          *
391          * @since                       2.0
392          *
393          * @return              The landscape layout of the container, @n
394          *                              else @c null if the layout does not exist
395          * @exception   E_SUCCESS               The method is successful.
396          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
397          * @remarks             The returned layout can be @c null, if it is not set.
398          */
399         Layout* GetLandscapeLayoutN(void) const;
400
401         /**
402          * Gets the layout of the current orientation.
403          *
404          * @since                       2.0
405          *
406          * @return              The layout of the current orientation, @n
407          *                              else @c null if the layout does not exist
408          * @exception   E_SUCCESS               The method is successful.
409          * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
410          * @remarks             The returned layout can be @c null, if it is not set.
411          */
412         Layout* GetLayoutN(void) const;
413
414         /**
415          * Checks whether the specified control is a child or descendant of the container.
416          *
417          * @brief       <i> [Deprecated] </i>
418          * @deprecated  This API is deprecated.
419          * @since                               2.0
420          *
421          * @return      @c true if the specified control is within the containment hierarchy of the container, @n
422          *              else @c false
423          * @param[in]   control         The control
424          */
425         bool IsAncestorOf(const Control& control) const;
426
427          /**
428          * Checks whether the specified control is a child or descendant of the container.
429          *
430          * @since                                       2.1
431          *
432          * @return      @c true if the specified control is within the containment hierarchy of the container, @n
433          *              else @c false
434          * @param[in] pControl                   Pointer of the control
435          * @exception E_SUCCESS The method is successful.
436          * @exception     E_INVALID_ARG  The specified @c pControl is null.
437          * @remarks       The specific error code can be accessed using the GetLastResult() method.
438          */
439         bool IsAncestorOf(const Control* pControl) const;
440
441         /**
442          * Sets whether the specified child control must always be above other children.
443          *
444          * @since        2.0
445          *
446          * @return       An error code
447          * @param[in]    control          The child control
448          * @param[in]    alwaysOnTop      The Boolean value indicating that @c control
449          *                                must always be on the top
450          * @exception    E_SUCCESS        The method is successful.
451          * @exception    E_INVALID_ARG    A specified input parameter is invalid.@n
452          *                                The specified control is not a child of this
453          *                                container.
454          * @remarks      If multiple child control are set as "always on top", then
455          *               their relative order is not specified. If the specified child
456          *               control is a container, then all its children inherit this
457          *               property and they are "always on top" of other controls.@n
458          *               If the method is called on a child control with a @c false
459          *               value, then it's state becomes normal. The relative order
460          *               of child controls in normal state is not specified.
461          * @see          IsControlAlwaysOnTop()
462          */
463         result SetControlAlwaysOnTop(Tizen::Ui::Control& control, bool alwaysOnTop);
464
465         /**
466          * Sets whether the specified child control must always be below other children.
467          *
468          * @since        2.0
469          *
470          * @return       An error code
471          * @param[in]    control          The child control
472          * @param[in]    alwaysAtBottom   The Boolean value indicating that @c control
473          *                                must always be at the bottom.
474          * @exception    E_SUCCESS        The method is successful.
475          * @exception    E_INVALID_ARG    A specified input parameter is invalid.@n
476          *                                The specified control is not a child of this
477          *                                container.
478          * @remarks      If multiple child control are set as "always at bottom", then
479          *               their relative order is not specified. If the specified child
480          *               control is a container, then all its children inherit this
481          *               property and they become "always at bottom" as well.@n
482          *               If the method is called on a child control with a @c false
483          *               value, then it's state becomes normal. The relative order
484          *               of child controls in normal state is not specified.
485          * @see          IsControlAlwaysAtBottom()
486          */
487         result SetControlAlwaysAtBottom(Tizen::Ui::Control& control, bool alwaysAtBottom);
488
489         /**
490          * Checks whether the specified child control is always at the bottom of
491          * the drawing stack.
492          *
493          * @brief       <i> [Deprecated] </i>
494          * @deprecated  This API is deprecated.
495          * @since       2.0
496          *
497          * @return       @c true if the specified child control is set as always at the bottom, @n
498          *                 else @c false
499          * @param[in]    control          The child control
500          * @exception    E_SUCCESS        The method is successful.
501          * @exception    E_INVALID_ARG    A specified input parameter is invalid.@n
502          *                                The specified control is not a child of this
503          *                                container.
504          * @remarks      The specific error code can be accessed using the GetLastResult()
505          *               method.
506          * @see          SetControlAlwaysAtBottom()
507          */
508         bool IsControlAlwaysAtBottom(const Tizen::Ui::Control& control) const;
509
510         /**
511          * Checks whether the specified child control is always at the bottom of
512          * the drawing stack.
513          *
514          * @since       2.1
515          *
516          * @return       @c true if the specified child control is set as always at the bottom, @n
517          *                 else @c false
518          * @param[in]   pControl          Pointer of child control
519          * @exception    E_SUCCESS        The method is successful.
520          * @exception    E_INVALID_ARG    A specified input parameter is invalid.@n
521          *                                The specified control is not a child of this
522          *                                container or @c pControl is null .
523          * @remarks      The specific error code can be accessed using the GetLastResult()
524          *               method.
525          * @see          SetControlAlwaysAtBottom()
526          */
527         bool IsControlAlwaysAtBottom(const Tizen::Ui::Control* pControl) const;
528
529         /**
530          * Checks whether the specified child control is always on the top of
531          * the drawing stack.
532          *
533          * @brief       <i> [Deprecated] </i>
534          * @deprecated  This API is deprecated.
535          * @since        2.0
536          *
537          * @return       @c true if the specified child control is set as always on the top, @n
538          *               else @c false
539          * @param[in]    control          The child control
540          * @exception    E_SUCCESS        The method is successful.
541          * @exception    E_INVALID_ARG    A specified input parameter is invalid. @n
542          *                                The specified control is not a child of this
543          *                                container.
544          * @remarks      The specific error code can be accessed using the GetLastResult()
545          *               method.
546          * @see          SetControlAlwaysOnTop()
547          */
548         bool IsControlAlwaysOnTop(const Tizen::Ui::Control& control) const;
549
550         /**
551          * Checks whether the specified child control is always on the top of
552          * the drawing stack.
553          *
554          * @since        2.1
555          *
556          * @return       @c true if the specified child control is set as always on the top, @n
557          *               else @c false
558          * @param[in]   pControl          Pointer of child control
559          * @exception    E_SUCCESS        The method is successful.
560          * @exception    E_INVALID_ARG    A specified input parameter is invalid. @n
561          *                                The specified control is not a child of this
562          *                                container. or @c pControl is null
563          * @remarks      The specific error code can be accessed using the GetLastResult()
564          *               method.
565          * @see          SetControlAlwaysOnTop()
566          */
567         bool IsControlAlwaysOnTop(const Tizen::Ui::Control* pControl) const;
568
569 protected:
570         /**
571          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
572          *
573          * @since       2.0
574          */
575         Container(void);
576
577         /**
578          * Initializes this instance of %Container.
579          *
580          * @since                       2.0
581          *
582          * @return              An error code
583          * @exception   E_SUCCESS                       The method is successful.
584          * @exception   E_SYSTEM                        A system error has occurred.
585          */
586         result Construct(void);
587
588         /**
589          * Initializes this instance of %Container.
590          *
591          * @since 2.0
592          *
593          * @return      An error code
594          * @param[in]   rect                                      The rectangle bounds to be set
595          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
596          *                                  else @c false
597          * @param[in]   movable                                          Set to @c true to make the container movable, @n
598          *                                  else @c false
599          * @exception   E_SUCCESS           The method is successful.
600          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
601          * @remarks     This method must be called from the derived classes's construct methods.
602          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
603          * @see IsResizable()
604         */
605         result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
606
607         /**
608          * Initializes this instance of %Container.
609          *
610          * @since 2.1
611          *
612          * @return      An error code
613          * @param[in]   rect                                      The rectangle bounds to be set
614          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
615          *                                  else @c false
616          * @param[in]   movable                                          Set to @c true to make the container movable, @n
617          *                                  else @c false
618          * @exception   E_SUCCESS           The method is successful.
619          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
620          * @remarks     This method must be called from the derived classes's construct methods.
621          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
622          * @see IsResizable()
623         */
624         result Construct(const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
625
626         /**
627          * Initializes this instance of %Container with the specified layout and rectangular region.
628          *
629          * @since 2.0
630          *
631          * @return                  An error code
632          * @param[in]   layout                                   The layout for both the portrait and landscape mode
633          * @param[in]   rect                                      The location and size of the %Container
634          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
635          *                                  else @c false
636          * @param[in]   movable                                          Set to @c true to make the container movable, @n
637          *                                  else @c false
638          * @exception   E_SUCCESS                The method is successful.
639          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
640          * @remarks     This method must be called from the derived classes's construct methods.
641          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
642          * @see IsResizable()
643          * @see Tizen::Ui::Layout
644          * @see Tizen::Ui::Container::GetLayoutN()
645         */
646         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
647
648         /**
649          * Initializes this instance of %Container with the specified layout and rectangular region.
650          *
651          * @since 2.1
652          *
653          * @return                  An error code
654          * @param[in]   layout                                   The layout for both the portrait and landscape mode
655          * @param[in]   rect                                      The location and size of the %Container
656          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
657          *                                  else @c false
658          * @param[in]   movable                                          Set to @c true to make the container movable, @n
659          *                                  else @c false
660          * @exception   E_SUCCESS                The method is successful.
661          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
662          * @remarks     This method must be called from the derived classes's construct methods.
663          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
664          * @see IsResizable()
665          * @see Tizen::Ui::Layout
666          * @see Tizen::Ui::Container::GetLayoutN()
667         */
668         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
669
670         /**
671          * Initializes this instance of %Container with the specified layouts and rectangular region.
672          *
673          * @since 2.0
674          *
675          * @return                  An error code
676          * @param[in]   portraitLayout              The layout for the portrait mode
677          * @param[in]   landscapeLayout           The layout for the landscape mode
678          * @param[in]   rect                                      The location and size of the %Container
679          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
680          *                                  else @c false
681          * @param[in]   movable                                          Set to @c true to make the container movable, @n
682          *                                  else @c false
683          * @exception   E_SUCCESS                The method is successful.
684          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
685          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
686          * @see IsResizable()
687          * @see Tizen::Ui::Layout
688          * @see Tizen::Ui::Layout
689          * @see Tizen::Ui::Container::GetLayoutN()
690          * @see Tizen::Ui::Container::GetPortraitLayoutN()
691          * @see Tizen::Ui::Container::GetLandscapeLayoutN()
692         */
693         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
694
695         /**
696          * Initializes this instance of %Container with the specified layouts and rectangular region.
697          *
698          * @since 2.1
699          *
700          * @return                  An error code
701          * @param[in]   portraitLayout              The layout for the portrait mode
702          * @param[in]   landscapeLayout           The layout for the landscape mode
703          * @param[in]   rect                                      The location and size of the %Container
704          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
705          *                                  else @c false
706          * @param[in]   movable                                          Set to @c true to make the container movable, @n
707          *                                  else @c false
708          * @exception   E_SUCCESS                The method is successful.
709          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
710          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
711          * @see IsResizable()
712          * @see Tizen::Ui::Layout
713          * @see Tizen::Ui::Layout
714          * @see Tizen::Ui::Container::GetLayoutN()
715          * @see Tizen::Ui::Container::GetPortraitLayoutN()
716          * @see Tizen::Ui::Container::GetLandscapeLayoutN()
717         */
718         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
719
720         /**
721          * Gets the index of the specified control.
722          *
723          * @brief       <i> [Deprecated] </i>
724          * @deprecated  This API is deprecated.
725          * @since                       2.0
726          * @return              An error code
727          * @param[in]   control                 The control
728          * @param[out]  index                   The index of the control
729          * @exception   E_SUCCESS                       The method is successful.
730          * @exception   E_OBJ_NOT_FOUND         The specified instance of Control is not found.
731          * @see                 SetControlAt()
732          *
733          */
734         result GetControlAt(const Control& control, int& index) const;
735
736         /**
737          * Gets the index of the specified control.
738          *
739          * @since                             2.1
740          * @return                 An error code
741          * @param[in] pControl                   Pointer of the control
742          * @param[out]          index                        The index of the control
743          * @exception E_SUCCESS                           The method is successful.
744          * @exception    E_INVALID_ARG   The specified @c pControl is null.
745          * @exception E_OBJ_NOT_FOUND               The specified instance of Control is not found.
746          * @see                               SetControlAt()
747          *
748          */
749         result GetControlAt(const Control* pControl, int& index) const;
750
751         /**
752          * Sets the control at the specified index.
753          *
754          * @brief       <i> [Deprecated] </i>
755          * @deprecated  This API is deprecated.
756          * @since                       2.0
757          *
758          * @return              An error code
759          * @param[in]   control         The control
760          * @param[in]   index           The index
761          * @exception   E_SUCCESS       The method is successful.
762          * @exception   E_OUT_OF_RANGE  The specified @c index is out of range.
763          * @exception   E_SYSTEM        A system error has occurred.
764          * @remarks         The @c control must be first added to this container. @n
765          *                              Call the Invalidate() method after this, to apply the change to be shown.
766          * @see         Invalidate()
767          * @see         GetControlAt()
768          *
769          */
770         result SetControlAt(const Control& control, int index);
771
772         /**
773          * Sets the control at the specified index.
774          *
775          * @since                             2.1
776          *
777          * @return                    An error code
778          * @param[in] pControl        Pointer of the control
779          * @param[in] index           The index
780          * @exception E_SUCCESS       The method is successful.
781          * @exception E_OUT_OF_RANGE  The specified @c index is out of range.
782          * @exception E_INVALID_ARG   The specified @c pControl is null.
783          * @exception E_SYSTEM        A system error has occurred.
784          * @remarks                                       The @c control must be first added to this container. @n
785          *                            Call the Invalidate() method after this, to apply the change to be shown.
786          * @see                                           Invalidate()
787          * @see                       GetControlAt()
788          *
789          */
790         result SetControlAt(Control* pControl, int index);
791
792 protected:
793         /**
794          * Called to notify that the bounds of the control is changing.
795          *
796          * @since       2.1
797          *
798          * @return      An error code
799          * @param[in]   oldRect  The old position and size values of the control
800          * @param[in]   newRect  The new position and size values of the control
801          * @remarks     If the method returns an exception, the resulting exception
802          *              is propagated and the control's size is unchanged.@n
803          *              Provide control specific exceptions.
804          * @see         Tizen::Ui::Control::SetBounds()
805          * @see         Tizen::Ui::Control::SetSize()
806          */
807         virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect);
808
809         /**
810          * Called to notify that the bounds of the control is changed.
811          *
812          * @since       2.1
813          *
814          * @return      An error code
815          * @param[in]   oldRect  The old position and size values of the control
816          * @param[in]   newRect  The new position and size values of the control
817          * @see         Tizen::Ui::Control::SetBounds()
818          * @see         Tizen::Ui::Control::SetSize()
819          */
820         virtual void OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect);
821
822         /**
823          * Overrides this method to indicate that the specified @c width and @c height
824          * can be supported or a new @c width and @c height should be applied instead
825          * of the specified values.
826          *
827          * @since           2.1
828          *
829          * @return          A Boolean flag that indicates whether the specified @c evaluatedSize
830          *                  is modified.
831          * @param[in, out]  evaluatedSize  The width and the height to evaluate
832          */
833         virtual bool OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize);
834
835         //
836         // This method is for internal use only.
837         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
838         //
839         // This method is reserved and may change its name at any time without prior notice.
840         //
841         virtual void Container_Reserved4(void) {}
842
843         //
844         // This method is for internal use only.
845         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
846         //
847         // This method is reserved and may change its name at any time without prior notice.
848         //
849         virtual void Container_Reserved5(void) {}
850
851 private:
852         //
853         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
854         //
855         Container(const Container& rhs);
856
857         //
858         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
859         //
860         Container& operator =(const Container& rhs);
861
862 private:
863         friend class _ContainerImpl;
864 }; // Container
865
866 }}  //Tizen::Ui
867
868 #endif //_FUI_CONTAINER_H_