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