[Notification] Add API for using buttons and a text input in a notification and getti...
[platform/core/api/webapi-plugins.git] / src / notification / notification_manager.h
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 #ifndef NOTIFICATION_NOTIFICATION_MANAGER_H_
18 #define NOTIFICATION_NOTIFICATION_MANAGER_H_
19
20 #include <notification.h>
21
22 #include "common/picojson.h"
23 #include "common/platform_result.h"
24
25 namespace extension {
26 namespace notification {
27
28 typedef std::map<notification_block_state_e, std::string> BlockStateEnumMap;
29
30 class NotificationManager {
31  public:
32   static const BlockStateEnumMap block_state_map_;
33
34   static NotificationManager* GetInstance();
35
36   common::PlatformResult Post(const picojson::object& args, picojson::object& out);
37   common::PlatformResult PostUserNoti(const picojson::object& args, picojson::object& out);
38   common::PlatformResult Update(const picojson::object& args);
39   common::PlatformResult UpdateUserNoti(const picojson::object& args);
40   common::PlatformResult Remove(const picojson::object& args);
41   common::PlatformResult RemoveAll();
42   common::PlatformResult Get(const picojson::object& args, picojson::object& out,
43                              bool is_new_impl = false);
44   common::PlatformResult GetAll(picojson::array& out, bool is_new_impl = false);
45   common::PlatformResult GetBlockState(picojson::value& out);
46
47   common::PlatformResult PlayLEDCustomEffect(const picojson::object& args);
48   common::PlatformResult StopLEDCustomEffect();
49
50   // TODO needed also below functions for new design?
51   common::PlatformResult SaveTemplate(const picojson::object& args);
52   common::PlatformResult CreateFromTemplate(const picojson::object& args, picojson::object& out);
53
54  private:
55   NotificationManager();
56   virtual ~NotificationManager();
57 };
58
59 }  // namespace notification
60 }  // namespace extension
61
62 #endif /* NOTIFICATION_NOTIFICATION_MANAGER_H_ */