2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
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 NOTIFICATION_USER_NOTIFICATION_H_
18 #define NOTIFICATION_USER_NOTIFICATION_H_
20 #include "notification/common_notification.h"
23 namespace notification {
25 class UserNotification : public CommonNotification {
27 XW_EXPORT static common::PlatformResult ToJson(int id, notification_h noti_handle,
28 app_control_h app_handle,
29 picojson::object* out_ptr);
30 XW_EXPORT static common::PlatformResult GetNotiHandleFromJson(const picojson::value& noti_val,
32 notification_h* noti_handle);
33 static common::PlatformResult PostUserNotification(const picojson::object& args, bool is_update,
34 picojson::object* out_ptr);
36 static common::PlatformResult AddTextContentsToJson(notification_h noti_handle,
37 std::string noti_type_str,
38 picojson::object* out_ptr);
39 static common::PlatformResult AddImagesToJson(notification_h noti_handle,
40 picojson::object* out_ptr);
41 static common::PlatformResult AddThumbnailsToJson(notification_h noti_handle,
42 picojson::object* out_ptr);
43 static common::PlatformResult AddActionsToJson(notification_h noti_handle,
44 app_control_h app_handle,
45 picojson::object* out_ptr);
46 static common::PlatformResult AddGroupContentsToJson(notification_h noti_handle,
47 picojson::object* out_ptr);
48 static common::PlatformResult AddLedsToJson(notification_h noti_handle,
49 picojson::object* out_ptr);
51 static common::PlatformResult SetTextContentsFromJson(const picojson::value& noti_val,
52 bool is_update, notification_h noti_handle);
53 static common::PlatformResult SetImagesFromJson(const picojson::value& noti_val,
54 notification_h noti_handle);
55 static common::PlatformResult SetThumbnailsFromJson(const picojson::value& noti_val,
56 notification_h noti_handle);
57 static common::PlatformResult SetActionsFromJson(const picojson::value& noti_val,
58 notification_h noti_handle);
59 static common::PlatformResult SetGroupContentsFromJson(const picojson::value& noti_val,
60 notification_h noti_handle);
61 static common::PlatformResult SetLedsFromJson(const picojson::value& noti_val,
62 notification_h noti_handle);
66 virtual ~UserNotification();
69 } // namespace notification
70 } // namespace extension
72 #endif /* NOTIFICATION_USER_NOTIFICATION_H_ */