upload tizen1.0 source
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Call / Converter.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
18 #ifndef TIZEN_APIS_CALL_CONVERTER_H_
19 #define TIZEN_APIS_CALL_CONVERTER_H_
20
21 #include <vector>
22 #include <string>
23 #include <map>
24 #include <JavaScriptCore/JavaScript.h>
25 #include <CommonsJavaScript/Converter.h>
26 #include <API/Call/CallHistoryEntryProperties.h>
27 #include <API/Call/RemoteParty.h>
28 #include <Tizen/Contact/ContactConverter.h>
29 #include "CallMultiCallback.h"
30
31 namespace TizenApis {
32 namespace Tizen1_0 {
33 class Converter : public WrtDeviceApis::CommonsJavaScript::Converter
34 {
35 public:
36         using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
37
38 public:
39         explicit Converter(JSContextRef context);
40
41         std::vector<unsigned long> toVectorOfULongs(const JSValueRef& jsValue);
42
43         Api::Call::CallHistoryEntryList toVectorOfCallHistoryEntryProperties(const JSValueRef& jsValue);
44
45         Api::Call::StringArrayPtr toStringArray(const JSValueRef &jsValue);
46
47         Api::Call::RemotePartyListPtr toRemotePartyList(const JSValueRef &jsValue);
48
49         Api::Call::RemotePartyPtr toRemoteParty(const JSValueRef &jsValue);
50
51         Api::Call::CallHistoryEntryPropertiesPtr toCallHistoryEntryProperties(const JSValueRef &jsValue);
52
53         EventCallHistoryListenerPrivateDataPtr toEventCallHistoryListenerPrivateData(const JSValueRef &jsValue, JSContextRef context);
54
55         JSValueRef toJSValueRef(const Api::Call::CallHistoryEntryListPtr &arg, JSContextRef context);
56
57         JSValueRef toJSValueRef(const Api::Call::StringArrayPtr &arg, JSContextRef context);
58
59         JSValueRef toJSValueRef(const Api::Call::RemotePartyListPtr& arg, JSContextRef context);
60
61 private:
62         bool initializeAllowedProperties();
63 };
64
65 typedef WrtDeviceApis::CommonsJavaScript::ConverterFactory<Converter> ConverterFactory;
66 typedef ConverterFactory::ConverterType ConverterPtr;
67 }
68 }
69
70 #endif