Fixed to add the AllWindowList
[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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 method 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_PORTRAIT_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 a control at the end of the list maintained by a container.
109          *
110          * @since                              2.1
111          *
112          * @return        An error code
113          * @param[in]    pControl         A pointer to 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 @c null.
116          *                              The specified @c control is an instance of Window or the 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
121          *                      - When a control is added, it is placed at the top of the drawing stack maintained by the container.@n
122          *                      This means the control that is added last is drawn last.
123          *                      - A control becomes displayable only after it has been added to a displayable container.
124          *                      Some methods may not work normally if the methods 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_PORTRAIT_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 method 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 overridden and returns an exception, that exception is propagated.
264          * @see                 Tizen::Ui::Control::OnTerminating()
265          */
266         result RemoveControl(const Control& control);
267
268          /**
269          * Removes a specified control from the container.
270          *
271          * @since                             2.1
272          *
273          * @return                 An error code
274          * @param[in]   pControl                A pointer to the child control to remove
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 @c 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 overridden and returns an exception, that exception is 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 overridden and returns an exception, that exception is 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 method 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 a specified control is a child or descendant of the container.
429          *
430          * @since                                       2.1
431          *
432          * @return      @c true if a specified control is within the containment hierarchy of the container, @n
433          *              else @c false
434          * @param[in] pControl                   A pointer to 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 method 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 a specified child control is always at the bottom of the drawing stack.
512          *
513          * @since       2.1
514          *
515          * @return       @c true if a specified child control is set as always at the bottom, @n
516          *                 else @c false
517          * @param[in]   pControl          A pointer to 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 @c null .
522          * @remarks      The specific error code can be accessed using the GetLastResult() method.
523          * @see          SetControlAlwaysAtBottom()
524          */
525         bool IsControlAlwaysAtBottom(const Tizen::Ui::Control* pControl) const;
526
527         /**
528          * Checks whether the specified child control is always on the top of
529          * the drawing stack.
530          *
531          * @brief       <i> [Deprecated] </i>
532          * @deprecated  This method is deprecated.
533          * @since        2.0
534          *
535          * @return       @c true if the specified child control is set as always on the top, @n
536          *               else @c false
537          * @param[in]    control          The child control
538          * @exception    E_SUCCESS        The method is successful.
539          * @exception    E_INVALID_ARG    A specified input parameter is invalid. @n
540          *                                The specified control is not a child of this
541          *                                container.
542          * @remarks      The specific error code can be accessed using the GetLastResult()
543          *               method.
544          * @see          SetControlAlwaysOnTop()
545          */
546         bool IsControlAlwaysOnTop(const Tizen::Ui::Control& control) const;
547
548         /**
549          * Checks whether a specified child control is always at the top of the drawing stack.
550          *
551          * @since        2.1
552          *
553          * @return       @c true if a specified child control is set as always at the top, @n
554          *               else @c false
555          * @param[in]   pControl          A pointer to child control
556          * @exception    E_SUCCESS        The method is successful.
557          * @exception    E_INVALID_ARG    A specified input parameter is invalid. @n
558          *                                The specified control is not a child of this
559          *                                container. or @c pControl is @c null
560          * @remarks      The specific error code can be accessed using the GetLastResult() method.
561          * @see          SetControlAlwaysOnTop()
562          */
563         bool IsControlAlwaysOnTop(const Tizen::Ui::Control* pControl) const;
564
565 protected:
566         /**
567          * 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.
568          *
569          * @since       2.0
570          */
571         Container(void);
572
573         /**
574          * Initializes this instance of %Container.
575          *
576          * @since                       2.0
577          *
578          * @return              An error code
579          * @exception   E_SUCCESS                       The method is successful.
580          * @exception   E_SYSTEM                        A system error has occurred.
581          */
582         result Construct(void);
583
584         /**
585          * Initializes this instance of %Container.
586          *
587          * @since 2.0
588          *
589          * @return      An error code
590          * @param[in]   rect                                      The rectangle bounds to set
591          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
592          *                                  else @c false
593          * @param[in]   movable                                          Set to @c true to make the container movable, @n
594          *                                  else @c false
595          * @exception   E_SUCCESS           The method is successful.
596          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
597          * @remarks     This method must be called from the derived classes's construct methods.
598          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
599          * @see IsResizable()
600         */
601         result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
602
603         /**
604          * Initializes this instance of %Container.
605          *
606          * @since 2.1
607          *
608          * @return      An error code
609          * @param[in]   rect                                      The rectangle bounds to set
610          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
611          *                                  else @c false
612          * @param[in]   movable                                          Set to @c true to make the container movable, @n
613          *                                  else @c false
614          * @exception   E_SUCCESS           The method is successful.
615          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
616          * @remarks     This method must be called from the derived classes's construct methods.
617          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
618          * @see IsResizable()
619         */
620         result Construct(const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
621
622         /**
623          * Initializes this instance of %Container with the specified layout and rectangular region.
624          *
625          * @since 2.0
626          *
627          * @return                  An error code
628          * @param[in]   layout                                   The layout for both the portrait and landscape mode
629          * @param[in]   rect                                      The location and size of the %Container
630          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
631          *                                  else @c false
632          * @param[in]   movable                                          Set to @c true to make the container movable, @n
633          *                                  else @c false
634          * @exception   E_SUCCESS                The method is successful.
635          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
636          * @remarks     This method must be called from the derived classes's construct methods.
637          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
638          * @see IsResizable()
639          * @see Tizen::Ui::Layout
640          * @see Tizen::Ui::Container::GetLayoutN()
641         */
642         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
643
644         /**
645          * Initializes this instance of %Container with the specified layout and rectangular region.
646          *
647          * @since 2.1
648          *
649          * @return                  An error code
650          * @param[in]   layout                                   The layout for both the portrait and landscape mode
651          * @param[in]   rect                                      The location and size of the %Container
652          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
653          *                                  else @c false
654          * @param[in]   movable                                          Set to @c true to make the container movable, @n
655          *                                  else @c false
656          * @exception   E_SUCCESS                The method is successful.
657          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
658          * @remarks     This method must be called from the derived classes's construct methods.
659          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
660          * @see IsResizable()
661          * @see Tizen::Ui::Layout
662          * @see Tizen::Ui::Container::GetLayoutN()
663         */
664         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
665
666         /**
667          * Initializes this instance of %Container with the specified layouts and rectangular region.
668          *
669          * @since 2.0
670          *
671          * @return                  An error code
672          * @param[in]   portraitLayout              The layout for the portrait mode
673          * @param[in]   landscapeLayout           The layout for the landscape mode
674          * @param[in]   rect                                      The location and size of the %Container
675          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
676          *                                  else @c false
677          * @param[in]   movable                                          Set to @c true to make the container movable, @n
678          *                                  else @c false
679          * @exception   E_SUCCESS                The method is successful.
680          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
681          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
682          * @see IsResizable()
683          * @see Tizen::Ui::Layout
684          * @see Tizen::Ui::Layout
685          * @see Tizen::Ui::Container::GetLayoutN()
686          * @see Tizen::Ui::Container::GetPortraitLayoutN()
687          * @see Tizen::Ui::Container::GetLandscapeLayoutN()
688         */
689         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
690
691         /**
692          * Initializes this instance of %Container with the specified layouts and rectangular region.
693          *
694          * @since 2.1
695          *
696          * @return                  An error code
697          * @param[in]   portraitLayout              The layout for the portrait mode
698          * @param[in]   landscapeLayout           The layout for the landscape mode
699          * @param[in]   rect                                      The location and size of the %Container
700          * @param[in]   resizable                                Set to @c true to make the container resizable, @n
701          *                                  else @c false
702          * @param[in]   movable                                          Set to @c true to make the container movable, @n
703          *                                  else @c false
704          * @exception   E_SUCCESS                The method is successful.
705          * @exception   E_INVALID_ARG            A specified input parameter is invalid.
706          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
707          * @see IsResizable()
708          * @see Tizen::Ui::Layout
709          * @see Tizen::Ui::Layout
710          * @see Tizen::Ui::Container::GetLayoutN()
711          * @see Tizen::Ui::Container::GetPortraitLayoutN()
712          * @see Tizen::Ui::Container::GetLandscapeLayoutN()
713         */
714         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
715
716         /**
717          * Gets the index of the specified control.
718          *
719          * @brief       <i> [Deprecated] </i>
720          * @deprecated  This method is deprecated.
721          * @since                       2.0
722          * @return              An error code
723          * @param[in]   control                 The control
724          * @param[out]  index                   The index of the control
725          * @exception   E_SUCCESS                       The method is successful.
726          * @exception   E_OBJ_NOT_FOUND         The specified instance of Control is not found.
727          * @see                 SetControlAt()
728          *
729          */
730         result GetControlAt(const Control& control, int& index) const;
731
732         /**
733          * Gets the index of a specified control.
734          *
735          * @since                             2.1
736          * @return                 An error code
737          * @param[in] pControl                   A pointer to the control
738          * @param[out]          index                        The index of the control
739          * @exception E_SUCCESS                           The method is successful.
740          * @exception    E_INVALID_ARG   The specified @c pControl is @c null.
741          * @exception E_OBJ_NOT_FOUND               The specified instance of Control is not found.
742          * @see                               SetControlAt()
743          *
744          */
745         result GetControlAt(const Control* pControl, int& index) const;
746
747         /**
748          * Sets the control at the specified index.
749          *
750          * @brief       <i> [Deprecated] </i>
751          * @deprecated  This method is deprecated.
752          * @since                       2.0
753          *
754          * @return              An error code
755          * @param[in]   control         The control
756          * @param[in]   index           The index
757          * @exception   E_SUCCESS       The method is successful.
758          * @exception   E_OUT_OF_RANGE  The specified @c index is out of range.
759          * @exception   E_SYSTEM        A system error has occurred.
760          * @remarks         The @c control must be first added to this container. @n
761          *                              Call the Invalidate() method after this, to apply the change to be shown.
762          * @see         Invalidate()
763          * @see         GetControlAt()
764          *
765          */
766         result SetControlAt(const Control& control, int index);
767
768         /**
769          * Sets the control at a specified index.
770          *
771          * @since                             2.1
772          *
773          * @return                    An error code
774          * @param[in] pControl        A pointer to the control
775          * @param[in] index           The index
776          * @exception E_SUCCESS       The method is successful.
777          * @exception E_OUT_OF_RANGE  The specified @c index is out of range.
778          * @exception E_INVALID_ARG   The specified @c pControl is @c null.
779          * @exception E_SYSTEM        A system error has occurred.
780          * @remarks                                       The @c control must be first added to this container. @n
781          *                            Then the Invalidate() method is called to show the applied changes.
782          * @see                                           Invalidate()
783          * @see                       GetControlAt()
784          *
785          */
786         result SetControlAt(Control* pControl, int index);
787
788 protected:
789         /**
790          * Called to notify that the bounds of the control is changing.
791          *
792          * @since       2.1
793          *
794          * @return      An error code
795          * @param[in]   oldRect  The old position and size values of the control
796          * @param[in]   newRect  The new position and size values of the control
797          * @remarks     If the method returns an exception, the resulting exception
798          *              is propagated and the control's size is unchanged.@n
799          *              Provide control specific exceptions.
800          * @see         Tizen::Ui::Control::SetBounds()
801          * @see         Tizen::Ui::Control::SetSize()
802          */
803         virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect);
804
805         /**
806          * Called to notify that the bounds of the control is changed.
807          *
808          * @since       2.1
809          *
810          * @return      An error code
811          * @param[in]   oldRect  The old position and size values of the control
812          * @param[in]   newRect  The new position and size values of the control
813          * @see         Tizen::Ui::Control::SetBounds()
814          * @see         Tizen::Ui::Control::SetSize()
815          */
816         virtual void OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect);
817
818         /**
819          * Overrides this method to indicate that the specified @c width and @c height
820          * can be supported or a new @c width and @c height should be applied instead
821          * of the specified values.
822          *
823          * @since           2.1
824          *
825          * @return          A Boolean flag that indicates whether the specified @c evaluatedSize
826          *                  is modified.
827          * @param[in, out]  evaluatedSize  The width and the height to evaluate
828          */
829         virtual bool OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize);
830
831         //
832         // This method is for internal use only.
833         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
834         //
835         // This method is reserved and may change its name at any time without prior notice.
836         //
837         virtual void Container_Reserved4(void) {}
838
839         //
840         // This method is for internal use only.
841         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
842         //
843         // This method is reserved and may change its name at any time without prior notice.
844         //
845         virtual void Container_Reserved5(void) {}
846
847 private:
848         //
849         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
850         //
851         Container(const Container& rhs);
852
853         //
854         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
855         //
856         Container& operator =(const Container& rhs);
857
858 private:
859         friend class _ContainerImpl;
860 }; // Container
861
862 }}  //Tizen::Ui
863
864 #endif //_FUI_CONTAINER_H_