From: mk5004.lee Date: Thu, 29 Mar 2018 07:29:17 +0000 (+0900) Subject: Check coding style X-Git-Tag: accepted/tizen/unified/20180503.080745~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c0389c3310cb3d41498fa48194c9850d1c91dec;p=platform%2Fcore%2Fappfw%2Fwatchface-complication.git Check coding style - chmod 664 all file update license check return value check parameter Change-Id: I592059de2bbd12dd72fb3dab004030329af8bb7d Signed-off-by: mk5004.lee --- diff --git a/packaging/libwatchface-complication.spec b/packaging/libwatchface-complication.spec old mode 100755 new mode 100644 diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/unittest/src/test_complication.cc b/unittest/src/test_complication.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_complication_provider.cc b/unittest/src/test_complication_provider.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_design_element.cc b/unittest/src/test_design_element.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_editables_container.cc b/unittest/src/test_editables_container.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_editor.cc b/unittest/src/test_editor.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_main.cc b/unittest/src/test_main.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_received_editable.cc b/unittest/src/test_received_editable.cc old mode 100755 new mode 100644 diff --git a/unittest/src/test_tools.cc b/unittest/src/test_tools.cc old mode 100755 new mode 100644 diff --git a/watchface-complication-provider/CMakeLists.txt b/watchface-complication-provider/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/watchface-complication-provider/complication-provider-event-interface.h b/watchface-complication-provider/complication-provider-event-interface.h old mode 100644 new mode 100755 index b93631e..01c5b9d --- a/watchface-complication-provider/complication-provider-event-interface.h +++ b/watchface-complication-provider/complication-provider-event-interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication-provider/complication-provider-implementation.h b/watchface-complication-provider/complication-provider-implementation.h old mode 100644 new mode 100755 index e33716b..e002a9a --- a/watchface-complication-provider/complication-provider-implementation.h +++ b/watchface-complication-provider/complication-provider-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication-provider/complication-provider.cc b/watchface-complication-provider/complication-provider.cc old mode 100644 new mode 100755 index c4b2563..b01f036 --- a/watchface-complication-provider/complication-provider.cc +++ b/watchface-complication-provider/complication-provider.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication-provider/complication-provider.h b/watchface-complication-provider/complication-provider.h old mode 100644 new mode 100755 index cbbc6aa..a7448be --- a/watchface-complication-provider/complication-provider.h +++ b/watchface-complication-provider/complication-provider.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication-provider/include/watchface-complication-provider-manager.h b/watchface-complication-provider/include/watchface-complication-provider-manager.h old mode 100644 new mode 100755 index 953c002..7bf1117 --- a/watchface-complication-provider/include/watchface-complication-provider-manager.h +++ b/watchface-complication-provider/include/watchface-complication-provider-manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. diff --git a/watchface-complication-provider/include/watchface-complication-provider.h b/watchface-complication-provider/include/watchface-complication-provider.h old mode 100644 new mode 100755 index c4b465f..e91ef08 --- a/watchface-complication-provider/include/watchface-complication-provider.h +++ b/watchface-complication-provider/include/watchface-complication-provider.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -25,6 +25,16 @@ extern "C" { #endif +/** + * @file watchface-complication-provider.h + * @brief This file contains APIs for Complication provider. + */ + +/** + * @addtogroup WATCHFACE_COMPLICATION_MODULE + * @{ + */ + struct complication_provider_s { const char *provider_id; const char *provider_name; @@ -130,6 +140,10 @@ void app_control(app_control_h app_control, void *data) */ int complication_provider_setup_get_context(app_control_h handle, bundle **context); +/* + * @} + */ + #ifdef __cplusplus } diff --git a/watchface-complication-provider/watchface-complication-provider-manager.cc b/watchface-complication-provider/watchface-complication-provider-manager.cc old mode 100644 new mode 100755 index 83b1e79..1132bda --- a/watchface-complication-provider/watchface-complication-provider-manager.cc +++ b/watchface-complication-provider/watchface-complication-provider-manager.cc @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication-provider/watchface-complication-provider.cc b/watchface-complication-provider/watchface-complication-provider.cc old mode 100644 new mode 100755 index 4d841bd..c2bf36f --- a/watchface-complication-provider/watchface-complication-provider.cc +++ b/watchface-complication-provider/watchface-complication-provider.cc @@ -1,6 +1,6 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -152,7 +152,7 @@ extern "C" EXPORT_API int complication_provider_notify_update( ws->NotifyDataUpdate(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int complication_provider_setup_reply_to_editor( diff --git a/watchface-complication/CMakeLists.txt b/watchface-complication/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/watchface-complication/complication-bundle.cc b/watchface-complication/complication-bundle.cc old mode 100644 new mode 100755 index 48d2431..37396c0 --- a/watchface-complication/complication-bundle.cc +++ b/watchface-complication/complication-bundle.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-bundle.h b/watchface-complication/complication-bundle.h old mode 100644 new mode 100755 index eef230f..ddb3548 --- a/watchface-complication/complication-bundle.h +++ b/watchface-complication/complication-bundle.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-connector-implementation.h b/watchface-complication/complication-connector-implementation.h old mode 100644 new mode 100755 index 7db4dd4..c2980a7 --- a/watchface-complication/complication-connector-implementation.h +++ b/watchface-complication/complication-connector-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-connector.cc b/watchface-complication/complication-connector.cc old mode 100644 new mode 100755 index f6ef2f0..12f7e80 --- a/watchface-complication/complication-connector.cc +++ b/watchface-complication/complication-connector.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-connector.h b/watchface-complication/complication-connector.h old mode 100644 new mode 100755 index 203cdb4..d6ad162 --- a/watchface-complication/complication-connector.h +++ b/watchface-complication/complication-connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-event-interface.h b/watchface-complication/complication-event-interface.h old mode 100644 new mode 100755 index d67e933..8376d3c --- a/watchface-complication/complication-event-interface.h +++ b/watchface-complication/complication-event-interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication-implementation.h b/watchface-complication/complication-implementation.h old mode 100644 new mode 100755 index 2d45a4a..c8fcb3b --- a/watchface-complication/complication-implementation.h +++ b/watchface-complication/complication-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/complication.cc b/watchface-complication/complication.cc index b6246e5..465dffb 100755 --- a/watchface-complication/complication.cc +++ b/watchface-complication/complication.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -199,15 +199,16 @@ int Complication::Impl::StoreSetting(int comp_id, std::string& provider_id, bundle* setting_data; bundle_raw* raw_data = NULL; int raw_len; + int ret; char buf[32]; if (provider_id.empty() || type < 0) - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; setting_data = bundle_create(); if (setting_data == NULL) { LOGE("bundle_create failed"); - return -1; + return COMPLICATION_ERROR_OUT_OF_MEMORY; } snprintf(buf, sizeof(buf), "%d", static_cast(type)); @@ -216,13 +217,14 @@ int Complication::Impl::StoreSetting(int comp_id, std::string& provider_id, bundle_encode(setting_data, &raw_data, &raw_len); bundle_free(setting_data); - if (EditablesManager::GetInst().StoreSetting(comp_id, raw_data) != 0) { + ret = EditablesManager::GetInst().StoreSetting(comp_id, raw_data); + if (ret != COMPLICATION_ERROR_NONE) { free(raw_data); - return -1; + return ret; } - free(raw_data); - return 0; + free(raw_data); + return COMPLICATION_ERROR_NONE; } std::string Complication::Impl::GetProviderAppId() { @@ -278,14 +280,16 @@ int Complication::GetLastDataIdx() { } int Complication::UpdateLastDataIdx() { + int ret; - if (impl_->StoreSetting(impl_->complication_id_, impl_->cur_provider_id_, - impl_->cur_type_) != 0) - return -1; + ret = impl_->StoreSetting(impl_->complication_id_, impl_->cur_provider_id_, + impl_->cur_type_); + if (ret != COMPLICATION_ERROR_NONE) + return ret; impl_->last_data_idx_ = impl_->cur_data_idx_; LOGI("update last data idx : %d", impl_->last_data_idx_); - return 0; + return COMPLICATION_ERROR_NONE; } int Complication::SetCurDataIdx(int cur_data_idx) { @@ -294,12 +298,12 @@ int Complication::SetCurDataIdx(int cur_data_idx) { if (cur_data_idx < 0 || cur_data_idx >= (int)impl_->candidates_list_.size()) { LOGE("Invalid index"); - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; } if (impl_->cur_data_idx_ == cur_data_idx) { LOGI("Same with cur data idx skip setting process"); - return 0; + return COMPLICATION_ERROR_NONE; } @@ -307,7 +311,7 @@ int Complication::SetCurDataIdx(int cur_data_idx) { Bundle& data = GetCurData(); if (data.GetRaw() == NULL) { LOGI("GetCurData failed"); - return -1; + return COMPLICATION_ERROR_NO_DATA; } bundle_get_str(data.GetRaw(), impl_->provider_id_key_.c_str(), &provider_id); @@ -326,7 +330,7 @@ int Complication::SetCurDataIdx(int cur_data_idx) { -1, impl_.get()); LOGI("subscribe signal %d", impl_->subscribe_id_); - return 0; + return COMPLICATION_ERROR_NONE; } const char* Complication::GetCurProviderId() { diff --git a/watchface-complication/complication.h b/watchface-complication/complication.h index 9a2d215..45c6dc5 100755 --- a/watchface-complication/complication.h +++ b/watchface-complication/complication.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/design-element-implementation.h b/watchface-complication/design-element-implementation.h old mode 100644 new mode 100755 index 6f3b887..56f9323 --- a/watchface-complication/design-element-implementation.h +++ b/watchface-complication/design-element-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/design-element.cc b/watchface-complication/design-element.cc old mode 100644 new mode 100755 index 2f46241..fb54e91 --- a/watchface-complication/design-element.cc +++ b/watchface-complication/design-element.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -123,22 +123,22 @@ int DesignElement::UpdateLastDataIdx() { int ret = EditablesManager::GetInst().StoreSetting(impl_->id_, raw_data); free(raw_data); - if (ret != 0) - return -1; + if (ret != COMPLICATION_ERROR_NONE) + return ret; impl_->last_data_idx_ = impl_->cur_data_idx_; - return 0; + return COMPLICATION_ERROR_NONE; } int DesignElement::SetCurDataIdx(int cur_data_idx) { if (cur_data_idx < 0 || cur_data_idx >= (int)impl_->candidates_list_.size()) { LOGE("Invalid index"); - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; } LOGI("set cur data %d", cur_data_idx); impl_->cur_data_idx_ = cur_data_idx; - return 0; + return COMPLICATION_ERROR_NONE; } const std::string& DesignElement::GetName() { diff --git a/watchface-complication/design-element.h b/watchface-complication/design-element.h old mode 100644 new mode 100755 index 9d94a19..270318e --- a/watchface-complication/design-element.h +++ b/watchface-complication/design-element.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/editable-interface.h b/watchface-complication/editable-interface.h old mode 100644 new mode 100755 index 78ebcc6..0398b1f --- a/watchface-complication/editable-interface.h +++ b/watchface-complication/editable-interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/editables-container-event-interface.h b/watchface-complication/editables-container-event-interface.h old mode 100644 new mode 100755 index 43c6313..7c686de --- a/watchface-complication/editables-container-event-interface.h +++ b/watchface-complication/editables-container-event-interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/editables-container-implementation.h b/watchface-complication/editables-container-implementation.h old mode 100644 new mode 100755 index 0695867..e9c9df8 --- a/watchface-complication/editables-container-implementation.h +++ b/watchface-complication/editables-container-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/editables-container.cc b/watchface-complication/editables-container.cc old mode 100644 new mode 100755 index 41f2429..39354b5 --- a/watchface-complication/editables-container.cc +++ b/watchface-complication/editables-container.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -142,7 +142,7 @@ int EditablesContainer::RequestEdit(const std::string& editor_id) { if (ed == NULL) { if (str_raw) free(str_raw); - return -1; + return COMPLICATION_ERROR_OUT_OF_MEMORY; } bundle_add(ed, "EDITABLE_ID", std::to_string(i.get()->GetId()).c_str()); @@ -177,7 +177,7 @@ int EditablesContainer::RequestEdit(const std::string& editor_id) { if (container == NULL) { if (str_raw) free(str_raw); - return -1; + return COMPLICATION_ERROR_OUT_OF_MEMORY; } bundle_add_str_array(container, "EDITABLE_LIST", list_arr.get(), list_idx); @@ -198,7 +198,7 @@ int EditablesContainer::RequestEdit(const std::string& editor_id) { impl_->watcher_id_ = ComplicationConnector::GetInst().Watch(editor_id, this->impl_.get()); - return 0; + return COMPLICATION_ERROR_NONE; } void EditablesContainer::OnUpdate(const IEditable& ed, int selected_idx, @@ -210,15 +210,15 @@ void EditablesContainer::OnEditReady(const std::string& editor_id) { int EditablesContainer::Add(std::shared_ptr ed) { if (ed == nullptr) - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; impl_->ed_list_.push_back(ed); - return 0; + return COMPLICATION_ERROR_NONE; } int EditablesContainer::Remove(std::shared_ptr ed) { if (ed == nullptr) - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; for (auto& i : impl_->ed_list_) { if (i.get() == ed.get()) { @@ -227,7 +227,7 @@ int EditablesContainer::Remove(std::shared_ptr ed) { } } - return 0; + return COMPLICATION_ERROR_NONE; } } // namespace watchface_complication diff --git a/watchface-complication/editables-container.h b/watchface-complication/editables-container.h old mode 100644 new mode 100755 index 475bb78..b5c5d19 --- a/watchface-complication/editables-container.h +++ b/watchface-complication/editables-container.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/editables-manager.cc b/watchface-complication/editables-manager.cc old mode 100644 new mode 100755 index 1227071..15583ed --- a/watchface-complication/editables-manager.cc +++ b/watchface-complication/editables-manager.cc @@ -114,9 +114,9 @@ int EditablesManager::StoreSetting(int editable_id, bundle_raw* raw_data) { if (r != SQLITE_OK) { LOGE("sqlite3_exec error(query = %s, error = %s)", query, error); sqlite3_free(error); - return -1; + return COMPLICATION_ERROR_DB; } - return 0; + return COMPLICATION_ERROR_NONE; } std::unique_ptr EditablesManager::LoadSetting(int editable_id) { diff --git a/watchface-complication/include/watchface-common.h b/watchface-complication/include/watchface-common.h index 2d796ff..76053ab 100755 --- a/watchface-complication/include/watchface-common.h +++ b/watchface-complication/include/watchface-common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -27,30 +27,33 @@ extern "C" { #endif +/** + * @brief Enumeration for Complication Error + */ typedef enum _complication_error { COMPLICATION_ERROR_NONE = TIZEN_ERROR_NONE, COMPLICATION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, COMPLICATION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, COMPLICATION_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, COMPLICATION_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, - COMPLICATION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED + COMPLICATION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ + COMPLICATION_ERROR_DB = TIZEN_ERROR_COMPLICATION | 0x1, /**< DB Error */ + COMPLICATION_ERROR_DBUS = TIZEN_ERROR_COMPLICATION | 0x2, /**< DBUS Error */ + COMPLICATION_ERROR_EDIT_NOT_READY = TIZEN_ERROR_COMPLICATION | 0x3, /**< Edit not ready */ } complication_error; +/** + * @brief Enumeration for Complication Type. + * @since_tizen 5.0 + */ typedef enum _complication_type { - COMPLICATION_NO_DATA = 0x01, - COMPLICATION_SHORT_TEXT = 0x02, - COMPLICATION_LONG_TEXT = 0x04, - COMPLICATION_RANGED_VALUE = 0x08, - COMPLICATION_TIME = 0x10, - COMPLICATION_ICON = 0x20, - COMPLICATION_IMAGE = 0x40, - COMPLICATION_TYPE_MAX = COMPLICATION_NO_DATA | - COMPLICATION_SHORT_TEXT | - COMPLICATION_LONG_TEXT | - COMPLICATION_RANGED_VALUE | - COMPLICATION_TIME | - COMPLICATION_ICON | - COMPLICATION_IMAGE, + COMPLICATION_NO_DATA = 0x01, /**< No Data */ + COMPLICATION_SHORT_TEXT = 0x02, /**< Short Text */ + COMPLICATION_LONG_TEXT = 0x04, /**< Long Text */ + COMPLICATION_RANGED_VALUE = 0x08, /**< Ranged Value */ + COMPLICATION_TIME = 0x10, /**< Time */ + COMPLICATION_ICON = 0x20, /**< Icon */ + COMPLICATION_IMAGE = 0x40, /**< Image */ } complication_type; #ifdef __cplusplus diff --git a/watchface-complication/include/watchface-complication-internal.h b/watchface-complication/include/watchface-complication-internal.h old mode 100644 new mode 100755 index e99d48d..f8a2388 --- a/watchface-complication/include/watchface-complication-internal.h +++ b/watchface-complication/include/watchface-complication-internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. diff --git a/watchface-complication/include/watchface-complication.h b/watchface-complication/include/watchface-complication.h old mode 100644 new mode 100755 index 14efd10..3e0725a --- a/watchface-complication/include/watchface-complication.h +++ b/watchface-complication/include/watchface-complication.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -26,6 +26,15 @@ extern "C" { #endif +/** + * @file watchface-complication.h + * @brief This file contains APIs and enumerations for Watchface complication. + */ + +/** + * @addtogroup WATCHFACE_COMPLICATION_MODULE + * @{ + */ typedef enum _complication_shape_type { COMPLICATION_SHAPE_CIRCLE, COMPLICATION_SHAPE_RECT @@ -61,6 +70,10 @@ int complication_get_provider_id(const bundle *candidate, int complication_get_type(const bundle *candidate, complication_type *cur_type); +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/watchface-complication/include/watchface-editable.h b/watchface-complication/include/watchface-editable.h old mode 100644 new mode 100755 index 34d1e09..1e6d220 --- a/watchface-complication/include/watchface-editable.h +++ b/watchface-complication/include/watchface-editable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -26,6 +26,16 @@ extern "C" { #endif +/** + * @file watchface-editable.h + * @brief This file contains APIs and enumerations for Watchface editable. + */ + +/** + * @addtogroup WATCHFACE_COMPLICATION_MODULE + * @{ + */ + typedef void *editable_h; typedef void *editable_container_h; typedef struct _editable_geo { @@ -75,6 +85,10 @@ int editable_on_edit_ready_cb_add(on_edit_ready cb, void *user_data); int editable_on_edit_ready_cb_del(on_edit_ready cb); int editable_load_current_data(int editable_id, bundle **current_data); +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/watchface-complication/received-editable-implementation.h b/watchface-complication/received-editable-implementation.h old mode 100644 new mode 100755 index e5fe964..9274e2e --- a/watchface-complication/received-editable-implementation.h +++ b/watchface-complication/received-editable-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/received-editable.cc b/watchface-complication/received-editable.cc old mode 100644 new mode 100755 index 0ffeeb3..4ad2714 --- a/watchface-complication/received-editable.cc +++ b/watchface-complication/received-editable.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -100,7 +100,7 @@ int ReceivedEditable::GetCurDataIdx() { int ReceivedEditable::UpdateLastDataIdx() { impl_->last_data_idx_ = impl_->cur_data_idx_; - return 0; + return COMPLICATION_ERROR_NONE; } Bundle& ReceivedEditable::GetCurData() { @@ -120,11 +120,11 @@ Bundle& ReceivedEditable::GetNthData(int nth) { int ReceivedEditable::SetCurDataIdx(int cur_data_idx) { if (cur_data_idx < 0 || cur_data_idx >= (int)impl_->candidates_list_.size()) { LOGE("Invalid index"); - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; } impl_->cur_data_idx_ = cur_data_idx; - return 0; + return COMPLICATION_ERROR_NONE; } const std::string& ReceivedEditable::GetName() { diff --git a/watchface-complication/received-editable.h b/watchface-complication/received-editable.h old mode 100644 new mode 100755 index 78a3b71..f7145f8 --- a/watchface-complication/received-editable.h +++ b/watchface-complication/received-editable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/shared-handle.h b/watchface-complication/shared-handle.h old mode 100644 new mode 100755 index ea8d526..68063c3 --- a/watchface-complication/shared-handle.h +++ b/watchface-complication/shared-handle.h @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2018 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 WATCHFACE_COMPLICATION_SHARED_HANDLE_H_ #define WATCHFACE_COMPLICATION_SHARED_HANDLE_H_ diff --git a/watchface-complication/watchface-complication-internal.cc b/watchface-complication/watchface-complication-internal.cc old mode 100644 new mode 100755 index 83b1e79..1132bda --- a/watchface-complication/watchface-complication-internal.cc +++ b/watchface-complication/watchface-complication-internal.cc @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-complication/watchface-complication.cc b/watchface-complication/watchface-complication.cc index e16a2a1..4b026b9 100755 --- a/watchface-complication/watchface-complication.cc +++ b/watchface-complication/watchface-complication.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -138,7 +138,13 @@ extern "C" EXPORT_API int complication_create(int complication_id, int support_types, complication_shape_type shape_type, complication_h *created_handle) { if (support_types < COMPLICATION_NO_DATA || - support_types > COMPLICATION_TYPE_MAX) + support_types > (COMPLICATION_NO_DATA | + COMPLICATION_SHORT_TEXT | + COMPLICATION_LONG_TEXT | + COMPLICATION_RANGED_VALUE | + COMPLICATION_TIME | + COMPLICATION_ICON | + COMPLICATION_IMAGE)) return COMPLICATION_ERROR_INVALID_PARAMETER; try { @@ -167,7 +173,7 @@ extern "C" EXPORT_API int complication_destroy(complication_h handle) { auto sh = static_cast*>(handle); delete sh; - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int complication_get_cur_provider_id(complication_h handle, diff --git a/watchface-complication/watchface-editable.cc b/watchface-complication/watchface-editable.cc old mode 100644 new mode 100755 index 51f7966..338b547 --- a/watchface-complication/watchface-editable.cc +++ b/watchface-complication/watchface-editable.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -159,7 +159,7 @@ extern "C" EXPORT_API int editable_add_design_element(editable_container_h handl de.get()->SetName(std::string(editable_name)); ec->Add(de); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_add_complication(editable_container_h handle, @@ -175,7 +175,7 @@ extern "C" EXPORT_API int editable_add_complication(editable_container_h handle, ec->Add(SharedHandle::Share(sh)); LOGI("Add comp %d", edit_id); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_request_edit(editable_container_h handle, @@ -191,7 +191,7 @@ extern "C" EXPORT_API int editable_request_edit(editable_container_h handle, LOGI("Request edit to %s", editor_appid); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_on_edit_ready_cb_add(on_edit_ready cb, @@ -205,14 +205,14 @@ extern "C" EXPORT_API int editable_on_edit_ready_cb_add(on_edit_ready cb, auto ci = new ReadyCallbackInfo(cb, user_data); __container->AddReadyCallbackInfo(ci); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_on_edit_ready_cb_del(on_edit_ready cb) { if (cb == NULL) return COMPLICATION_ERROR_INVALID_PARAMETER; - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_cur_data_idx(const editable_h handle, @@ -222,7 +222,7 @@ extern "C" EXPORT_API int editable_get_cur_data_idx(const editable_h handle, IEditable* ie = static_cast(handle); *idx = ie->GetCurDataIdx(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_set_cur_data_idx(const editable_h handle, @@ -232,7 +232,7 @@ extern "C" EXPORT_API int editable_set_cur_data_idx(const editable_h handle, IEditable* ie = static_cast(handle); ie->SetCurDataIdx(idx); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_cur_data(const editable_h handle, @@ -243,7 +243,7 @@ extern "C" EXPORT_API int editable_get_cur_data(const editable_h handle, IEditable* ie = static_cast(handle); Bundle& data = ie->GetCurData(); *cur_data = data.GetRaw(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_nth_data(const editable_h handle, @@ -254,7 +254,7 @@ extern "C" EXPORT_API int editable_get_nth_data(const editable_h handle, IEditable* ie = static_cast(handle); Bundle& data = ie->GetNthData(nth); *cur_data = data.GetRaw(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_editable_id(const editable_h handle, @@ -265,22 +265,22 @@ extern "C" EXPORT_API int editable_get_editable_id(const editable_h handle, IEditable* ie = static_cast(handle); *editable_id = ie->GetId(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_geometry(const editable_h handle, editable_geo *geo) { if (handle == NULL || geo == NULL) return COMPLICATION_ERROR_INVALID_PARAMETER; - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_candidates_list(const editable_h handle, - GList **candiates_list) { - if (handle == NULL || candiates_list == NULL) + GList **candidates_list) { + if (handle == NULL || candidates_list == NULL) return COMPLICATION_ERROR_INVALID_PARAMETER; - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_get_editable_name(const editable_h handle, @@ -291,7 +291,7 @@ extern "C" EXPORT_API int editable_get_editable_name(const editable_h handle, IEditable* ie = static_cast(handle); if (!ie->GetName().empty()) *editable_name = ie->GetName().c_str(); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_set_editable_name(const editable_h handle, @@ -301,16 +301,20 @@ extern "C" EXPORT_API int editable_set_editable_name(const editable_h handle, IEditable* ie = static_cast(handle); ie->SetName(std::string(editable_name)); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editable_load_current_data(int editable_id, bundle **selected_data) { + if (selected_data == NULL) + return COMPLICATION_ERROR_INVALID_PARAMETER; + std::unique_ptr setting_data = EditablesManager::GetInst().LoadSetting(editable_id); if (setting_data != nullptr) *selected_data = bundle_dup(setting_data.get()->GetRaw()); else return COMPLICATION_ERROR_NO_DATA; + return COMPLICATION_ERROR_NONE; } diff --git a/watchface-editor/CMakeLists.txt b/watchface-editor/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/watchface-editor/editables-editor-event-interface.h b/watchface-editor/editables-editor-event-interface.h old mode 100644 new mode 100755 index 71f8605..2ac2c83 --- a/watchface-editor/editables-editor-event-interface.h +++ b/watchface-editor/editables-editor-event-interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-editor/editables-editor-implementation.h b/watchface-editor/editables-editor-implementation.h old mode 100644 new mode 100755 index a3f6b2a..20bf6e9 --- a/watchface-editor/editables-editor-implementation.h +++ b/watchface-editor/editables-editor-implementation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-editor/editables-editor.cc b/watchface-editor/editables-editor.cc old mode 100644 new mode 100755 index 26156c8..f4c79dd --- a/watchface-editor/editables-editor.cc +++ b/watchface-editor/editables-editor.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -104,7 +104,7 @@ void EditablesEditor::OnRequestEdit(const std::string& appid, int EditablesEditor::EditPreview(IEditable& ed, int cur_data_idx) { if (impl_->edit_appid_.empty()) { LOGE("Editing is not ready"); - return -1; + return COMPLICATION_ERROR_EDIT_NOT_READY; } ReceivedEditable& re = static_cast(ed); @@ -121,13 +121,13 @@ int EditablesEditor::EditPreview(IEditable& ed, int cur_data_idx) { g_variant_new("(iis)", cur_data_idx, ed.GetId(), (context == nullptr) ? "" : context->ToString())); - return 0; + return COMPLICATION_ERROR_NONE; } int EditablesEditor::EditComplete() { if (impl_->edit_appid_.empty()) { LOGE("Editing is not ready"); - return -1; + return COMPLICATION_ERROR_EDIT_NOT_READY; } ComplicationConnector::GetInst().EmitSignal( @@ -138,13 +138,13 @@ int EditablesEditor::EditComplete() { ComplicationConnector::GetInst().GetCmdStr( ComplicationConnector::EditableEditComplete), NULL); - return 0; + return COMPLICATION_ERROR_NONE; } int EditablesEditor::EditCancel() { if (impl_->edit_appid_.empty()) { LOGE("Editing is not ready"); - return -1; + return COMPLICATION_ERROR_EDIT_NOT_READY; } ComplicationConnector::GetInst().EmitSignal( @@ -155,12 +155,12 @@ int EditablesEditor::EditCancel() { ComplicationConnector::GetInst().GetCmdStr( ComplicationConnector::EditableEditCancel), NULL); - return 0; + return COMPLICATION_ERROR_NONE; } int EditablesEditor::NotifyEditReady(std::string appid) { if (appid.empty()) - return -1; + return COMPLICATION_ERROR_INVALID_PARAMETER; ComplicationConnector::GetInst().EmitSignal( ComplicationConnector::Editable, @@ -170,7 +170,7 @@ int EditablesEditor::NotifyEditReady(std::string appid) { ComplicationConnector::GetInst().GetCmdStr( ComplicationConnector::EditableEditReady), g_variant_new("(s)", ComplicationConnector::GetInst().GetAppId().c_str())); - return 0; + return COMPLICATION_ERROR_NONE; } } // namespace watchface_complication diff --git a/watchface-editor/editables-editor.h b/watchface-editor/editables-editor.h old mode 100644 new mode 100755 index 98e1288..39be883 --- a/watchface-editor/editables-editor.h +++ b/watchface-editor/editables-editor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. diff --git a/watchface-editor/include/watchface-editor.h b/watchface-editor/include/watchface-editor.h index 0982936..ada2d4b 100755 --- a/watchface-editor/include/watchface-editor.h +++ b/watchface-editor/include/watchface-editor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -27,6 +27,16 @@ extern "C" { #endif +/** + * @file watchface-complication-editor.h + * @brief This file contains APIs for Watchface editor. + */ + +/** + * @addtogroup WATCHFACE_COMPLICATION_MODULE_INTERNAL + * @{ + */ + typedef GList *editable_list_h; typedef void (*on_setup_result)(editable_h ed, bundle *new_context, void *user_data); @@ -131,6 +141,10 @@ int editor_launch_setup_app(const editable_h handle, on_setup_result cb, void *u */ int editor_is_setup_app_exist(const editable_h handle, bool *exist); +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/watchface-editor/watchface-editor.cc b/watchface-editor/watchface-editor.cc old mode 100644 new mode 100755 index c5eb1c5..d5b68b8 --- a/watchface-editor/watchface-editor.cc +++ b/watchface-editor/watchface-editor.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -138,8 +138,10 @@ class EditablesEditorStub : public EditablesEditor { static std::unique_ptr __stub = nullptr; extern "C" EXPORT_API int editor_on_request_edit_cb_add(on_request_edit cb, void *user_data) { - if (cb == NULL) + if (cb == NULL) { + LOGE("Invalid parameter"); return COMPLICATION_ERROR_INVALID_PARAMETER; + } if (__stub == nullptr) __stub = std::unique_ptr(new EditablesEditorStub()); @@ -147,20 +149,24 @@ extern "C" EXPORT_API int editor_on_request_edit_cb_add(on_request_edit cb, auto ci = new CallbackInfo(cb, user_data); __stub->AddCallbackInfo(ci); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editor_on_request_edit_cb_del(on_request_edit cb) { - if (cb == NULL) + if (cb == NULL) { + LOGE("Invalid parameter"); return COMPLICATION_ERROR_INVALID_PARAMETER; + } - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editor_edit_preview(const editable_h handle, int cur_data_idx) { - if (handle == NULL) + if (handle == NULL) { + LOGE("Invalid parameter"); return COMPLICATION_ERROR_INVALID_PARAMETER; + } IEditable* ed = static_cast(handle); ed->SetCurDataIdx(cur_data_idx); @@ -176,8 +182,10 @@ extern "C" EXPORT_API int editor_edit_cancel() { } extern "C" EXPORT_API int editor_notify_edit_ready(const char *appid) { - if (appid == NULL) + if (appid == NULL) { + LOGE("Invalid parameter"); return COMPLICATION_ERROR_INVALID_PARAMETER; + } if (__stub == nullptr) __stub = std::unique_ptr(new EditablesEditorStub()); @@ -185,7 +193,7 @@ extern "C" EXPORT_API int editor_notify_edit_ready(const char *appid) { __stub->ClearEditableList(); __stub->NotifyEditReady(std::string(appid)); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editor_foreach_editable_list(editable_list_h list_h, @@ -199,7 +207,7 @@ extern "C" EXPORT_API int editor_foreach_editable_list(editable_list_h list_h, iter = iter->next; } - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API editable_list_h editor_editable_list_dup( @@ -220,8 +228,13 @@ extern "C" EXPORT_API editable_list_h editor_editable_list_dup( extern "C" EXPORT_API int editor_editable_list_destroy(editable_list_h list) { /* list items are managed by EditablesEditor */ + if (list == NULL) { + LOGE("Invalid parameter"); + return COMPLICATION_ERROR_INVALID_PARAMETER; + } + g_list_free(list); - return 0; + return COMPLICATION_ERROR_NONE; } extern "C" EXPORT_API int editor_editable_list_get_size(editable_list_h list) { @@ -230,7 +243,7 @@ extern "C" EXPORT_API int editor_editable_list_get_size(editable_list_h list) { extern "C" EXPORT_API const editable_h editor_editable_list_get_nth( editable_list_h list, int nth) { - if (list == NULL) { + if (list == NULL || nth < 0) { LOGE("Invalid parameter"); return NULL; } @@ -391,4 +404,4 @@ extern "C" EXPORT_API int editor_launch_setup_app(const editable_h handle, __stub->AddSetupCallbackInfo(ci); return COMPLICATION_ERROR_NONE; -} \ No newline at end of file +}