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.
18 * @file FUi_LayoutLayoutItem.h
19 * @brief This is the header file for LayoutItem class.
21 * This header file contains the declaration of LayoutItem class.
26 #ifndef _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_H_
27 #define _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_H_
29 #include <FBaseObject.h>
30 #include <FBaseErrors.h>
31 #include <FGrpRectangle.h>
32 #include <FOspConfig.h>
33 #include "FUi_LayoutLayoutTypes.h"
34 #include "FUi_LayoutILayoutItemHandler.h"
36 namespace Tizen { namespace Ui
49 class LayoutContainer;
51 class _OSP_EXPORT_ LayoutItem
52 : public Tizen::Base::Object
56 * This is the default constructor for this class.
63 * This is the destructor for this class.
67 virtual ~LayoutItem(void);
70 * Gets the layout of parent container.
72 * @return The layout of parent container.
75 Layout* GetIncludedLayout(void) const;
78 * Sets the base rect when the bounds of container has been changed.
80 * @return An error code
81 * @exception E_SUCCESS The method was successful.
82 * @exception E_INVALID_STATE This instance is in an invalid state.
85 result OnChangeBaseRect(void);
88 * Sets the item handler.
93 void SetItemHandler(ILayoutItemHandler* pOuterControl);
96 * Gets the layoutable flag.
101 bool GetLayoutable(void);
104 * Converts the window bounds to client bounds.
106 * @param[in] windowRect
107 * @param[out] clientRect
110 void ConvertWindowToClientBounds(const LayoutRect windowRect, LayoutRect& clientRect);
114 * Determines the basic size for calculating size.
116 * @return An error code
119 * @exception E_SUCCESS The method was successful.
120 * @exception E_INVALID_STATE This instance is in an invalid state.
123 virtual result Measure(int width, int height);
126 * Sets the parent container.
129 * @param[in] pParentContainer
132 void SetParentContainer(LayoutContainer* pParentContainer);
135 * Gets the parent container.
137 * @return The parent container.
140 LayoutContainer* GetParentContainer(void) const;
143 * Sets the measured size.
150 void SetMeasuredSize(int width, int height);
153 * Gets the measured size.
160 void GetMeasuredSize(int& width, int& height) const;
163 * Runs ILayoutItemHandler::OnItemMeasure.
166 * @param[inout] width
167 * @param[inout] height
170 void RunItemMeasure(int& width, int& height);
173 * Gets the minimum size of _Control.
175 * @param[out] minSize
178 void GetMinSize(LayoutSize& minSize) const;
181 * Gets the maximum size of _Control.
183 * @param[out] maxSize
186 void GetMaxSize(LayoutSize& maxSize) const;
189 * Sets the bounds of _Control.
191 * @return An error code
193 * @exception E_SUCCESS The method was successful.
194 * @exception E_INVALID_STATE This instance is in an invalid state.
197 result SetItemWindowRect(const LayoutRect rect);
200 * Gets the bounds of _Control.
205 void GetItemWindowRect(LayoutRect& rect) const;
209 * This is the copy constructor for this class.
213 LayoutItem(const LayoutItem&);
216 * This is the substitution operator for this class.
220 LayoutItem& operator =(const LayoutItem&);
223 * Sets the visible state.
225 * @return An error code
226 * @exception E_SUCCESS The method was successful.
227 * @exception E_INVALID_STATE This instance is in an invalid state.
230 void Visible(bool visible);
234 ILayoutItemHandler* __pOuterControl;
235 LayoutContainer* __pParentContainer;
237 LayoutSize __measuredSize;
239 friend class LayoutItemProxy;
242 }}} //Tizen::Ui::_Layout
244 #endif // _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_H_