tizen 2.3 release
[apps/home/minicontrol.git] / include / minicontrol-monitor.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_MONITOR_H_
18 #define _MINICTRL_MONITOR_H_
19
20 #include <minicontrol-error.h>
21 #include <minicontrol-type.h>
22 #include <minicontrol-handler.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @file minicontrol-monitor.h
30  * @brief This minicontrol monitor library used to manage events triggered by minicontrol provider.
31  */
32
33 /**
34  * @addtogroup MINICONTROL_MONITOR_MODULE
35  * @{
36  */
37
38   /**
39  * @brief Called when event is triggered.
40  * @param[in] action The type of fired event
41  * @param[in] name The name of provider
42  * @param[in] width The width of provider
43  * @param[in] height The height of provider
44  * @param[in] priority The priority of provider
45  * @param[in] data User data
46  * @pre minicontrol_monitor_start() used to register this callback.
47  * @see #minicontrol_action_e
48  * @see #minicontrol_priority_e
49  */
50 typedef void (*minicontrol_monitor_cb) (minicontrol_action_e action,
51                                         const char *name,
52                                         unsigned int width,
53                                         unsigned int height,
54                                         minicontrol_priority_e priority,
55                                         void *data);
56 typedef void (*minicontrol_monitor_with_handler_cb) (minicontrol_action_e action,
57                                         const char *name,
58                                         unsigned int width,
59                                         unsigned int height,
60                                         minicontrol_priority_e priority,
61                                         minicontrol_h handler,
62                                         void *data);
63
64 /**
65  * @brief Registers a callback for events originated by minicontrol provider.
66  * @param[in] callback Callback function
67  * @param[in] data User data
68  */
69 minicontrol_error_e minicontrol_monitor_start(minicontrol_monitor_cb callback,
70                                         void *data);
71
72 /**
73  * @brief Register a callback for events originated by minicontrol provider
74  * @param[in] callback callback function
75  * @param[in] data user data
76  */
77 minicontrol_error_e minicontrol_monitor_start_with_handler(
78                                 minicontrol_monitor_with_handler_cb callback, void *data);
79 /**
80  * @brief Unregisters a callback for events originated by minicontrol provider.
81  * @return #MINICONTROL_ERROR_NONE if success, other value if failure
82  * @see #minicontrol_error_e
83  */
84 minicontrol_error_e minicontrol_monitor_stop(void);
85
86 /**
87  * @}
88  */
89
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif /* _MINICTRL_MONITOR_H_ */
94