2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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>
58 #include <FUiCardLayout.h>
60 #include "CardLayoutSample.h"
62 using namespace Tizen::Graphics;
63 using namespace Tizen::Ui;
64 using namespace Tizen::Ui::Controls;
67 CardLayoutSample::Initialize(void)
69 // Creates an instance of CardLayout
70 CardLayout formLayout;
71 formLayout.Construct();
73 // Applies the card layout to the form
74 Construct(formLayout, FORM_STYLE_NORMAL);
79 CardLayoutSample::OnInitializing(void)
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));
88 // Adds the 1st panel to the form
89 AddControl(pFirstPanel);
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));
96 // Adds the 2nd panel to the form
97 AddControl(pSecondPanel);
104 class _OSP_EXPORT_ CardLayout
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.
116 * This destructor overrides Tizen::Base::Object::~Object().
120 virtual ~CardLayout(void);
123 * Initializes this instance of %CardLayout.
127 * @return An error code
128 * @exception E_SUCCESS The method is successful.
129 * @exception E_OUT_OF_MEMORY The memory is insufficient.
131 result Construct(void);
134 * Gets the type of the layout.
138 * @return The layout type
140 virtual LayoutType GetLayoutType(void) const;
144 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
146 CardLayout(const CardLayout& rhs);
149 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
151 CardLayout& operator =(const CardLayout& rhs);
157 #endif // _FUI_CARD_LAYOUT_H_