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(float width, float 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(float width, float height);
153 * Gets the measured size.
160 void GetMeasuredSize(float& width, float& height) const;
163 * Runs ILayoutItemHandler::OnItemMeasure.
166 * @param[inout] width
167 * @param[inout] height
170 void RunItemMeasure(float& width, float& 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;
207 bool GetContentSizeState(void) const;
211 * This is the copy constructor for this class.
215 LayoutItem(const LayoutItem&);
218 * This is the substitution operator for this class.
222 LayoutItem& operator =(const LayoutItem&);
225 * Sets the visible state.
227 * @return An error code
228 * @exception E_SUCCESS The method was successful.
229 * @exception E_INVALID_STATE This instance is in an invalid state.
232 void Visible(bool visible);
236 ILayoutItemHandler* __pOuterControl;
237 LayoutContainer* __pParentContainer;
239 LayoutSize __measuredSize;
240 bool __contentSizeState;
242 friend class LayoutItemProxy;
245 }}} //Tizen::Ui::_Layout
247 #endif // _FUI_INTERNAL_LAYOUT_LAYOUT_ITEM_H_