tizen 2.4 release
[framework/context/context-common.git] / include / timer_mgr_iface.h
1 /*
2  * Copyright (c) 2015 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 #ifndef __CONTEXT_TIMER_MANAGER_INTERFACE_H__
18 #define __CONTEXT_TIMER_MANAGER_INTERFACE_H__
19
20 namespace ctx {
21         /* Forward Declaration */
22         class timer_listener_iface;
23
24         class timer_manager_iface {
25                 public:
26                         virtual ~timer_manager_iface() {}
27
28                         /**
29                          * @brief       Sets a timer notifying at every @c interval minutes.
30                          * @param[in]   interval        Repeating interval. Seconds.
31                          * @param[in]   listener        Listener object.
32                          * @return      A timer identifier that can be used to distinguish timers.
33                          *                      The same ID will be delivered whenever the timer is expired.
34                          */
35                         virtual int set_for(int interval, timer_listener_iface* listener, void* user_data) = 0;
36
37                         /**
38                          * @brief       Sets a timer notifying at specific time at every days of week designated.
39                          * @param[in]   hour            Hour
40                          * @param[in]   min                     Minute
41                          * @param[in]   day_of_week     The timer will expire at hour:min:00, at every day(s) of week designated here.
42                          * @param[in]   listener        Listener object.
43                          * @return      A timer identifier that can be used to distinguish timers.
44                          *                      The same ID will be delivered whenever the timer is expired.
45                          */
46                         virtual int set_at(int hour, int min, int day_of_week, timer_listener_iface* listener, void* user_data) = 0;
47
48                         virtual void remove(int timer_id) = 0;
49         };
50
51         namespace timer_manager {
52                 void set_instance(timer_manager_iface* mgr);
53         }
54 }       /* namespace ctx */
55
56 #endif  /* __CONTEXT_TIMER_MANAGER_INTERFACE_H__ */