Restore the checkbox_is_checked api 81/213281/1
authormk5004.lee <mk5004.lee@samsung.com>
Wed, 4 Sep 2019 01:10:36 +0000 (10:10 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Wed, 4 Sep 2019 01:10:36 +0000 (10:10 +0900)
Change-Id: I206aa28633a04356c56a7a5feabafbfb6fbe405b
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification-ex/api/notification_ex_checkbox.h
notification-ex/stub.cc

index 780a41e..469be38 100644 (file)
@@ -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);
+
 /**
  * @}
  */
index afce06f..5e5de9a 100644 (file)
@@ -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*>(handle);
+  if (!h->IsValidType(AbstractItem::CheckBox)) {
+    LOGE("Invalid handle type");
+    return NOTI_EX_ERROR_INVALID_PARAMETER;
+  }
+  CheckBoxItem* p = static_cast<CheckBoxItem*>(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) {