tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / Power / EventLow.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef WRTDEVICEAPIS_POWER_EVENTLOW_H_
17 #define WRTDEVICEAPIS_POWER_EVENTLOW_H_
18
19 #include <dpl/shared_ptr.h>
20 #include <Commons/ListenerEvent.h>
21 #include <Commons/ListenerEventEmitter.h>
22
23 namespace WrtDeviceApis {
24 namespace Power {
25 namespace Api {
26
27 /**
28  * Events emitted when battery reaches low power level.
29  */
30 class EventLow : public Commons::ListenerEvent<EventLow>
31 {
32   public:
33     EventLow();
34     virtual ~EventLow();
35
36     /**
37      * Gets remaining battery power (in percents).
38      * @return Remaining battery power.
39      * @remarks Read on the side that receives this event.
40      */
41     unsigned int getResult() const;
42
43     /**
44      * Sets remaining battery power.
45      * @param result Remining battery power.
46      * @remarks Set on the side that emits this event.
47      */
48     void setResult(unsigned int result);
49
50   private:
51     unsigned int m_result; ///< Remaining battery power (in percents).
52 };
53
54 typedef DPL::SharedPtr<EventLow> EventLowPtr;
55 typedef Commons::ListenerEventEmitter<EventLow> EventLowEmitter;
56 typedef DPL::SharedPtr<EventLowEmitter> EventLowEmitterPtr;
57
58 } // Api
59 } // Power
60 } // WrtDeviceApis
61
62 #endif /* WRTDEVICEAPIS_POWER_EVENTLOW_H_ */