f2a3081f284096cab8e69216d3d996d930be6ef4
[platform/core/uifw/multi-assistant-service.git] / plugins / wakeup-manager / inc / wakeup_policy_default.h
1 /*
2  * Copyright 2018-2019 Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 #ifndef _WAKEUP_POLICY_DEFAULT_H_
18 #define _WAKEUP_POLICY_DEFAULT_H_
19
20 #include "wakeup_policy.h"
21
22 #include <vector>
23 #include <string>
24
25 #include <Ecore.h>
26
27 namespace multiassistant
28 {
29 namespace wakeup
30 {
31
32 using namespace std;
33
34 class CWakeupPolicyDefault : public CWakeupPolicy
35 {
36 public:
37         CWakeupPolicyDefault();
38         CWakeupPolicyDefault(IPolicyEventObserver *observer);
39         ~CWakeupPolicyDefault();
40
41         void set_assistant_priority(string appid, int priority);
42         void set_delay(float seconds);
43
44         void wakeup_candidate(mas_wakeup_event_info wakeup_info);
45         void timer_expired();
46 private:
47         typedef struct {
48                 string appid;
49                 int priority{0};
50         } PRIORITY_INFO;
51
52         float mDelaySeconds{0.0f};
53         vector<PRIORITY_INFO> mPriorityInfos;
54         vector<mas_wakeup_event_info> mWakeupInfos;
55
56         Ecore_Timer *mTimer{nullptr};
57 };
58
59 } // wakeup
60 } // multiassistant
61
62 #endif /* _WAKEUP_POLICY_H_ */