From 2850c6fa4a6b5aa1caf501c76aa00aeedfb91f23 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Tue, 6 Aug 2019 10:19:28 +0900 Subject: Update new apis in stub Change-Id: I0dd4f8c7a6783fed85aa3178b8cbc28b117a4b10 Signed-off-by: mk5004.lee --- notification-ex/api/notification_ex_checkbox.h | 6 +- notification-ex/api/notification_ex_event_info.h | 10 +- notification-ex/api/notification_ex_item.h | 56 +++++ notification-ex/api/notification_ex_manager.h | 3 + notification-ex/api/notification_ex_progress.h | 15 ++ notification-ex/checkbox_item.cc | 4 + notification-ex/checkbox_item.h | 7 + notification-ex/stub.cc | 248 ++++++++++++++++++++++- notification-ex/text_item.h | 4 +- 9 files changed, 342 insertions(+), 11 deletions(-) diff --git a/notification-ex/api/notification_ex_checkbox.h b/notification-ex/api/notification_ex_checkbox.h index 9e9ba6b..ffaad6a 100644 --- a/notification-ex/api/notification_ex_checkbox.h +++ b/notification-ex/api/notification_ex_checkbox.h @@ -103,11 +103,13 @@ int noti_ex_item_checkbox_get_title(noti_ex_item_h handle, char **title); int ret; bool checked; - ret = noti_ex_item_checkbox_is_checked(checkbox_item, &checked); + ret = noti_ex_item_checkbox_get_check_state(checkbox_item, &checked); } * @endcode */ -int noti_ex_item_checkbox_is_checked(noti_ex_item_h handle, bool *checked); +int noti_ex_item_checkbox_get_check_state(noti_ex_item_h handle, bool *checked); + +int noti_ex_item_checkbox_set_check_state(noti_ex_item_h handle, bool checked); /** * @} diff --git a/notification-ex/api/notification_ex_event_info.h b/notification-ex/api/notification_ex_event_info.h index 12e7fb8..7279d58 100644 --- a/notification-ex/api/notification_ex_event_info.h +++ b/notification-ex/api/notification_ex_event_info.h @@ -109,7 +109,7 @@ int noti_ex_event_info_destroy(noti_ex_event_info_h handle); * @retval #NOTI_EX_ERROR_NONE Success * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter * @see #noti_ex_event_info_h - * @see noti_ex_event_info_create() + * @see noti_ex_event_info_clone() * @par Sample code: * @code #include @@ -134,7 +134,7 @@ int noti_ex_event_info_get_event_type(noti_ex_event_info_h handle, noti_ex_event * @retval #NOTI_EX_ERROR_NONE Success * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter * @see #noti_ex_event_info_h - * @see noti_ex_event_info_create() + * @see noti_ex_event_info_clone() * @par Sample code: * @code #include @@ -159,7 +159,7 @@ int noti_ex_event_info_get_owner(noti_ex_event_info_h handle, char **owner); * @retval #NOTI_EX_ERROR_NONE Success * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter * @see #noti_ex_event_info_h - * @see noti_ex_event_info_create() + * @see noti_ex_event_info_clone() * @par Sample code: * @code #include @@ -184,7 +184,7 @@ int noti_ex_event_info_get_channel(noti_ex_event_info_h handle, char **channel); * @retval #NOTI_EX_ERROR_NONE Success * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter * @see #noti_ex_event_info_h - * @see noti_ex_event_info_create() + * @see noti_ex_event_info_clone() * @par Sample code: * @code #include @@ -208,7 +208,7 @@ int noti_ex_event_info_get_item_id(noti_ex_event_info_h handle, char **item_id); * @retval #NOTI_EX_ERROR_NONE Success * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter * @see #noti_ex_event_info_h - * @see noti_ex_event_info_create() + * @see noti_ex_event_info_clone() * @par Sample code: * @code #include diff --git a/notification-ex/api/notification_ex_item.h b/notification-ex/api/notification_ex_item.h index 77d1713..e639a38 100644 --- a/notification-ex/api/notification_ex_item.h +++ b/notification-ex/api/notification_ex_item.h @@ -95,6 +95,37 @@ typedef enum _noti_ex_item_policy { NOTI_EX_ITEM_POLICY_SIM_MODE = 1 << 1, /**< SIM mode */ } noti_ex_item_policy_e; +/** + * @brief Enumeration for main types of notification_ex item. + * @since_tizen 5.5 + */ +typedef enum _noti_ex_item_main_type { + /** + * None + */ + NOTI_EX_ITEM_MAIN_TYPE_NONE = 0, + /** + * Main title. + * This main type is valid only for items of type #NOTI_EX_ITEM_TYPE_TEXT. + */ + NOTI_EX_ITEM_MAIN_TYPE_TITLE, + /** + * Main contents. + * This main type is valid only for items of type #NOTI_EX_ITEM_TYPE_TEXT. + */ + NOTI_EX_ITEM_MAIN_TYPE_CONTENTS, + /** + * Main icon. + * This main type is valid only for items of type #NOTI_EX_ITEM_TYPE_IMAGE. + */ + NOTI_EX_ITEM_MAIN_TYPE_ICON, + /** + * Main button. + * This main type is valid only for items of type #NOTI_EX_ITEM_TYPE_BUTTON. + */ + NOTI_EX_ITEM_MAIN_TYPE_BUTTON, +} noti_ex_item_main_type_e; + /** * @brief The handle for the color information. * @since_tizen 5.5 @@ -708,6 +739,18 @@ int noti_ex_style_get_color(noti_ex_style_h handle, noti_ex_color_h *color); */ int noti_ex_style_get_geometry(noti_ex_style_h handle, noti_ex_geometry_h *geometry); +int noti_ex_style_get_background_image(noti_ex_style_h handle, + char **background_image); + +int noti_ex_style_set_background_image(noti_ex_style_h handle, + char *background_image); + +int noti_ex_style_get_background_color(noti_ex_style_h handle, + noti_ex_color_h *color); + +int noti_ex_style_set_background_color(noti_ex_style_h handle, + noti_ex_color_h color); + /** * @brief The handle for the LED information. * @since_tizen 5.5 @@ -1916,6 +1959,19 @@ int noti_ex_item_get_tag(noti_ex_item_h handle, char **tag); */ int noti_ex_item_set_tag(noti_ex_item_h handle, const char *tag); +int noti_ex_item_get_ongoing_state(noti_ex_item_h handle, bool *ongoing); + +int noti_ex_item_set_ongoing_state(noti_ex_item_h handle, bool ongoing); + +int noti_ex_item_check_type_exist(noti_ex_item_h handle, int type, bool *exist); + +int noti_ex_item_get_main_type(noti_ex_item_h handle, int *type); + +int noti_ex_item_set_main_type(noti_ex_item_h handle, const char *id, int type); + +int noti_ex_item_find_by_main_type(noti_ex_item_h handle, int type, + noti_ex_item_h *item); + /** * @} */ diff --git a/notification-ex/api/notification_ex_manager.h b/notification-ex/api/notification_ex_manager.h index 7b0d035..f144036 100644 --- a/notification-ex/api/notification_ex_manager.h +++ b/notification-ex/api/notification_ex_manager.h @@ -275,6 +275,9 @@ void _manager_events_error_cb(noti_ex_manager_h handle, noti_ex_error_e error, int noti_ex_manager_get(noti_ex_manager_h handle, noti_ex_item_h **items, int *count); +int noti_ex_manager_get_by_channel(noti_ex_manager_h handle, char *channel, + noti_ex_item_h **items, int *count); + /** * @brief Updates notification. * @since_tizen 5.5 diff --git a/notification-ex/api/notification_ex_progress.h b/notification-ex/api/notification_ex_progress.h index 01d92be..b579d3b 100644 --- a/notification-ex/api/notification_ex_progress.h +++ b/notification-ex/api/notification_ex_progress.h @@ -28,6 +28,17 @@ extern "C" { * @{ */ +/** + * @brief Enumeration for notification_ex progress item types. + * @since_tizen 5.5 + */ +typedef enum _noti_ex_item_progress_type { + NOTI_EX_ITEM_PROGRESS_TYPE_DEFAULT, /**< Default */ + NOTI_EX_ITEM_PROGRESS_TYPE_TIME, /**< Time */ + NOTI_EX_ITEM_PROGRESS_TYPE_PERCENT, /**< Percent */ + NOTI_EX_ITEM_PROGRESS_TYPE_PENDING, /**< Pending */ +} noti_ex_item_progress_type_e; + /** * @brief Creates the notification_ex item handle with progress. * @details The notification_ex item is the predefined type of notifications. @@ -156,6 +167,10 @@ int noti_ex_item_progress_get_min(noti_ex_item_h handle, float *min); */ int noti_ex_item_progress_get_max(noti_ex_item_h handle, float *max); +int noti_ex_item_progress_get_type(noti_ex_item_h handle, int *type); + +int noti_ex_item_progress_set_type(noti_ex_item_h handle, int type); + /** * @} */ diff --git a/notification-ex/checkbox_item.cc b/notification-ex/checkbox_item.cc index bdda24d..b80a982 100644 --- a/notification-ex/checkbox_item.cc +++ b/notification-ex/checkbox_item.cc @@ -79,6 +79,10 @@ bool CheckBoxItem::IsChecked(void) const { return impl_->checked_; } +void CheckBoxItem::SetChecked(bool checked) { + impl_->checked_ = checked; +} + CheckBoxItem::~CheckBoxItem() = default; CheckBoxItem::Impl::~Impl() = default; diff --git a/notification-ex/checkbox_item.h b/notification-ex/checkbox_item.h index 31e360e..2468a34 100644 --- a/notification-ex/checkbox_item.h +++ b/notification-ex/checkbox_item.h @@ -93,6 +93,13 @@ class EXPORT_API CheckBoxItem : public AbstractItem { */ bool IsChecked() const; + /** + * @brief Gets the check state of CheckBoxItem. + * @since_tizen 5.5 + * @param[in] checked the check state + */ + void SetChecked(bool checked); + private: class Impl; std::unique_ptr impl_; diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index ec0ad47..afce06f 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -545,8 +545,8 @@ extern "C" EXPORT_API int noti_ex_item_checkbox_get_title(noti_ex_item_h handle, return NOTI_EX_ERROR_NONE; } -extern "C" EXPORT_API int noti_ex_item_checkbox_is_checked(noti_ex_item_h handle, - bool *checked) { +extern "C" EXPORT_API int noti_ex_item_checkbox_get_check_state( + noti_ex_item_h handle, bool *checked) { if (handle == nullptr || checked == nullptr) { LOGE("Invalid parameter"); return NOTI_EX_ERROR_INVALID_PARAMETER; @@ -562,6 +562,25 @@ extern "C" EXPORT_API int noti_ex_item_checkbox_is_checked(noti_ex_item_h handle return NOTI_EX_ERROR_NONE; } +extern "C" EXPORT_API int noti_ex_item_checkbox_set_check_state( + noti_ex_item_h handle, bool checked) { + if (handle == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + Handle* h = static_cast(handle); + if (!h->IsValidType(AbstractItem::CheckBox)) { + LOGE("Invalid handle type"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + CheckBoxItem* p = static_cast(h->Get()); + p->SetChecked(checked); + + return NOTI_EX_ERROR_NONE; +} + extern "C" EXPORT_API int noti_ex_item_entry_create(noti_ex_item_h *handle, const char *id) { EntryItem* p; @@ -1339,6 +1358,71 @@ extern "C" EXPORT_API int noti_ex_style_get_geometry(noti_ex_style_h handle, return NOTI_EX_ERROR_NONE; } +extern "C" EXPORT_API int noti_ex_style_get_background_image( + noti_ex_style_h handle, char** background_image) { + if (handle == nullptr || background_image == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + shared_ptr