Remove license/group placeholders\!
[platform/core/api/media-key.git] / include / media_key.h
1 /*
2  * media-key
3  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef __TIZEN_SYSTEM_MEDIA_KEY_H__
19 #define __TIZEN_SYSTEM_MEDIA_KEY_H__
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28  /**
29  * @addtogroup CAPI_SYSTEM_MEDIA_KEY_MODULE
30  * @{
31  */
32
33 /**
34  * @brief Enumeration of error code for media key
35  */
36
37 typedef enum
38 {
39         MEDIA_KEY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
40         MEDIA_KEY_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
41 } media_key_error_e;
42
43
44 /**
45  * @brief Enumeration of media key
46  */
47 typedef enum
48 {
49         MEDIA_KEY_PLAY, /**< */
50         MEDIA_KEY_STOP, /**< */
51         MEDIA_KEY_PAUSE, /**< */
52         MEDIA_KEY_PREVIOUS, /**< */
53         MEDIA_KEY_NEXT, /**< */
54         MEDIA_KEY_FASTFORWARD, /**< */
55         MEDIA_KEY_REWIND, /**< */
56         MEDIA_KEY_UNKNOWN,
57 } media_key_e;
58
59
60 /**
61  * @brief Enumeration of media key event status
62  */
63 typedef enum
64 {
65         MEDIA_KEY_STATUS_PRESSED, /**<  */
66         MEDIA_KEY_STATUS_RELEASED, /**<  */
67         MEDIA_KEY_STATUS_UNKNOWN,
68 } media_key_event_e;
69
70
71 /**
72  * @brief   Called when the status of media key is changed
73  * @param[in] key the key which has status change
74  * @param[in] status the status of key
75  * @param[in] user_data The user data passed from the callback registration function
76  * @pre media_key_reserve() will invoke this callback function.
77  * @see media_key_reserve()
78  * @see media_key_release()
79  */
80 typedef void (*media_key_event_cb)(media_key_e key, media_key_event_e status, void* user_data);
81
82
83 /**
84  * @brief   Registers a change event callback for all media keys.
85  *
86  * @param[in] callback The callback function to invoke
87  * @param[in] user_data The user data to be passed to the callback function
88  *
89  * @return  0 on success, otherwise a negative error value.
90  * @retval  #MEDIA_KEY_ERROR_NONE Successful
91  * @retval  #MEDIA_KEY_ERROR_INVALID_PARAMETER Invalid parameter
92  * @post runtime_info_changed_cb() will be invoked.
93  *
94  * @see media_key_release()
95  * @see media_key_event_cb()
96 */
97 int media_key_reserve(media_key_event_cb callback, void* user_data);
98
99
100 /**
101  * @brief   Unregisters the callback function.
102  *
103  * @param[in] key The runtime information type
104  * @return  0 on success, otherwise a negative error value.
105  * @retval  #MEDIA_KEY_ERROR_NONE Successful
106  * @retval  #MEDIA_KEY_ERROR_INVALID_PARAMETER Invalid parameter
107  *
108  * @see media_key_set_event_cb()
109  */
110 int media_key_release();
111
112
113 /**
114  * @}
115  */
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif /* __TIZEN_SYSTEM_MEDIA_KEY_H__ */
122