Updated the license and boilerplate
[apps/home/minicontrol.git] / include / minicontrol-monitor.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @defgroup MINICONTROL_MONITOR_LIBRARY minicontrol monitor library
29  * @brief This minicontrol monitor library used to manage events triggered by minicontrol provider
30  */
31
32 /**
33  * @ingroup MINICONTROL_MONITOR_LIBRARY
34  * @defgroup MINICONTROL_MONITOR_LIBRARY_TYPE minicontrol monitor library type
35  * @brief minicontrol monitor library type
36  */
37
38 /**
39  * @addtogroup MINICONTROL_MONITOR_LIBRARY_TYPE
40  * @{
41  */
42
43   /**
44  * @brief Called when event is triggered
45  * @param[in] action The type of fired event
46  * @param[in] name The name of provider
47  * @param[in] width The width of provider
48  * @param[in] height The height of provider
49  * @param[in] priority The priority of provider
50  * @param[in] data user data
51  * @pre minicontrol_monitor_start() used to register this callback
52  * @see #minicontrol_action_e
53  * @see #minicontrol_priority_e
54  */
55 typedef void (*minicontrol_monitor_cb) (minicontrol_action_e action,
56                                         const char *name,
57                                         unsigned int width,
58                                         unsigned int height,
59                                         minicontrol_priority_e priority,
60                                         void *data);
61
62 /**
63  * @addtogroup MINICONTROL_MONITOR_LIBRARY
64  * @{
65  */
66
67 /**
68  * @brief Register a callback for events originated by minicontrol provider
69  * @param[in] callback callback function
70  * @param[in] data user data
71  */
72 minicontrol_error_e minicontrol_monitor_start(minicontrol_monitor_cb callback,
73                                         void *data);
74
75 /**
76  * @brief Unregister a callback for events originated by minicontrol provider
77  * @return #MINICONTROL_ERROR_NONE if success, other value if failure
78  * @see #minicontrol_error_e
79  */
80 minicontrol_error_e minicontrol_monitor_stop(void);
81
82 #ifdef __cplusplus
83 }
84 #endif
85 #endif /* _MINICTRL_MONITOR_H_ */
86