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_LayoutLayoutContainer.h
19 * @brief This is the header file for LayoutContainer class.
21 * This header file contains the declaration of LayoutContainer class.
26 #ifndef _FUI_INTERNAL_LAYOUT_LAYOUT_CONTAINER_H_
27 #define _FUI_INTERNAL_LAYOUT_LAYOUT_CONTAINER_H_
29 #include "FUi_LayoutLayoutItem.h"
41 class _OSP_EXPORT_ LayoutContainer
46 * This is the default constructor for this class.
50 LayoutContainer(void);
53 * This is the destructor for this class.
57 virtual ~LayoutContainer(void);
60 * Sets the current layout to specified layout that is in layout list.
62 * @return An error code
63 * @exception E_SUCCESS The method was successful.
64 * @exception E_INVALID_ARG The input layout is not exist in layout list.
67 result SetCurrentLayout(Layout& layout);
70 * Adds the specified layout to the layout list.
72 * @return An error code
73 * @param[in] layout The layout to add to list.
74 * @exception E_SUCCESS The method was successful.
75 * @exception E_INVALID_STATE This instance is in an invalid state.
76 * @exception E_OUT_OF_MEMORY Insufficient memory.
79 result AddLayout(Layout& layout);
82 * Gets the current layout of container.
84 * @return The current layout.
87 Layout* GetLayout(void) const;
90 * Sets the default layout to specified layout.
92 * @return An error code
93 * @param[in] layout The default layout.
94 * @exception E_SUCCESS The method was successful.
95 * @exception E_INVALID_ARG The input layout is not exist in layout list.
98 result SetDefaultLayout(Layout& layout);
101 * Gets the default layout.
103 * @return The default layout.
106 Layout* GetDefaultLayout(void) const;
109 * Checks whether the specified layout exists in list.
111 * @return @c true, if the layout exists @n
112 * @c false, otherwise
113 * @param[in] The layout to check.
116 bool LayoutExists(Layout& layout);
119 * Adds the item to all layout of container.
121 * @return An error code
122 * @param[in] addItem The item to add the layout.
123 * @exception E_SUCCESS The method was successful.
124 * @exception E_INVALID_STATE This instance is in an invalid state.
127 result AddItem(LayoutItem& addItem);
130 * Removes the item from all layout of container.
132 * @return An error code
133 * @param[in] removeItem The item to remove from the layout.
134 * @exception E_SUCCESS The method was successful.
135 * @exception E_INVALID_STATE This instance is in an invalid state.
138 result RemoveItem(LayoutItem& removeItem);
142 * This is the copy constructor for this class.
146 LayoutContainer(const LayoutContainer&);
149 * This is the substitution operator for this class.
153 LayoutContainer& operator =(const LayoutContainer&);
156 * Sets the intended window size.
159 * @param[in] intendedWindowSize
162 void SetIntendedWindowSize(const LayoutSize intendedWindowSize);
165 * Gets the intended window size.
167 * @return Intended window size.
170 LayoutSize GetIntendedWindowSize(void) const;
173 * Determines the basic size for calculating size for all children.
175 * @return An error code
178 * @exception E_SUCCESS The method was successful.
179 * @exception E_INVALID_STATE This instance is in an invalid state.
182 virtual result Measure(int width, int height);
185 * This method is not used currently.
187 * @return An error code
188 * @param[in] deletedLayout
189 * @exception E_SUCCESS The method was successful.
190 * @exception E_INVALID_STATE This instance is in an invalid state.
193 result OnSetDefaultLayout(Layout& deletedLayout);
196 * Removes the item from layout when the item has been destroyed.
198 * @return An error code
199 * @param[in] deletedLayout The deleted item.
200 * @exception E_SUCCESS The method was successful.
201 * @exception E_INVALID_STATE This instance is in an invalid state.
204 void OnDestroyItem(LayoutItem& item);
207 * Removes the layout from list when the layout has been destroyed.
209 * @return An error code
210 * @param[in] pItem The deleted layout.
211 * @exception E_SUCCESS The method was successful.
212 * @exception E_INVALID_STATE This instance is in an invalid state.
215 void OnDestroyLayout(Layout& layout);
218 * Sets the container when the contaier proxy has been destroyed.
220 * @return An error code
221 * @exception E_SUCCESS The method was successful.
222 * @exception E_INVALID_STATE This instance is in an invalid state.
225 void OnDestroyContainerProxy(void);
227 LayoutList* GetLayoutList(void);
231 //_Control* __pOuterContainer;
232 Layout* __pCurrentLayout;
233 LayoutSize __intendedWindowSize;
235 LayoutList* __pLayoutList;
237 bool __defaultLayoutFlag;
240 friend class LayoutItem;
241 friend class LayoutItemProxy;
242 }; // LayoutContainer
244 }}} //Tizen::Ui::_Layout
246 #endif // _FUI_INTERNAL_LAYOUT_LAYOUT_CONTAINER_H_