modified doxygen comment
[framework/osp/uifw.git] / inc / FUiCardLayout.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                FUiCardLayout.h
20  * @brief               This is the header file for the %CardLayout class.
21  *
22  * This header file contains the declarations of the %CardLayout class.
23  */
24
25 #ifndef _FUI_CARD_LAYOUT_H_
26 #define _FUI_CARD_LAYOUT_H_
27
28 #include <FUiLayout.h>
29
30 namespace Tizen { namespace Ui
31 {
32 class Control;
33
34 /**
35  * @class       CardLayout
36  * @brief       The card layout fits a child control to the container by changing the position and the size of the child control.
37  *
38  * @since       2.0
39  *
40  * The %CardLayout class defines the card layout for a container.@n
41  *
42  * @code
43 // Sample code for CardLayoutSample.h
44 #include <FUi.h>
45
46 class CardLayoutSample
47         : public Tizen::Ui::Controls::Form
48 {
49 public:
50         bool Initialize(void);
51         virtual result OnInitializing(void);
52 };
53  *      @endcode
54  *
55  *      @code
56 // Sample code for CardLayoutSample.cpp
57 #include <FGraphics.h>
58 #include <FUiCardLayout.h>
59
60 #include "CardLayoutSample.h"
61
62 using namespace Tizen::Graphics;
63 using namespace Tizen::Ui;
64 using namespace Tizen::Ui::Controls;
65
66 bool
67 CardLayoutSample::Initialize(void)
68 {
69         // Creates an instance of CardLayout
70         CardLayout formLayout;
71         formLayout.Construct();
72
73         // Applies the card layout to the form
74         Construct(formLayout, FORM_STYLE_NORMAL);
75         return true;
76 }
77
78 result
79 CardLayoutSample::OnInitializing(void)
80 {
81         result r = E_SUCCESS;
82
83         // Creates an instance of 1st panel
84         Panel* pFirstPanel = new Panel();
85         pFirstPanel->Construct(Rectangle(0, 0, 50, 50));
86         pFirstPanel->SetBackgroundColor(Color(0xFF, 0x40, 0x40, 0xFF));
87
88         // Adds the 1st panel to the form
89         AddControl(pFirstPanel);
90
91         // Creates an instance of 2nd panel
92         Panel* pSecondPanel = new Panel();
93         pSecondPanel->Construct(Rectangle(0, 0, 50, 50));
94         pSecondPanel->SetBackgroundColor(Color(0x40, 0x40, 0xFF, 0xFF));
95
96         // Adds the 2nd panel to the form
97         AddControl(pSecondPanel);
98
99         return r;
100 }
101  * @endcode
102  *
103  */
104 class _OSP_EXPORT_ CardLayout
105         : public Layout
106 {
107 public:
108         /**
109          * 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.
110          *
111          * @since 2.0
112          */
113         CardLayout(void);
114
115         /**
116          * This destructor overrides Tizen::Base::Object::~Object().
117          *
118          * @since 2.0
119          */
120         virtual ~CardLayout(void);
121
122         /**
123          * Initializes this instance of %CardLayout.
124          *
125          * @since 2.0
126          *
127          * @return              An error code
128          * @exception   E_SUCCESS                       The method is successful.
129          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
130          */
131         result Construct(void);
132
133         /**
134          * Gets the type of the layout.
135          *
136          * @since 2.0
137          *
138          * @return      The layout type
139          */
140         virtual LayoutType GetLayoutType(void) const;
141
142 private:
143         //
144         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
145         //
146         CardLayout(const CardLayout& rhs);
147
148         //
149         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
150         //
151         CardLayout& operator =(const CardLayout& rhs);
152
153 }; // CardLayout
154
155 }} // Tizen::Ui
156
157 #endif // _FUI_CARD_LAYOUT_H_