Update change log and spec for wrt-plugins-tizen_0.4.46
[platform/framework/web/wrt-plugins-tizen.git] / src / Callhistory / Converter.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #ifndef TIZEN_APIS_CALL_CONVERTER_H_
20 #define TIZEN_APIS_CALL_CONVERTER_H_
21
22 #include <vector>
23 #include <string>
24 #include <map>
25 #include <JavaScriptCore/JavaScript.h>
26 #include <CommonsJavaScript/Converter.h>
27 #include "CallHistoryEntryProperties.h"
28 #include "RemoteParty.h"
29 #include <ContactConverter.h>
30 #include "CallHistoryMultiCallback.h"
31
32 namespace DeviceAPI {
33 namespace CallHistory {
34
35 class Converter : public WrtDeviceApis::CommonsJavaScript::Converter
36 {
37 public:
38         using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
39
40 public:
41         explicit Converter(JSContextRef context);
42
43         std::vector<unsigned long> toVectorOfULongs(const JSValueRef& jsValue);
44
45         CallHistoryEntryList toVectorOfCallHistoryEntryProperties(const JSValueRef& jsValue);
46
47         StringArrayPtr toStringArray(const JSValueRef &jsValue);
48
49         RemotePartyListPtr toRemotePartyList(const JSValueRef &jsValue);
50
51         RemotePartyPtr toRemoteParty(const JSValueRef &jsValue);
52
53         CallHistoryEntryPropertiesPtr toCallHistoryEntryProperties(const JSValueRef &jsValue);
54
55         EventCallHistoryListenerPrivateDataPtr toEventCallHistoryListenerPrivateData(const JSValueRef &jsValue, JSContextRef context);
56
57         JSValueRef toJSValueRef(const CallHistoryEntryListPtr &arg, JSContextRef context);
58
59         JSValueRef toJSValueRef(const StringArrayPtr &arg, JSContextRef context);
60
61         JSValueRef toJSValueRef(const RemotePartyListPtr& arg, JSContextRef context);
62
63 private:
64         bool initializeAllowedProperties();
65 };
66
67 typedef WrtDeviceApis::CommonsJavaScript::ConverterFactory<Converter> ConverterFactory;
68 typedef ConverterFactory::ConverterType ConverterPtr;
69 }
70 }
71
72 #endif