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;
}
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<std::shared_ptr<Watch>> list = handle->GetStack();
for (std::shared_ptr<Watch> wptr : list) {
callback(reinterpret_cast<watch_h>(wptr.get()), user_data);
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;
-}
-
* 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 <app_control.h>
#include <bundle.h>
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__ */