2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef TIZEN_APIS_CALL_CONVERTER_H_
19 #define TIZEN_APIS_CALL_CONVERTER_H_
24 #include <JavaScriptCore/JavaScript.h>
25 #include <CommonsJavaScript/Converter.h>
26 #include <API/Account/AccountServices.h>
27 #include <API/Call/CallHistoryEntryProperties.h>
28 #include <API/Call/RemoteParty.h>
29 #include <API/Call/CallServiceFilter.h>
30 #include "CallMultiCallback.h"
34 class Converter : public WrtDeviceApis::CommonsJavaScript::Converter
37 using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
40 explicit Converter(JSContextRef context);
42 std::vector<unsigned long> toVectorOfULongs(const JSValueRef& arg);
44 Api::Call::CallHistoryEntryList toVectorOfCallHistoryEntryProperties(const JSValueRef& arg);
46 Api::Call::StringArrayPtr toStringArray(const JSValueRef &jsValue);
48 Api::Call::RemotePartyListPtr toRemotePartyList(const JSValueRef &jsValue);
50 Api::Call::RemotePartyPtr toRemoteParty(const JSValueRef &jsValue);
52 Api::Call::CallServiceFilterPtr toCallServiceFilter(const JSValueRef &jsValue);
54 Api::Call::CallHistoryEntryPropertiesPtr toCallHistoryEntryProperties(const JSValueRef &jsValue);
56 EventCallHistoryListenerPrivateDataPtr toEventCallHistoryListenerPrivateData(JSValueRef successParam, JSContextRef context);
58 JSValueRef toJSValueRef(const Api::Call::CallHistoryEntryListPtr &arg, JSContextRef context);
60 JSValueRef toJSValueRef(const Api::Call::StringArrayPtr &arg, JSContextRef context);
62 JSValueRef toJSValueRef(const Api::Call::RemotePartyListPtr& arg, JSContextRef context);
64 JSValueRef toJSValueRef(const Api::Account::AccountServicesArrayPtr& arg, JSContextRef context);
67 bool initializeAllowedProperties();
68 static std::vector<std::string> m_allowedCallHistoryEntryProperties;
69 static std::vector<std::string> m_allowedRemoteParty;
70 static std::vector<std::string> m_allowedCallServiceFilter;
73 typedef WrtDeviceApis::CommonsJavaScript::ConverterFactory<Converter> ConverterFactory;
74 typedef ConverterFactory::ConverterType ConverterPtr;