tizen 2.4 release
[apps/home/minicontrol.git] / include / minicontrol-provider.h
old mode 100755 (executable)
new mode 100644 (file)
index 71e65e8..b02dc59
@@ -18,6 +18,7 @@
 #define _MINICTRL_PROVIDER_H_
 
 #include <Evas.h>
+#include <bundle.h>
 #include "minicontrol-error.h"
 #include "minicontrol-type.h"
 
 extern "C" {
 #endif
 
-
 /**
  * @file minicontrol-provider.h
- * @brief This minicontrol provider library used to create evas socket window.
+ * @brief This minicontrol provider library used to create evas socket window.\n
+ *       This library is providing functions for create a remote evas object to draw a minicontrol on a minicontrol viewer and\n
+ *       sending some requests to the minicontrol viewer.\n
+ *        Drawings on this remote evas object will be shown on the place ofthe  minicontrol viewer.
  */
 
 /**
@@ -37,45 +40,48 @@ extern "C" {
  */
 
 /**
- * @brief Creates evas socket window.
- * @param[in] name Name of socket window
- * @return Evas object of socket window
- */
-Evas_Object *minicontrol_win_add(const char *name);
-
-/**
- * @brief This function create evas socket window with a minicontrol handler
- *
- * @remarks minicontrol service name should be set before call this function
- * @param[in] handler handler of socket window
- * @return evas object of socket window
- */
-Evas_Object *minicontrol_win_add_by_handler(minicontrol_h handler);
-
-/**
- * @brief Requests various actions to the viewer.
- * @param[in] minicontrol Evas object of socket window
- * @param[in] action Type of action
- * @return Evas object of socket window
+ * @brief Called when a event comes from viewer
+ * @since_tizen 2.4
+ * @param[in] event_type The type of fired event
+ * @param[in] event_arg argument of the event
+ * @pre minicontrol_viewer_register_event_callback() used to register this callback.
+ * @see #minicontrol_create_window
+ * @see #minicontrol_viewer_event_e
  */
-minicontrol_error_e minicontrol_request(Evas_Object *mincontrol, minicontrol_request_e request);
+typedef void (*minicontrol_event_cb) (minicontrol_viewer_event_e event_type, bundle *event_arg);
 
 /**
- * @remarks you don't have to destory handler, the handler will be referenced by minicontrol lib
- * @brief This function gets a minicontrol handler from the minicontrol object
- * @param[in] minicontrol evas object of socket window
- * @param[in] handler handler of socket window
- * @return minicontrol handler
+ * @brief Creates a window for minicontrol.
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/minicontrol.provider
+ * @param[in] name Name of minicontrol socket window
+ * @param[in] target_viewer Target viewer for minicontrol. You can select multiple viewers by using bitwise OR operator.
+ * @param[in] callback a callback function for events originated by minicontrol viewer.
+ * @return Evas object of socket window. @c NULL failed to create, get_last_result() will returns reason of failure.
+ * @see #minicontrol_target_viewer_e
+ * @see #minicontrol_event_cb
  */
-minicontrol_error_e minicontrol_win_handler_get(Evas_Object *mincontrol, minicontrol_h *handler);
+Evas_Object* minicontrol_create_window(const char *name, minicontrol_target_viewer_e target_viewer, minicontrol_event_cb callback);
 
 /**
- * @brief This function send request for updating with the updaed minicontrol handler
- * @param[in] minicontrol evas object of socket window
- * @param[in] handler handler of socket window
- * @return evas object of socket window
+ * @brief Sends a event to the viewer.
+ * @remarks When a viewer doesn't handle some events, it can be ignored.
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/minicontrol.provider
+ * @param[in] minicontrol minicontrol window
+ * @param[in] event Type of the event
+ * @param[in] event_arg Bundle argument of the event
+ * @return #MINICONTROL_ERROR_NONE on success,
+ *         otherwise an error code (see #MINICONTROL_ERROR_XXX) on failure
+ * @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #MINICONTROL_ERROR_PERMISSION_DENIED Permission denied
+ * @see #minicontrol_provider_event_e
+ * @see #minicontrol_create_window
+ * @see #minicontrol_request_to_viewer_e
  */
-minicontrol_error_e minicontrol_win_handler_update(Evas_Object *mincontrol, minicontrol_h handler);
+int minicontrol_send_event(Evas_Object *mincontrol, minicontrol_provider_event_e event, bundle *event_arg);
 
 /**
  * @}