From bf1a00e6e889df86d47968ba714aec5524373e8f Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 12 Nov 2019 14:36:28 +0900 Subject: Add internal api to support C# - Free string list Change-Id: I72b06a6559e844254ea26a07927422db78f4d718 Signed-off-by: hyunho --- notification-ex/abstract_item.h | 4 + notification-ex/api/notification_ex_internal.h | 43 ++++++++ notification-ex/group_item.cc | 6 ++ notification-ex/group_item.h | 6 ++ notification-ex/stub.cc | 130 +++++++++++++++++++++++++ notification-ex/time_item.cc | 4 + notification-ex/time_item.h | 1 + 7 files changed, 194 insertions(+) create mode 100644 notification-ex/api/notification_ex_internal.h (limited to 'notification-ex') diff --git a/notification-ex/abstract_item.h b/notification-ex/abstract_item.h index a5cef50..83bddb1 100644 --- a/notification-ex/abstract_item.h +++ b/notification-ex/abstract_item.h @@ -694,6 +694,10 @@ class EXPORT_API LEDInfo { return color_; } + void SetColor(std::shared_ptr color) { + color_ = std::move(color); + } + private: std::shared_ptr color_; int on_period_ = 0; diff --git a/notification-ex/api/notification_ex_internal.h b/notification-ex/api/notification_ex_internal.h new file mode 100644 index 0000000..eda78a1 --- /dev/null +++ b/notification-ex/api/notification_ex_internal.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ +#define __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +int noti_ex_item_free_string_list(char** list, int count); +int noti_ex_item_group_remove_children(noti_ex_item_h handle); +int noti_ex_item_time_set_time(noti_ex_item_h handle, + time_t time); + +int noti_ex_style_set_geometry( + noti_ex_style_h handle, noti_ex_geometry_h geometry); +int noti_ex_style_set_color( + noti_ex_style_h handle, noti_ex_color_h color); +int noti_ex_style_set_padding(noti_ex_style_h handle, + noti_ex_padding_h padding); + +int noti_ex_led_info_set_color( + noti_ex_led_info_h handle, noti_ex_color_h color); + + +#ifdef __cplusplus +} +#endif +#endif /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */ \ No newline at end of file diff --git a/notification-ex/group_item.cc b/notification-ex/group_item.cc index cd2569e..965e6c8 100644 --- a/notification-ex/group_item.cc +++ b/notification-ex/group_item.cc @@ -192,6 +192,12 @@ void GroupItem::RemoveChild(string itemId) { } } +void GroupItem::RemoveChildren() { + for (auto& i : impl_->children_list_) { + impl_->children_list_.remove(i); + } +} + list> GroupItem::GetChildren() { return impl_->children_list_; } diff --git a/notification-ex/group_item.h b/notification-ex/group_item.h index dd29fbb..29d38ba 100644 --- a/notification-ex/group_item.h +++ b/notification-ex/group_item.h @@ -166,6 +166,12 @@ class EXPORT_API GroupItem : public AbstractItem { */ void RemoveChild(std::string itemId); + /** + * @brief Removes children. + * @since_tizen 5.5 + */ + void RemoveChildren(); + /** * @brief Gets the list of children item of GroupItem. * @since_tizen 5.5 diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 0e37fe1..7ca6841 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -38,6 +38,8 @@ #include "api/notification_ex_text.h" #include "api/notification_ex_time.h" #include "api/notification_ex_visibility_action.h" +#include "api/notification_ex_visibility_action.h" +#include "api/notification_ex_internal.h" #include "notification-ex/reporter.h" #include "notification-ex/app_control_action.h" #include "notification-ex/button_item.h" @@ -1460,6 +1462,26 @@ extern "C" EXPORT_API int noti_ex_style_get_padding(noti_ex_style_h handle, return NOTI_EX_ERROR_NONE; } + +extern "C" EXPORT_API int noti_ex_style_set_padding(noti_ex_style_h handle, + noti_ex_padding_h padding) { + if (handle == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + shared_ptr