2 // Open Service Platform
\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Flora License, Version 1.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://floralicense.org/license/
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an AS IS BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
20 * @brief This is the header file for the %Window class.
\r
22 * This header file contains the declarations of the %Window class.
\r
25 #ifndef _FUI_WINDOW_H_
\r
26 #define _FUI_WINDOW_H_
\r
28 #include <FBaseTypes.h>
\r
29 #include <FUiContainer.h>
\r
30 #include <FUiIWindowEventListener.h>
\r
32 namespace Tizen { namespace Ui { namespace Animations {
\r
33 class DisplayContext;
\r
36 namespace Tizen { namespace Ui
\r
44 * Defines the state of %Window.
\r
50 WINDOW_STATE_INITIALIZED = 0x0000, /**< The initial state of the window */
\r
51 WINDOW_STATE_ACTIVATED = 0x0001, /**< The state indicates that the window is the topmost window */
\r
52 WINDOW_STATE_DEACTIVATED = 0x0002, /**< The state indicates that the window is not the topmost window */
\r
56 * @enum WindowZOrderGroup
\r
58 * Defines the Z order group of %Window.
\r
62 enum WindowZOrderGroup
\r
64 WINDOW_Z_ORDER_GROUP_HIGHEST, /**< The highest group for windows such as the call screen */
\r
65 WINDOW_Z_ORDER_GROUP_HIGH, /**< The high group for windows such as the lock screen */
66 WINDOW_Z_ORDER_GROUP_NORMAL, /**< The default group of apps */
\r
71 * @brief This class provides abstract top-level 'window' objects.
\r
75 * The %Window class is an abstract base class.
76 * The %Window is a top-level window such as Controls::Frame, Controls::MessageBox, and Controls::Popup.
\r
77 * The descendants of a %Window can exist outside of their applications's bounds.
\r
80 class _OSP_EXPORT_ Window
\r
86 * This destructor overrides Tizen::Base::Object::~Object().
\r
90 virtual ~Window(void) = 0;
\r
94 * Adds the listener instance. @n
\r
95 * The added listener can listen to events on when they are fired.
\r
99 * @param[in] listener The event listener to add
\r
100 * @see RemoveWindowEventListener()
\r
102 void AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
\r
105 * Removes a listener instance. @n
\r
106 * The removed listener cannot listen to events when they are fired.
\r
110 * @param[in] listener The listener to remove
\r
111 * @see AddWindowEventListener()
\r
113 void RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
\r
116 * Shows the %Window.
\r
120 * @final Although this method is virtual, it should not be overridden.
\r
121 * If overridden, it may not work as expected.
\r
123 * @return An error code
\r
124 * @exception E_SUCCESS The method is successful.
\r
125 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
\r
126 * this control is not 'displayable'.
\r
127 * @exception E_SYSTEM A system error has occurred.
\r
129 virtual result Show(void);
\r
132 * Sets the owner of the window.
\r
136 * @param[in] pControl The control
\r
137 * @remarks The ownership of @c pControl is not transferred to this instance. It is the developer's responsibility to deallocate @c pControl even after calling this method.
\r
139 void SetOwner(Tizen::Ui::Control *pControl);
\r
142 * Gets the owner of the window.
\r
146 * @return The owner of the window
\r
149 Tizen::Ui::Control* GetOwner(void) const;
\r
152 * Sets the Z order group of %Window.
\r
156 * @privlevel platform
\r
157 * @privilege %http://tizen.org/privilege/uimanager
\r
159 * @return An error code
\r
160 * @param[in] windowZOrderGroup The Z order group of %Window
\r
161 * @exception E_SUCCESS The method is successful.
\r
162 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
163 * @remarks If this method is not explicitly called, the Z order group of %Window is set to #WINDOW_Z_ORDER_GROUP_NORMAL.
\r
165 result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup);
\r
168 * Gets the current state of the window.
\r
172 * @return The current state of the window
\r
174 WindowState GetWindowState(void) const;
\r
177 * Gets the display context of the window.
\r
181 * @return A pointer to the DisplayContext instance
\r
183 Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const;
\r
187 * Initializes this instance of %Window with the specified parameters.
191 * @return An error code
\r
192 * @param[in] rect The rectangle bounds to set
\r
193 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
195 * @param[in] movable Set to @c true to make the window movable, @n
\r
197 * @exception E_SUCCESS The method is successful.
\r
198 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
199 * @remarks This method must be called from the derived classes's construct methods.
\r
200 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
201 * @see IsResizable()
\r
203 result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
\r
206 * Initializes this instance of %Window.
\r
210 * @return An error code
\r
211 * @param[in] rect The rectangle bounds to set
\r
212 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
214 * @param[in] movable Set to @c true to make the window movable, @n
\r
216 * @exception E_SUCCESS The method is successful.
\r
217 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
218 * @remarks This method must be called from the derived classes's construct methods.
\r
219 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
220 * @see IsResizable()
\r
222 result Construct(const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
\r
225 * Initializes this instance of %Window with the specified layout and rectangular region.
\r
229 * @return An error code
\r
230 * @param[in] layout The layout for both the portrait and landscape mode
\r
231 * @param[in] rect The location and size of the %window
\r
232 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
234 * @param[in] movable Set to @c true to make the window movable, @n
\r
236 * @exception E_SUCCESS The method is successful.
\r
237 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
238 * @remarks This method must be called from the derived classes's construct methods.
\r
239 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
240 * @see IsResizable()
\r
241 * @see Tizen::Ui::Layout
\r
242 * @see Tizen::Ui::Container::GetLayoutN()
\r
244 result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
\r
247 * Initializes this instance of %Window with the specified layout and rectangular region.
\r
251 * @return An error code
\r
252 * @param[in] layout The layout for both the portrait and landscape mode
\r
253 * @param[in] rect The location and size of the %window
\r
254 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
256 * @param[in] movable Set to @c true to make the window movable, @n
\r
258 * @exception E_SUCCESS The method is successful.
\r
259 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
260 * @remarks This method must be called from the derived classes's construct methods.
\r
261 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
262 * @see IsResizable()
\r
263 * @see Tizen::Ui::Layout
\r
264 * @see Tizen::Ui::Container::GetLayoutN()
\r
266 result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
\r
269 * Initializes this instance of %Window with the specified layouts and rectangular region.
\r
273 * @return An error code
\r
274 * @param[in] portraitLayout The layout for the portrait mode
\r
275 * @param[in] landscapeLayout The layout for the landscape mode
\r
276 * @param[in] rect The location and size of the %Window
\r
277 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
279 * @param[in] movable Set to @c true to make the window movable, @n
\r
281 * @exception E_SUCCESS The method is successful.
\r
282 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
283 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
284 * @see IsResizable()
\r
285 * @see Tizen::Ui::Layout
\r
286 * @see Tizen::Ui::Layout
\r
287 * @see Tizen::Ui::Container::GetLayoutN()
\r
288 * @see Tizen::Ui::Container::GetPortraitLayoutN()
\r
289 * @see Tizen::Ui::Container::GetLandscapeLayoutN()
\r
291 result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
\r
294 * Initializes this instance of %Window with the specified layouts and rectangular region.
\r
298 * @return An error code
\r
299 * @param[in] portraitLayout The layout for the portrait mode
\r
300 * @param[in] landscapeLayout The layout for the landscape mode
\r
301 * @param[in] rect The location and size of the %Window
\r
302 * @param[in] resizable Set to @c true to make the window resizable, @n
\r
304 * @param[in] movable Set to @c true to make the window movable, @n
\r
306 * @exception E_SUCCESS The method is successful.
\r
307 * @exception E_INVALID_ARG A specified input parameter is invalid.
\r
308 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
\r
309 * @see IsResizable()
\r
310 * @see Tizen::Ui::Layout
\r
311 * @see Tizen::Ui::Layout
\r
312 * @see Tizen::Ui::Container::GetLayoutN()
\r
313 * @see Tizen::Ui::Container::GetPortraitLayoutN()
\r
314 * @see Tizen::Ui::Container::GetLandscapeLayoutN()
\r
316 result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true);
\r
319 * 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.
\r
327 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
\r
329 Window(const Window& rhs);
\r
332 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
\r
334 Window& operator =(const Window& rhs);
\r
337 friend class _WindowImpl;
\r
340 // This method is for internal use only. Using this method can cause behavioral,
\r
341 // security-related, and consistency-related issues in the application.
\r
343 // This method is reserved and may change its name at any time without prior notice.
\r
345 virtual void Window_Reserved1(void) {}
\r
348 // This method is for internal use only. Using this method can cause behavioral,
\r
349 // security-related, and consistency-related issues in the application.
\r
351 // This method is reserved and may change its name at any time without prior notice.
\r
353 virtual void Window_Reserved2(void) {}
\r
356 // This method is for internal use only. Using this method can cause behavioral,
\r
357 // security-related, and consistency-related issues in the application.
\r
359 // This method is reserved and may change its name at any time without prior notice.
\r
361 virtual void Window_Reserved3(void) {}
\r
364 // This method is for internal use only. Using this method can cause behavioral,
\r
365 // security-related, and consistency-related issues in the application.
\r
367 // This method is reserved and may change its name at any time without prior notice.
\r
369 virtual void Window_Reserved4(void) {}
\r
372 // This method is for internal use only. Using this method can cause behavioral,
\r
373 // security-related, and consistency-related issues in the application.
\r
375 // This method is reserved and may change its name at any time without prior notice.
\r
377 virtual void Window_Reserved5(void) {}
\r
382 #endif //_FUI_WINDOW_H_
\r