2 * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _MINICTRL_VIEWER_H_
18 #define _MINICTRL_VIEWER_H_
22 #include "minicontrol-error.h"
23 #include "minicontrol-type.h"
30 * @file minicontrol-viewer.h
31 * @brief This minicontrol viewer library used to display minicontrol which created by the minicontrol provider.\n
32 * This library is providing functions for attach a minicontrol viewer to a parent evas object and sending some requests to a minicontrol provider.\n
33 * The minicontrol viewer places a space which will be used by the minicontrol provider to draw minicontrol.
37 * @addtogroup MINICONTROL_VIEWER_MODULE
42 * @brief Adds minicontrol named as "minicontrol_name" to a given parent evas object and returns it.
44 * @param[in] parent Minicontrol object will be added to this parent evas object
45 * @param[in] minicontrol_name Name of minicontrol
46 * @return Evas object of minicontrol. @c NULL failed to add, get_last_result() will returns reason of failure.
48 Evas_Object *minicontrol_viewer_add(Evas_Object *parent, const char *minicontrol_name);
51 * @brief Sends a event to the provider.
53 * @param[in] minicontrol_name The name of the minicontrol window
54 * @param[in] event Type of the event
55 * @param[in] event_arg A bundle of arguments
56 * @return #MINICONTROL_ERROR_NONE on success,
57 * otherwise an error code (see #MINICONTROL_ERROR_XXX) on failure
58 * @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
59 * @see #minicontrol_viewer_event_e
61 int minicontrol_viewer_send_event(const char *minicontrol_name, minicontrol_viewer_event_e event, bundle *event_arg);
64 * @brief Called when a event comes from the provider
66 * @param[in] event The type of fired event
67 * @param[in] minicontrol_name The name of the minicontrol window
68 * @param[in] event_arg A bundle of arguments
69 * @param[in] data User data
70 * @see #minicontrol_viewer_set_event_cb
72 typedef void (*minicontrol_viewer_event_cb) (minicontrol_event_e event, const char *minicontrol_name, bundle *event_arg, void *data);
75 * @brief Registers a callback for events originated by minicontrol provider.
77 * @param[in] callback Callback function
78 * @param[in] user_data User data
79 * @return #MINICONTROL_ERROR_NONE on success,
80 * otherwise an error code (see #MINICONTROL_ERROR_XXX) on failure
81 * @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
82 * @retval #MINICONTROL_ERROR_IPC_FAILURE IPC failure
83 * @retval #MINICONTROL_ERROR_OUT_OF_MEMORY out of memory
84 * @see #minicontrol_viewer_unset_event_cb
85 * @see #minicontrol_viewer_event_cb
87 int minicontrol_viewer_set_event_cb(minicontrol_viewer_event_cb callback, void *user_data);
90 * @brief Unregisters a callback for events originated by minicontrol provider.
92 * @return #MINICONTROL_ERROR_NONE if success, other value if failure
93 * @see #minicontrol_viewer_set_event_cb
95 int minicontrol_viewer_unset_event_cb(void);
104 #endif /* _MINICTRL_VIEWER_H_ */