2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FUiCardLayout.h
20 * @brief This is the header file for the %CardLayout class.
22 * This header file contains the declarations of the %CardLayout class.
25 #ifndef _FUI_CARD_LAYOUT_H_
26 #define _FUI_CARD_LAYOUT_H_
28 #include <FUiLayout.h>
30 namespace Tizen { namespace Ui
36 * @brief The card layout fits a child control to the container by changing the position and the size of the child control.
40 * The %CardLayout class defines the card layout for a container.@n
43 // Sample code for CardLayoutSample.h
46 class CardLayoutSample
47 : public Tizen::Ui::Controls::Form
50 bool Initialize(void);
51 virtual result OnInitializing(void);
56 // Sample code for CardLayoutSample.cpp
57 #include <FGraphics.h>
59 #include "CardLayoutSample.h"
61 using namespace Tizen::Graphics;
62 using namespace Tizen::Ui;
63 using namespace Tizen::Ui::Controls;
66 CardLayoutSample::Initialize(void)
68 // Creates an instance of CardLayout
69 CardLayout formLayout;
70 formLayout.Construct();
72 // Applies the card layout to the form
73 Construct(formLayout, FORM_STYLE_NORMAL);
78 CardLayoutSample::OnInitializing(void)
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));
87 // Adds the 1st panel to the form
88 AddControl(*pFirstPanel);
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));
95 // Adds the 2nd panel to the form
96 AddControl(*pSecondPanel);
103 class _OSP_EXPORT_ CardLayout
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.
115 * This destructor overrides Tizen::Base::Object::~Object().
119 virtual ~CardLayout(void);
122 * Initializes this instance of %CardLayout.
126 * @return An error code
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_OUT_OF_MEMORY The memory is insufficient.
130 result Construct(void);
133 * Gets the type of the layout.
137 * @return The layout type
139 virtual LayoutType GetLayoutType(void) const;
143 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
145 CardLayout(const CardLayout& rhs);
148 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
150 CardLayout& operator =(const CardLayout& rhs);
156 #endif // _FUI_CARD_LAYOUT_H_