Merge "Do Not Use Repository in Build Script" into tizen
[platform/core/api/webapi-plugins.git] / src / alarm / alarm_instance.cc
1 /*
2  * Copyright (c) 2015 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
17 #include "alarm_instance.h"
18
19 #include "common/picojson.h"
20 #include "common/logger.h"
21
22 namespace extension {
23 namespace alarm {
24
25 using namespace common;
26
27 AlarmInstance::AlarmInstance() {
28   LoggerD("Entered");
29   using namespace std::placeholders;
30
31   RegisterSyncHandler("AlarmManager_add",
32                       std::bind(&AlarmManager::Add, &manager_, _1, _2));
33   RegisterSyncHandler("AlarmManager_addAlarmNotification",
34                       std::bind(&AlarmManager::AddAlarmNotification, &manager_, _1, _2));
35   RegisterSyncHandler("AlarmManager_remove",
36                       std::bind(&AlarmManager::Remove, &manager_, _1, _2));
37   RegisterSyncHandler("AlarmManager_removeAll",
38                       std::bind(&AlarmManager::RemoveAll, &manager_, _1, _2));
39   RegisterSyncHandler("AlarmManager_get",
40                       std::bind(&AlarmManager::Get, &manager_, _1, _2));
41   RegisterSyncHandler("AlarmManager_getAlarmNotification",
42                       std::bind(&AlarmManager::GetAlarmNotification, &manager_, _1, _2));
43   RegisterSyncHandler("AlarmManager_getAll",
44                       std::bind(&AlarmManager::GetAll, &manager_, _1, _2));
45   //AlarmRelative
46   RegisterSyncHandler("AlarmRelative_getRemainingSeconds",
47                       std::bind(&AlarmManager::GetRemainingSeconds, &manager_, _1, _2));
48   //AlarmAbsolute
49   RegisterSyncHandler("AlarmAbsolute_getNextScheduledDate",
50                       std::bind(&AlarmManager::GetNextScheduledDate, &manager_, _1, _2));
51 }
52
53 AlarmInstance::~AlarmInstance() {
54   LoggerD("Entered");
55 }
56
57 } // namespace Alarm
58 } // namespace extension