From 453ceebf568b2530c56173adbb519088d8842b36 Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Wed, 4 Sep 2019 10:10:36 +0900 Subject: [PATCH] Restore the checkbox_is_checked api Change-Id: I206aa28633a04356c56a7a5feabafbfb6fbe405b Signed-off-by: mk5004.lee --- notification-ex/api/notification_ex_checkbox.h | 2 ++ notification-ex/stub.cc | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/notification-ex/api/notification_ex_checkbox.h b/notification-ex/api/notification_ex_checkbox.h index 780a41e..469be38 100644 --- a/notification-ex/api/notification_ex_checkbox.h +++ b/notification-ex/api/notification_ex_checkbox.h @@ -161,6 +161,8 @@ int noti_ex_item_checkbox_set_check_state(noti_ex_item_h handle, bool checked); */ int noti_ex_item_checkbox_set_multi_language(noti_ex_item_h handle, noti_ex_multi_lang_h lang); +int noti_ex_item_checkbox_is_checked(noti_ex_item_h handle, bool *checked); + /** * @} */ diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index afce06f..5e5de9a 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -545,6 +545,23 @@ 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) { + if (handle == nullptr || checked == 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()); + *checked = p->IsChecked(); + + return NOTI_EX_ERROR_NONE; +} + extern "C" EXPORT_API int noti_ex_item_checkbox_get_check_state( noti_ex_item_h handle, bool *checked) { if (handle == nullptr || checked == nullptr) { -- 2.7.4