Revert "Revert "Fix intApp TC failure""
[platform/framework/native/appfw.git] / inc / FSysIScreenEventListener.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FSysIScreenEventListener.h
19  * @brief       This is the header file for the %IScreenEventListener interface.
20  *
21  * This header file contains the declarations of the %IScreenEventListener interface.
22  */
23
24 #ifndef _FSYS_ISCREEN_EVENT_LISTENER_H_
25 #define _FSYS_ISCREEN_EVENT_LISTENER_H_
26
27 #include <FBaseResult.h>
28 #include <FBaseRtIEventListener.h>
29
30 namespace Tizen { namespace System
31 {
32
33 /**
34  * @interface   IScreenEventListener
35  * @brief               This interface is the listener of the screen event.
36  *
37  * @since       2.0
38  *
39  * The %IScreenEventListener interface must be registered and implemented by an application to receive screen events from the system.
40  *
41  */
42 class _OSP_EXPORT_ IScreenEventListener
43         : public virtual Tizen::Base::Runtime::IEventListener
44 {
45 public:
46         /**
47          * Called when the screen turns on. @n
48          * Gets the released resources or resumes the operations that were paused or stopped in OnScreenOff().
49          *
50          * @since 2.0
51          */
52         virtual void OnScreenOn(void) = 0;
53
54         /**
55          * Called when the screen turns off. @n
56          * Unless there is a strong reason to do otherwise, release the resources (such as 3D, media, and sensors) to allow the device 
57          * to enter the sleep mode to save the battery. @n
58          * Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a 
59          * callback before the device enters the sleep mode. Similarly, do not perform lengthy operations in this listener method. @n
60          * All operations must be quick ones.
61          *
62         *@since 2.0
63          */
64         virtual void OnScreenOff(void) = 0;
65
66         /**
67          * Called when the screen brightness is changed.
68          *
69          * @since 2.1
70          *
71          * @param[in]   brightness         The screen brightness between @c 0 to @c 10
72          */
73         virtual void OnScreenBrightnessChanged(int brightness) {}
74
75
76 protected:
77         //
78         // This method is for internal use only.
79         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
80         //
81         // @since 2.0
82         virtual void OnIScreenEventListener_Reserved1(void) {}
83
84         //
85         // This method is for internal use only.
86         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
87         //
88         // @since 2.0
89         virtual void OnIScreenEventListener_Reserved2(void) {}
90
91 }; // IScreenEventListener
92
93 } } // Tizen::System
94
95 #endif // _FSYS_ISCREEN_EVENT_LISTENER_H_