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.
20 * @brief This is the header file for the %Window class.
22 * This header file contains the declarations of the %Window class.
25 #ifndef _FUI_WINDOW_H_
26 #define _FUI_WINDOW_H_
28 #include <FBaseTypes.h>
29 #include <FUiContainer.h>
30 #include <FUiIWindowEventListener.h>
32 namespace Tizen { namespace Ui { namespace Animations {
36 namespace Tizen { namespace Ui
44 * Defines the state of %Window.
50 WINDOW_STATE_INITIALIZED = 0x0000, /**< The initial state of the window */
51 WINDOW_STATE_ACTIVATED = 0x0001, /**< The state indicates that the window is the topmost window */
52 WINDOW_STATE_DEACTIVATED = 0x0002, /**< The state indicates that the window is not the topmost window */
56 * @enum WindowZOrderGroup
58 * Defines the Z order group of %Window.
62 enum WindowZOrderGroup
64 WINDOW_Z_ORDER_GROUP_HIGHEST, /** The highest group for windows such as the call screen */
65 WINDOW_Z_ORDER_GROUP_HIGH, /** The high qroup for windows such as the lock screen */
66 WINDOW_Z_ORDER_GROUP_NORMAL, /** The default group of apps */
71 * @brief This class provides abstract top-level 'window' objects.
75 * The %Window is a top-level window such as Controls::Frame, Controls::MessageBox, and Controls::Popup.
76 * The descendants of a %Window can exist outside of their applications's bounds.
77 * The %Window class is an abstract base class.
80 class _OSP_EXPORT_ Window
86 * This destructor overrides Tizen::Base::Object::~Object().
90 virtual ~Window(void) = 0;
93 * Adds the listener instance. @n
94 * The added listener can listen to events on when they are fired.
98 * @param[in] listener The event listener to add
99 * @see RemoveWindowEventListener()
101 void AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
104 * Removes a listener instance. @n
105 * The removed listener cannot listen to events when they are fired.
109 * @param[in] listener The listener to remove
110 * @see AddWindowEventListener()
112 void RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
119 * @final Although this method is virtual, it should not be overridden.
120 * If overridden, it may not work as expected.
122 * @return An error code
123 * @exception E_SUCCESS The method is successful.
124 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
125 * this control is not 'displayable'.
126 * @exception E_SYSTEM A system error has occurred.
128 virtual result Show(void);
131 * Sets the owner of the window.
135 * @param[in] pControl The control
136 * @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.
138 void SetOwner(Tizen::Ui::Control *pControl);
141 * @if VISPARTNER-OPERATOR
142 * Sets the Z order group of %Window.
146 * @visibility partner-operator
147 * @privilege %http://tizen.org/privilege/uimanager
149 * @return An error code
150 * @param[in] windowZOrderGroup The Z order group of %Window
151 * @exception E_SUCCESS The method is successful.
152 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
153 * @remarks If this method is not explicitly called, the Z order group of %Window is set to #WINDOW_Z_ORDER_GROUP_NORMAL.
156 result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup);
159 * Gets the current state of the window.
163 * @return The current state of the window
165 WindowState GetWindowState(void) const;
168 * Gets the display context of the window.
172 * @return A pointer to the DisplayContext instance
174 Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const;
178 * Initializes this instance of %Window.
182 * @return An error code
183 * @param[in] rect The rectangle bounds to set
184 * @param[in] resizable Set to @c true to make the window resizable, @n
186 * @param[in] movable Set to @c true to make the window movable, @n
188 * @exception E_SUCCESS The method is successful.
189 * @exception E_INVALID_ARG A specified input parameter is invalid.
190 * @remarks This method must be called from the derived classes's construct methods.
191 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
194 result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
197 * Initializes this instance of %Window with the specified layout and rectangular region.
201 * @return An error code
202 * @param[in] layout The layout for both the portrait and landscape mode
203 * @param[in] rect The location and size of the %window
204 * @param[in] resizable Set to @c true to make the window resizable, @n
206 * @param[in] movable Set to @c true to make the window movable, @n
208 * @exception E_SUCCESS The method is successful.
209 * @exception E_INVALID_ARG A specified input parameter is invalid.
210 * @remarks This method must be called from the derived classes's construct methods.
211 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
213 * @see Tizen::Ui::Layout
214 * @see Tizen::Ui::Container::GetLayoutN()
216 result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
219 * Initializes this instance of %Window with the specified layouts and rectangular region.
223 * @return An error code
224 * @param[in] portraitLayout The layout for the portrait mode
225 * @param[in] landscapeLayout The layout for the landscape mode
226 * @param[in] rect The location and size of the %Window
227 * @param[in] resizable Set to @c true to make the window resizable, @n
229 * @param[in] movable Set to @c true to make the window movable, @n
231 * @exception E_SUCCESS The method is successful.
232 * @exception E_INVALID_ARG A specified input parameter is invalid.
233 * @remarks If the @c resizable is @c false, IsResizable() returns @c false.
235 * @see Tizen::Ui::Layout
236 * @see Tizen::Ui::Container::GetLayoutN()
237 * @see Tizen::Ui::Container::GetPortraitLayoutN()
238 * @see Tizen::Ui::Container::GetLandscapeLayoutN()
240 result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
243 * 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.
251 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
253 Window(const Window& rhs);
256 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
258 Window& operator =(const Window& rhs);
261 friend class _WindowImpl;
264 // This method is for internal use only. Using this method can cause behavioral,
265 // security-related, and consistency-related issues in the application.
267 // This method is reserved and may change its name at any time without prior notice.
269 virtual void Window_Reserved1(void) {}
272 // This method is for internal use only. Using this method can cause behavioral,
273 // security-related, and consistency-related issues in the application.
275 // This method is reserved and may change its name at any time without prior notice.
277 virtual void Window_Reserved2(void) {}
280 // This method is for internal use only. Using this method can cause behavioral,
281 // security-related, and consistency-related issues in the application.
283 // This method is reserved and may change its name at any time without prior notice.
285 virtual void Window_Reserved3(void) {}
288 // This method is for internal use only. Using this method can cause behavioral,
289 // security-related, and consistency-related issues in the application.
291 // This method is reserved and may change its name at any time without prior notice.
293 virtual void Window_Reserved4(void) {}
296 // This method is for internal use only. Using this method can cause behavioral,
297 // security-related, and consistency-related issues in the application.
299 // This method is reserved and may change its name at any time without prior notice.
301 virtual void Window_Reserved5(void) {}
306 #endif //_FUI_WINDOW_H_