summaryrefslogtreecommitdiff
path: root/include/minicontrol-monitor.h
blob: 496bbb1fcdea952b5aea006dc76cdb054479cf1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://floralicense.org/license/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _MINICTRL_MONITOR_H_
#define _MINICTRL_MONITOR_H_

#include <minicontrol-error.h>
#include <minicontrol-type.h>

/**
 * @defgroup MINICONTROL_MONITOR_LIBRARY minicontrol monitor library
 * @brief This minicontrol monitor library used to manage events triggered by minicontrol provider
 */

/**
 * @ingroup MINICONTROL_MONITOR_LIBRARY
 * @defgroup MINICONTROL_MONITOR_LIBRARY_TYPE minicontrol monitor library type
 * @brief minicontrol monitor library type
 */

/**
 * @addtogroup MINICONTROL_MONITOR_LIBRARY_TYPE
 * @{
 */

  /**
 * @brief Called when event is triggered
 * @param[in] action The type of fired event
 * @param[in] name The name of provider
 * @param[in] width The width of provider
 * @param[in] height The height of provider
 * @param[in] priority The priority of provider
 * @param[in] data user data
 * @pre minicontrol_monitor_start() used to register this callback
 * @see #minicontrol_action_e
 * @see #minicontrol_priority_e
 */
typedef void (*minicontrol_monitor_cb) (minicontrol_action_e action,
					const char *name,
					unsigned int width,
					unsigned int height,
					minicontrol_priority_e priority,
					void *data);

/**
 * @addtogroup MINICONTROL_MONITOR_LIBRARY
 * @{
 */

/**
 * @brief Register a callback for events originated by minicontrol provider
 * @param[in] callback callback function
 * @param[in] data user data
 */
minicontrol_error_e minicontrol_monitor_start(minicontrol_monitor_cb callback,
					void *data);

/**
 * @brief Unregister a callback for events originated by minicontrol provider
 * @return #MINICONTROL_ERROR_NONE if success, other value if failure
 * @see #minicontrol_error_e
 */
minicontrol_error_e minicontrol_monitor_stop(void);

#endif /* _MINICTRL_MONITOR_H_ */