summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:45:59 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:45:59 +0900
commit4a79ffd3a0c4a5e327c88ecc93d29c2a5ebfe406 (patch)
tree19b54317c55311b00efcd0127b5eb3da9df375f9 /include
parent0bd165226db5510b590464688ad1b1983625224c (diff)
downloadmedia-key-4a79ffd3a0c4a5e327c88ecc93d29c2a5ebfe406.tar.gz
media-key-4a79ffd3a0c4a5e327c88ecc93d29c2a5ebfe406.tar.bz2
media-key-4a79ffd3a0c4a5e327c88ecc93d29c2a5ebfe406.zip
Diffstat (limited to 'include')
-rwxr-xr-xinclude/media_key.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/include/media_key.h b/include/media_key.h
new file mode 100755
index 0000000..c2494f0
--- /dev/null
+++ b/include/media_key.h
@@ -0,0 +1,122 @@
+/*
+ * media-key
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 __TIZEN_SYSTEM_MEDIA_KEY_H__
+#define __TIZEN_SYSTEM_MEDIA_KEY_H__
+
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /**
+ * @addtogroup CAPI_SYSTEM_MEDIA_KEY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration of error code for media key
+ */
+
+typedef enum
+{
+ MEDIA_KEY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ MEDIA_KEY_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+} media_key_error_e;
+
+
+/**
+ * @brief Enumeration of media key
+ */
+typedef enum
+{
+ MEDIA_KEY_PLAY, /**< */
+ MEDIA_KEY_STOP, /**< */
+ MEDIA_KEY_PAUSE, /**< */
+ MEDIA_KEY_PREVIOUS, /**< */
+ MEDIA_KEY_NEXT, /**< */
+ MEDIA_KEY_FASTFORWARD, /**< */
+ MEDIA_KEY_REWIND, /**< */
+ MEDIA_KEY_UNKNOWN,
+} media_key_e;
+
+
+/**
+ * @brief Enumeration of media key event status
+ */
+typedef enum
+{
+ MEDIA_KEY_STATUS_PRESSED, /**< */
+ MEDIA_KEY_STATUS_RELEASED, /**< */
+ MEDIA_KEY_STATUS_UNKNOWN,
+} media_key_event_e;
+
+
+/**
+ * @brief Called when the status of media key is changed
+ * @param[in] key the key which has status change
+ * @param[in] status the status of key
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre media_key_reserve() will invoke this callback function.
+ * @see media_key_reserve()
+ * @see media_key_release()
+ */
+typedef void (*media_key_event_cb)(media_key_e key, media_key_event_e status, void* user_data);
+
+
+/**
+ * @brief Registers a change event callback for all media keys.
+ *
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_KEY_ERROR_NONE Successful
+ * @retval #MEDIA_KEY_ERROR_INVALID_PARAMETER Invalid parameter
+ * @post runtime_info_changed_cb() will be invoked.
+ *
+ * @see media_key_release()
+ * @see media_key_event_cb()
+*/
+int media_key_reserve(media_key_event_cb callback, void* user_data);
+
+
+/**
+ * @brief Unregisters the callback function.
+ *
+ * @param[in] key The runtime information type
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_KEY_ERROR_NONE Successful
+ * @retval #MEDIA_KEY_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_key_set_event_cb()
+ */
+int media_key_release();
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_SYSTEM_MEDIA_KEY_H__ */
+