Fix to adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiCardLayout.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                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
59 #include "CardLayoutSample.h"
60
61 using namespace Tizen::Graphics;
62 using namespace Tizen::Ui;
63 using namespace Tizen::Ui::Controls;
64
65 bool
66 CardLayoutSample::Initialize(void)
67 {
68         // Creates an instance of CardLayout
69         CardLayout formLayout;
70         formLayout.Construct();
71
72         // Applies the card layout to the form
73         Construct(formLayout, FORM_STYLE_NORMAL);
74         return true;
75 }
76
77 result
78 CardLayoutSample::OnInitializing(void)
79 {
80         result = E_SUCCESS;
81
82         // Creates an instance of 1st panel
83         Panel* pFirstPanel = new Panel();
84         pFirstPanel->Construct(Rectangle(0, 0, 50, 50));
85         pFirstPanel->SetBackgroundColor(Color(0xFF, 0x40, 0x40, 0xFF));
86
87         // Adds the 1st panel to the form
88         AddControl(*pFirstPanel);
89
90         // Creates an instance of 2nd panel
91         Panel* pSecondPanel = new Panel();
92         pSecondPanel->Construct(Rectangle(0, 0, 50, 50));
93         pSecondPanel->SetBackgroundColor(Color(0x40, 0x40, 0xFF, 0xFF));
94
95         // Adds the 2nd panel to the form
96         AddControl(*pSecondPanel);
97
98         return r;
99 }
100  * @endcode
101  *
102  */
103 class _OSP_EXPORT_ CardLayout
104         : public Layout
105 {
106 public:
107         /**
108          * 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.
109          *
110          * @since 2.0
111          */
112         CardLayout(void);
113
114         /**
115          * This destructor overrides Tizen::Base::Object::~Object().
116          *
117          * @since 2.0
118          */
119         virtual ~CardLayout(void);
120
121         /**
122          * Initializes this instance of %CardLayout.
123          *
124          * @since 2.0
125          *
126          * @return              An error code
127          * @exception   E_SUCCESS                       The method is successful.
128          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
129          */
130         result Construct(void);
131
132         /**
133          * Gets the type of the layout.
134          *
135          * @since 2.0
136          *
137          * @return      The layout type
138          */
139         virtual LayoutType GetLayoutType(void) const;
140
141 private:
142         //
143         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
144         //
145         CardLayout(const CardLayout& rhs);
146
147         //
148         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
149         //
150         CardLayout& operator =(const CardLayout& rhs);
151
152 }; // CardLayout
153
154 }} // Tizen::Ui
155
156 #endif // _FUI_CARD_LAYOUT_H_