Add DRAFT stubs for Vehicle plugin
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Mediacontent / MediaConverter.h
1  /*
2  * Copyright (c) 2011 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 _TIZEN_MEDIACONTENT_CONVERTER_H_
18 #define _TIZEN_MEDIACONTENT_CONVERTER_H_
19
20 #include <vector>
21 #include <string>
22 #include <CommonsJavaScript/Converter.h>
23 #include <API/Mediacontent/IMediacontent.h>
24 #include <API/Mediacontent/MediacontentMedia.h>
25 #include <API/Mediacontent/MediacontentFolder.h>
26 #include <API/Mediacontent/MediacontentLyrics.h>
27
28 using namespace TizenApis::Api::Mediacontent;
29 using namespace WrtDeviceApis::Commons;
30 using namespace WrtDeviceApis::CommonsJavaScript;
31
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Mediacontent {
36         
37
38 class MediaConverter : public Converter
39 {
40         public:
41         using Converter::toJSValueRef;
42
43         public:
44         explicit MediaConverter(JSContextRef context);
45
46         JSValueRef toJSValueRefMediacontent(const IMediacontentPtr& arg);
47
48         /**
49         * @throw InvalidArgumentException If not a callback nor JS null.
50         */
51         JSValueRef toFunctionOrNull(const JSValueRef& arg);
52
53         /**
54         * @throw ConversionException If JS null.
55         * @throw InvalidArgumentException If not a callback nor JS null.
56         */
57         JSValueRef toFunction(const JSValueRef& arg);
58         JSValueRef toJSValueRefMedia(const MediacontentMediaPtr& arg);
59         JSValueRef toJSValueRefFolder(const MediacontentFolderPtr& arg);
60         JSValueRef toJSValueRef(const std::vector<MediacontentMediaPtr> &arg);
61         JSValueRef toJSValueRef(const std::vector<MediacontentFolderPtr> &arg);
62         JSValueRef toJSValueRef(const MediacontentLyricsPtr &arg);
63
64
65         MediacontentMediaListPtr toVectorOfMediaItem(JSValueRef events);
66
67     
68 };
69
70 typedef ConverterFactory<MediaConverter> MediaConverterFactory;
71
72
73 }
74 }
75 }
76
77 #endif // _TIZEN_MEDIACONTENT_CONVERTER_H_