b02dc595535e0009d2c2b27d858ed5832848796e
[apps/home/minicontrol.git] / include / minicontrol-provider.h
1 /*
2  * Copyright (c)  2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef _MINICTRL_PROVIDER_H_
18 #define _MINICTRL_PROVIDER_H_
19
20 #include <Evas.h>
21 #include <bundle.h>
22 #include "minicontrol-error.h"
23 #include "minicontrol-type.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @file minicontrol-provider.h
31  * @brief This minicontrol provider library used to create evas socket window.\n
32  *       This library is providing functions for create a remote evas object to draw a minicontrol on a minicontrol viewer and\n
33  *       sending some requests to the minicontrol viewer.\n
34  *        Drawings on this remote evas object will be shown on the place ofthe  minicontrol viewer.
35  */
36
37 /**
38  * @addtogroup MINICONTROL_PROVIDER_MODULE
39  * @{
40  */
41
42 /**
43  * @brief Called when a event comes from viewer
44  * @since_tizen 2.4
45  * @param[in] event_type The type of fired event
46  * @param[in] event_arg argument of the event
47  * @pre minicontrol_viewer_register_event_callback() used to register this callback.
48  * @see #minicontrol_create_window
49  * @see #minicontrol_viewer_event_e
50  */
51 typedef void (*minicontrol_event_cb) (minicontrol_viewer_event_e event_type, bundle *event_arg);
52
53 /**
54  * @brief Creates a window for minicontrol.
55  * @since_tizen 2.4
56  * @privlevel public
57  * @privilege %http://tizen.org/privilege/minicontrol.provider
58  * @param[in] name Name of minicontrol socket window
59  * @param[in] target_viewer Target viewer for minicontrol. You can select multiple viewers by using bitwise OR operator.
60  * @param[in] callback a callback function for events originated by minicontrol viewer.
61  * @return Evas object of socket window. @c NULL failed to create, get_last_result() will returns reason of failure.
62  * @see #minicontrol_target_viewer_e
63  * @see #minicontrol_event_cb
64  */
65 Evas_Object* minicontrol_create_window(const char *name, minicontrol_target_viewer_e target_viewer, minicontrol_event_cb callback);
66
67 /**
68  * @brief Sends a event to the viewer.
69  * @remarks When a viewer doesn't handle some events, it can be ignored.
70  * @since_tizen 2.4
71  * @privlevel public
72  * @privilege %http://tizen.org/privilege/minicontrol.provider
73  * @param[in] minicontrol minicontrol window
74  * @param[in] event Type of the event
75  * @param[in] event_arg Bundle argument of the event
76  * @return #MINICONTROL_ERROR_NONE on success,
77  *         otherwise an error code (see #MINICONTROL_ERROR_XXX) on failure
78  * @retval #MINICONTROL_ERROR_INVALID_PARAMETER Invalid argument
79  * @retval #MINICONTROL_ERROR_PERMISSION_DENIED Permission denied
80  * @see #minicontrol_provider_event_e
81  * @see #minicontrol_create_window
82  * @see #minicontrol_request_to_viewer_e
83  */
84 int minicontrol_send_event(Evas_Object *mincontrol, minicontrol_provider_event_e event, bundle *event_arg);
85
86 /**
87  * @}
88  */
89
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif /* _MINICTRL_PROVIDER_H_ */
94