3 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_SYSTEM_MEDIA_KEY_H__
19 #define __TIZEN_SYSTEM_MEDIA_KEY_H__
29 * @addtogroup CAPI_SYSTEM_MEDIA_KEY_MODULE
34 * @brief Enumeration of error code for media key
39 MEDIA_KEY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
40 MEDIA_KEY_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
45 * @brief Enumeration of media key
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, /**< */
61 * @brief Enumeration of media key event status
65 MEDIA_KEY_STATUS_PRESSED, /**< */
66 MEDIA_KEY_STATUS_RELEASED, /**< */
67 MEDIA_KEY_STATUS_UNKNOWN,
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()
80 typedef void (*media_key_event_cb)(media_key_e key, media_key_event_e status, void* user_data);
84 * @brief Registers a change event callback for all media keys.
86 * @param[in] callback The callback function to invoke
87 * @param[in] user_data The user data to be passed to the callback function
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.
94 * @see media_key_release()
95 * @see media_key_event_cb()
97 int media_key_reserve(media_key_event_cb callback, void* user_data);
101 * @brief Unregisters the callback function.
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
108 * @see media_key_set_event_cb()
110 int media_key_release();
121 #endif /* __TIZEN_SYSTEM_MEDIA_KEY_H__ */