Merge "Invoke HAL_DISCOVERY_STATE_STOPPED event once" into tizen
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-avrcp-ctrl-dbus-handler.h
1 /* Bluetooth-frwk
2  *
3  * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
4  *
5  * Contact: Nilesh Trimbake <t.shripati@samsung.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *              http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21
22 #ifndef _BT_HAL_AVRCP_CTRL_DBUS_HANDLER_H_
23 #define _BT_HAL_AVRCP_CTRL_DBUS_HANDLER_H_
24
25 #include <glib.h>
26 #include <sys/types.h>
27
28 #include "bt-hal.h"
29 #include "bt-hal-log.h"
30 #include "bt-hal-msg.h"
31
32 #include "bt-hal-event-receiver.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 typedef enum {
38         PLAY = 0x01,
39         PAUSE,
40         STOP,
41         NEXT,
42         PREVIOUS,
43         PRESS_FAST_FORWARD,
44         RELEASE_FAST_FORWARD,
45         PRESS_REWIND,
46         RELEASE_REWIND,
47         VOLUME_UP,
48         VOLUME_DOWN
49 } media_player_control_cmd;
50
51 typedef enum {
52         EQUALIZER_OFF = 0x01,
53         EQUALIZER_ON,
54         EQUALIZER_INVALID,
55 } media_player_equalizer_status;
56
57 typedef enum {
58         REPEAT_MODE_OFF = 0x01,
59         REPEAT_SINGLE_TRACK,
60         REPEAT_ALL_TRACK,
61         REPEAT_GROUP,
62         REPEAT_INVALID,
63 } media_player_repeat_status;
64
65 typedef enum {
66         SHUFFLE_MODE_OFF = 0x01,
67         SHUFFLE_ALL_TRACK,
68         SHUFFLE_GROUP,
69         SHUFFLE_INVALID,
70 } media_player_shuffle_status;
71
72 typedef enum {
73         SCAN_MODE_OFF = 0x01,
74         SCAN_ALL_TRACK,
75         SCAN_GROUP,
76         SCAN_INVALID,
77 } media_player_scan_status;
78
79 typedef enum {
80         STATUS_STOPPED = 0x00,
81         STATUS_PLAYING,
82         STATUS_PAUSED,
83         STATUS_FORWARD_SEEK,
84         STATUS_REVERSE_SEEK,
85         STATUS_ERROR,
86         STATUS_INVALID
87 } media_player_status;
88
89 typedef struct {
90         int key;
91         const char *property;
92 } bt_player_settinngs_t;
93
94 void _bt_hal_register_avrcp_ctrl_dbus_handler_cb(handle_stack_msg cb);
95
96 void _bt_hal_unregister_avrcp_ctrl_dbus_handler_cb();
97
98 bt_status_t _bt_hal_dbus_handler_avrcp_ctrl_connect(bt_bdaddr_t *bd_addr);
99
100 bt_status_t _bt_hal_dbus_handler_avrcp_ctrl_disconnect(bt_bdaddr_t *bd_addr);
101
102 bt_status_t _bt_hal_dbus_handler_avrcp_ctrl_cmd(bt_bdaddr_t *bd_addr, uint8_t key_code, uint8_t key_state);
103
104 bt_status_t _bt_hal_dbus_handler_avrcp_ctrl_set_property(bt_bdaddr_t *bd_addr, uint8_t type, uint8_t value);
105
106 int _bt_media_attr_to_type(const char *str);
107
108 int _bt_media_attrval_to_val(int type, const char *value);
109
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113 #endif /* _BT_HAL_AVRCP_CTRL_DBUS_HANDLER_H_*/