[mediacontroller][common] Use PlatformEnum in MediaController.
[platform/core/api/webapi-plugins.git] / src / mediacontroller / mediacontroller_utils.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #ifndef MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_
18 #define MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_
19
20 #include <media_controller_type.h>
21 #include <functional>
22 #include <map>
23 #include <string>
24
25 #include "common/platform_result.h"
26 #include "common/platform_enum.h"
27
28
29 namespace extension {
30 namespace mediacontroller {
31
32 typedef std::function<void(picojson::value*)> JsonCallback;
33
34
35 namespace types {
36
37 common::PlatformResult ConvertPlaybackState(mc_playback_h playback_h, std::string* state);
38 common::PlatformResult ConvertContentAgeRating(mc_playback_h playback_h, std::string* state);
39 common::PlatformResult ConvertPlaybackPosition(mc_playback_h playback_h, double* position);
40 common::PlatformResult ConvertMetadata(mc_metadata_h metadata_h, picojson::object* metadata);
41
42 extern const common::PlatformEnum<mc_server_state_e> MediaControllerServerStateEnum;
43 extern const common::PlatformEnum<mc_playback_states_e> MediaControllerPlaybackStateEnum;
44 extern const common::PlatformEnum<mc_playback_action_e> MediaControllerPlaybackActionEnum;
45 extern const common::PlatformEnum<mc_meta_e> MediaControllerMetadataAttributeEnum;
46 extern const common::PlatformEnum<mc_repeat_mode_e> MediaControllerRepeatModeEnum;
47 extern const common::PlatformEnum<mc_content_age_rating_e> MediaControllerContentAgeRatingEnum;
48
49 } // namespace types
50
51
52 namespace utils {
53 common::PlatformResult GetAllPlaylists(const std::string& app_id, picojson::array* playlists);
54 }
55
56 }  // namespace mediacontroller
57 }  // namespace extension
58
59 #endif  // MEDIACONTROLLER_MEDIACONTROLLER_UTILS_H_