2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __CONTEXT_TIMER_MANAGER_INTERFACE_H__
18 #define __CONTEXT_TIMER_MANAGER_INTERFACE_H__
21 /* Forward Declaration */
22 class timer_listener_iface;
24 class timer_manager_iface {
26 virtual ~timer_manager_iface() {}
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.
35 virtual int set_for(int interval, timer_listener_iface* listener, void* user_data) = 0;
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.
46 virtual int set_at(int hour, int min, int day_of_week, timer_listener_iface* listener, void* user_data) = 0;
48 virtual void remove(int timer_id) = 0;
51 namespace timer_manager {
52 void set_instance(timer_manager_iface* mgr);
56 #endif /* __CONTEXT_TIMER_MANAGER_INTERFACE_H__ */