Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiIOrientationEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file                FUiIOrientationEventListener.h
20  * @brief               This is the header file for the %IOrientationEventListener interface.
21  *
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.
25  *
26  */
27
28 #ifndef _FUI_IORIENTATION_EVENT_LISTENER_H_
29 #define _FUI_IORIENTATION_EVENT_LISTENER_H_
30
31 #include <FBaseRtIEventListener.h>
32
33 namespace Tizen { namespace Ui
34 {
35 class Control;
36
37 /**
38  * @enum Orientation
39  *
40  * Defines the constants used to identify the orientations that a control supports.
41  *
42  * @since  2.0
43  */
44 enum Orientation
45 {
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 */
53 };
54
55 /**
56  * @enum OrientationStatus
57  *
58  * Defines the constants used to identify the current orientation of a control.
59  *
60  * @since   2.0
61  */
62 enum OrientationStatus
63 {
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 */
69 };
70
71 /**
72  * @interface           IOrientationEventListener
73  * @brief                       This interface implements the listener for orientation events.
74  *
75  * @since                       2.0
76  *
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.
81  * @n
82  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_form.htm">Form</a>.
83  */
84 class _OSP_EXPORT_ IOrientationEventListener
85         : public Tizen::Base::Runtime::IEventListener
86 {
87 public:
88         /**
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.
90          *
91          * @since                       2.0
92          */
93         virtual ~IOrientationEventListener(void) {}
94
95         /**
96          * Called when an orientation event occurs.
97          *
98          * @since       2.0
99          *
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
105          */
106         virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus) = 0;
107
108 protected:
109         //
110         // This method is for internal use only. Using this method can cause behavioral, security-related,
111         // and consistency-related issues in the application.
112         //
113         // This method is reserved and may change its name at any time without prior notice.
114         //
115         virtual void IOrientationEventListener_Reserved1(void) {}
116
117         //
118         // This method is for internal use only. Using this method can cause behavioral, security-related,
119         // and consistency-related issues in the application.
120         //
121         // This method is reserved and may change its name at any time without prior notice.
122         //
123         virtual void IOrientationEventListener_Reserved2(void) {}
124
125         //
126         // This method is for internal use only. Using this method can cause behavioral, security-related,
127         // and consistency-related issues in the application.
128         //
129         // This method is reserved and may change its name at any time without prior notice.
130         //
131         virtual void IOrientationEventListener_Reserved3(void) {}
132 }; // IOrientationEventListener
133
134 }} // Tizen::Ui
135
136 #endif // _FUI_IORIENTATION_EVENT_LISTENER_H_