2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.
19 * @file FUiIOrientationEventListener.h
20 * @brief This is the header file for the %IOrientationEventListener interface.
22 * This header file contains the declarations of the %IOrientationEventListener interface. @n
23 * If an orientation event is generated, a method of this interface is called. @n
24 * So, if an application performs tasks related to the orientation event, use the methods of this interface.
28 #ifndef _FUI_IORIENTATION_EVENT_LISTENER_H_
29 #define _FUI_IORIENTATION_EVENT_LISTENER_H_
31 #include <FBaseRtIEventListener.h>
33 namespace Tizen { namespace Ui
40 * Defines the constants used to identify the orientations that a control supports.
46 ORIENTATION_NONE, /**< The control has no orientation style */
47 ORIENTATION_PORTRAIT, /**< The control has vertical orientation style */
48 ORIENTATION_LANDSCAPE, /**< The control has horizontal orientation style */
49 ORIENTATION_PORTRAIT_REVERSE, /**< The control has vertical upside-down orientation style */
50 ORIENTATION_LANDSCAPE_REVERSE, /**< The control has horizontal reverse orientation style */
51 ORIENTATION_AUTOMATIC = 6, /**< The control has vertical, horizontal, and horizontal reverse orientation styles */
52 ORIENTATION_AUTOMATIC_FOUR_DIRECTION = 8, /**< The control has four-directional orientation style */
56 * @enum OrientationStatus
58 * Defines the constants used to identify the current orientation of a control.
62 enum OrientationStatus
64 ORIENTATION_STATUS_NONE = 0, /**< The control orientation status is not determined @if OSPCOMPAT @b Since: @b 2.0 @endif */
65 ORIENTATION_STATUS_PORTRAIT = ORIENTATION_PORTRAIT, /**< The control is set to vertical orientation */
66 ORIENTATION_STATUS_LANDSCAPE = ORIENTATION_LANDSCAPE, /**< The control is set to horizontal orientation */
67 ORIENTATION_STATUS_PORTRAIT_REVERSE = ORIENTATION_PORTRAIT_REVERSE, /**< The control is set to vertical upside-down orientation */
68 ORIENTATION_STATUS_LANDSCAPE_REVERSE = ORIENTATION_LANDSCAPE_REVERSE, /**< The control is set to horizontal reverse orientation */
72 * @interface IOrientationEventListener
73 * @brief This interface implements the listener for orientation events.
77 * The %IOrientationEventListener interface is the listener interface for receiving orientation events.
78 * The class that processes an orientation event implements this interface, and the instance created with that class is registered
79 * with a UI control, using the control's AddOrientationEventListener() method. When the orientation event occurs, the
80 * OnOrientationChanged() method of that instance is invoked.
82 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_form.htm">Form</a>.
84 class _OSP_EXPORT_ IOrientationEventListener
85 : public Tizen::Base::Runtime::IEventListener
89 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
93 virtual ~IOrientationEventListener(void) {}
96 * Called when an orientation event occurs.
100 * @param[in] source The source of the event
101 * @param[in] orientationStatus The information about the orientation event
102 * @remarks The orientation changed event is fired on Control for which orientation mode change has been enabled by calling SetOrientation().
103 * @see Tizen::Ui::Controls::Frame
104 * @see Tizen::Ui::Controls::Form
106 virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus) = 0;
110 // This method is for internal use only. Using this method can cause behavioral, security-related,
111 // and consistency-related issues in the application.
113 // This method is reserved and may change its name at any time without prior notice.
115 virtual void IOrientationEventListener_Reserved1(void) {}
118 // This method is for internal use only. Using this method can cause behavioral, security-related,
119 // and consistency-related issues in the application.
121 // This method is reserved and may change its name at any time without prior notice.
123 virtual void IOrientationEventListener_Reserved2(void) {}
126 // This method is for internal use only. Using this method can cause behavioral, security-related,
127 // and consistency-related issues in the application.
129 // This method is reserved and may change its name at any time without prior notice.
131 virtual void IOrientationEventListener_Reserved3(void) {}
132 }; // IOrientationEventListener
136 #endif // _FUI_IORIENTATION_EVENT_LISTENER_H_