From 3c908f5a65f1110b79312ba734e8da69eb3b8fea Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Wed, 4 Mar 2020 14:55:49 +0900 Subject: [PATCH] Adds doxygen and remove needless apis Change-Id: I5894df1adc0470a06dc85303ade3f4ff3c333480 Signed-off-by: Inkyun Kil --- ambient-viewer/include/ambient_viewer.h | 4 +- .../include/ambient_viewer_common.h | 4 +- .../include/ambient_viewer_surface.h | 4 +- watch-holder/api/watch_holder.cc | 30 +----- watch-holder/api/watch_holder.h | 102 ++++++++++++++---- 5 files changed, 88 insertions(+), 56 deletions(-) diff --git a/ambient-viewer/include/ambient_viewer.h b/ambient-viewer/include/ambient_viewer.h index 447ae5f8..45556ce3 100644 --- a/ambient-viewer/include/ambient_viewer.h +++ b/ambient-viewer/include/ambient_viewer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_H__ -#define __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_H__ +#ifndef __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_H__ +#define __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_H__ #include #include diff --git a/ambient-viewer/include/ambient_viewer_common.h b/ambient-viewer/include/ambient_viewer_common.h index 3ca45ba6..3cc1deea 100644 --- a/ambient-viewer/include/ambient_viewer_common.h +++ b/ambient-viewer/include/ambient_viewer_common.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_COMMON_H__ -#define __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_COMMON_H__ +#ifndef __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_COMMON_H__ +#define __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_COMMON_H__ #include diff --git a/ambient-viewer/include/ambient_viewer_surface.h b/ambient-viewer/include/ambient_viewer_surface.h index 4267e09e..45739386 100644 --- a/ambient-viewer/include/ambient_viewer_surface.h +++ b/ambient-viewer/include/ambient_viewer_surface.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_SURFACE_H__ -#define __TIZEN_WIDGET_VEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_SURFACE_H__ +#ifndef __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_SURFACE_H__ +#define __TIZEN_WIDGET_VIEWER_AMBIENT_VIEWER_INCLUDE_AMBIENT_VIEWER_SURFACE_H__ #include diff --git a/watch-holder/api/watch_holder.cc b/watch-holder/api/watch_holder.cc index 45985246..f0128c88 100644 --- a/watch-holder/api/watch_holder.cc +++ b/watch-holder/api/watch_holder.cc @@ -100,24 +100,6 @@ C_EXPORT int watch_holder_launch(watch_holder_h handle, bool background, const c return handle->Launch(std::string(appid), background, extra); } -C_EXPORT int watch_holder_enable_rendering(watch_holder_h handle) { - if (handle == nullptr) - return WATCH_HOLDER_ERROR_INVALID_PARAMETER; - - handle->EnableRendering(); - - return WATCH_HOLDER_ERROR_NONE; -} - -C_EXPORT int watch_holder_disable_rendering(watch_holder_h handle, int timeout) { - if (handle == nullptr) - return WATCH_HOLDER_ERROR_INVALID_PARAMETER; - - handle->DisableRendering(timeout); - - return WATCH_HOLDER_ERROR_NONE; -} - C_EXPORT int watch_holder_get_current(watch_holder_h handle, watch_h *watch) { if (handle == nullptr) return WATCH_HOLDER_ERROR_INVALID_PARAMETER; @@ -128,6 +110,9 @@ C_EXPORT int watch_holder_get_current(watch_holder_h handle, watch_h *watch) { } C_EXPORT int watch_holder_foreach_watch(watch_holder_h handle, watch_holder_foreach_cb callback, void *user_data) { + if (handle == nullptr || callback == nullptr) + return WATCH_HOLDER_ERROR_INVALID_PARAMETER; + std::list> list = handle->GetStack(); for (std::shared_ptr wptr : list) { callback(reinterpret_cast(wptr.get()), user_data); @@ -135,12 +120,3 @@ C_EXPORT int watch_holder_foreach_watch(watch_holder_h handle, watch_holder_fore return WATCH_HOLDER_ERROR_NONE; } - -C_EXPORT int watch_holder_monitor(watch_holder_h handle) { - return WATCH_HOLDER_ERROR_NONE; -} - -C_EXPORT int watch_holder_unmonitor(watch_holder_h handle) { - return WATCH_HOLDER_ERROR_NONE; -} - diff --git a/watch-holder/api/watch_holder.h b/watch-holder/api/watch_holder.h index b72681dc..2f8d9670 100644 --- a/watch-holder/api/watch_holder.h +++ b/watch-holder/api/watch_holder.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __WATCH_HOLDER_H__ -#define __WATCH_HOLDER_H__ +#ifndef __TIZEN_WIDGET_VIEWER_WATCH_HOLDER_H__ +#define __TIZEN_WIDGET_VIEWER_WATCH_HOLDER_H__ #include #include @@ -28,46 +28,102 @@ extern "C" { #endif +/** + * @brief The watch holder handle. + * @remarks This handle only for internal applications. + */ typedef struct watch_holder_s *watch_holder_h; +/** + * @brief The structure type containing the set of callback functions for watch events handle. + * @remarks This structure only for internal applications. + */ typedef struct { - void (*watch_holder_lifecycle_launched_cb)(watch_h watch, void *data); - void (*watch_holder_lifecycle_dead_cb)(watch_h watch, bool is_faulted, void *data); - void (*watch_holder_lifecycle_added_cb)(watch_h watch, void *data); - void (*watch_holder_lifecycle_removed_cb)(watch_h watch, void *data); - void (*watch_holder_lifecycle_updated_cb)(watch_h watch, Evas_Object *image, void *data); - void (*watch_holder_lifecycle_bound_cb)(watch_h watch, void *data); - void (*watch_holder_lifecycle_ambient_changed_cb)(bool enter, bundle *extra, void *data); + void (*watch_holder_lifecycle_launched_cb)(watch_h watch, void *data); /**< This callback function is called after the watch is launched. */ + void (*watch_holder_lifecycle_dead_cb)(watch_h watch, bool is_faulted, void *data); /**< This callback function is called after the watch is dead. */ + void (*watch_holder_lifecycle_added_cb)(watch_h watch, void *data); /**< This callback function is called after the watch is added. */ + void (*watch_holder_lifecycle_removed_cb)(watch_h watch, void *data); /**< This callback function is called after the watch is removed. */ + void (*watch_holder_lifecycle_updated_cb)(watch_h watch, Evas_Object *image, void *data); /**< This callback function is called after the watch is updated. */ + void (*watch_holder_lifecycle_bound_cb)(watch_h watch, void *data); /**< This callback function is called after the watch is bound. */ + void (*watch_holder_lifecycle_ambient_changed_cb)(bool enter, bundle *extra, void *data); /**< This callback function is called when the device enters or exits ambient mode. */ } watch_holder_lifecycle_st; -typedef void (*watch_holder_foreach_cb)(watch_h watch, void *data); +/** + * @brief Retrieves all watchs of added to watch holder. + * @remarks This function only for internal applications. + * + * @param[in] watch The watch handle + * @param[in] user_data The user data + */ +typedef void (*watch_holder_foreach_cb)(watch_h watch, void *user_data); /** - * @brief - * @details - * @since_tizen 5.5 - * @return @c 0 on success, otherwise a negative error value + * @brief Creates the watch holder handle. + * @remarks This function only for internal applications. + * @remarks @a handle must be released using watch_holder_destroy(). + * @param[in] viewer_win The Evas Object + * @param[in] lifecycle The set of callback functions to handle watch events + * @param[in] user_data The user data + * @param[out] handle The watch holder handle + * @return #WATCH_HOLDER_ERROR_NONE on success, otherwise a negative error value + * @retval #WATCH_HOLDER_ERROR_NONE Success + * @retval #WATCH_HOLDER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WATCH_HOLDER_ERROR_OUT_OF_MEMORY Out of memory + * @see watch_holder_destroy() */ int watch_holder_create(Evas_Object *viewer_win, watch_holder_lifecycle_st lifecycle, void *user_data, watch_holder_h *handle); +/** + * @brief Destroys the watch handle. + * @remarks This function only for internal applications. + * @param[in] handle The watch holder handle + * @return #WATCH_HOLDER_ERROR_NONE on success, otherwise a negative error value + * @retval #WATCH_HOLDER_ERROR_NONE Success + * @retval #WATCH_HOLDER_ERROR_INVALID_PARAMETER Invalid parameter + * @see watch_holder_create() + */ int watch_holder_destroy(watch_holder_h handle); +/** + * @brief Launches the watch application. + * @remarks This function only for internal applications. + * @param[in] handle The watch holder handle + * @param[in] background Whether launch in background or not + * @param[in] appid The application id of the watch + * @param[in] extra The extra data + * @return #WATCH_HOLDER_ERROR_NONE on success, otherwise a negative error value + * @retval #WATCH_HOLDER_ERROR_NONE Success + * @retval #WATCH_HOLDER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WATCH_HOLDER_ERROR_OUT_OF_MEMORY Out of memory + */ int watch_holder_launch(watch_holder_h handle, bool background, const char *appid, bundle *extra); -int watch_holder_enable_rendering(watch_holder_h handle); - -int watch_holder_disable_rendering(watch_holder_h handle, int timeout); - +/** + * @brief Gets current watch. + * @remarks This function only for internal applications. + * @param[in] handle The watch holder handle + * @param[out] watch The watch handle + * @return #WATCH_HOLDER_ERROR_NONE on success, otherwise a negative error value + * @retval #WATCH_HOLDER_ERROR_NONE Success + * @retval #WATCH_HOLDER_ERROR_INVALID_PARAMETER Invalid parameter + */ int watch_holder_get_current(watch_holder_h handle, watch_h *watch); +/** + * @brief Retrieves all watch applications held by the holder. + * @remarks This function only for internal applications. + * @param[in] handle The watch holder handle + * @param[in] cb The callback function + * @param[in] user_data The user data + * @return #WATCH_HOLDER_ERROR_NONE on success, otherwise a negative error value + * @retval #WATCH_HOLDER_ERROR_NONE Success + * @retval #WATCH_HOLDER_ERROR_INVALID_PARAMETER Invalid parameter + * @see watch_holder_foreach_cb() + */ int watch_holder_foreach_watch(watch_holder_h handle, watch_holder_foreach_cb cb, void *user_data); -int watch_holder_monitor(watch_holder_h handle); - -int watch_holder_unmonitor(watch_holder_h handle); - #ifdef __cplusplus } #endif -#endif +#endif /* __TIZEN_WIDGET_VIEWER_WATCH_HOLDER_H__ */ -- 2.34.1