Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.2.85
+Version: 0.2.86
Release: 0
Group: TO_BE_FILLED
License: TO_BE_FILLED
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Commons/ThreadPool.h>
+#include "Vehicle.h"
+#include <dpl/log/log.h>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+Vehicle::Vehicle()
+/* TODO: Check thread id as it may not be same as module name */
+ : WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGetSupportedEventTypes>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD),
+ WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGet>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD),
+ WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventSet>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD)
+{
+ LogDebug("entered: src/platform/API/Vehicle/Vehicle.cpp");
+}
+
+Vehicle::~Vehicle()
+{
+}
+
+void Vehicle::getSupportedEventTypes(DPL::SharedPtr<VehicleEventGetSupportedEventTypes> &event)
+{
+ WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGetSupportedEventTypes>::PostRequest(event);
+}
+
+void Vehicle::get(DPL::SharedPtr<VehicleEventGet> &event)
+{
+ WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGet>::PostRequest(event);
+}
+
+void Vehicle::set(DPL::SharedPtr<VehicleEventSet> &event)
+{
+ WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventSet>::PostRequest(event);
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLE_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLE_H
+
+#include <dpl/shared_ptr.h>
+#include <vector>
+#include <Commons/EventReceiver.h>
+#include <vector>
+#include <string>
+#include "VehicleEventGet.h"
+#include "VehicleEventGetSupportedEventTypes.h"
+#include "VehicleEventSet.h"
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class Vehicle
+ : public WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGetSupportedEventTypes>,
+ public WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventGet>,
+ public WrtDeviceApis::Commons::EventRequestReceiver<VehicleEventSet>
+{
+public:
+ Vehicle();
+
+ virtual ~Vehicle();
+
+ virtual void getSupportedEventTypes(DPL::SharedPtr<VehicleEventGetSupportedEventTypes> &event);
+
+ virtual void get(DPL::SharedPtr<VehicleEventGet> &event);
+
+ virtual void set(DPL::SharedPtr<VehicleEventSet> &event);
+
+protected:
+ virtual void OnRequestReceived(const DPL::SharedPtr< VehicleEventGetSupportedEventTypes > &event) = 0;
+
+ virtual void OnRequestReceived(const DPL::SharedPtr< VehicleEventGet > &event) = 0;
+
+ virtual void OnRequestReceived(const DPL::SharedPtr< VehicleEventSet > &event) = 0;
+
+};
+
+typedef DPL::SharedPtr<Vehicle> VehiclePtr;
+typedef std::vector< VehiclePtr > VehiclePtrArray;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLE_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "VehicleEventGet.h"
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleEventGet::VehicleEventGet()
+: m_result(false)
+{
+}
+
+VehicleEventGet::~VehicleEventGet()
+{
+}
+
+bool VehicleEventGet::getResult() const
+{
+ return m_result;
+}
+
+void VehicleEventGet::setResult(bool res)
+{
+ m_result = res;
+}
+
+std::string VehicleEventGet::getEvent() const
+{
+ return m_mevent;
+}
+
+void VehicleEventGet::setEvent(const std::string& arg)
+{
+ /* TODO: Add more implementation specific details */
+}
+
+
+DPL::SharedPtr<int> VehicleEventGet::getInt() const
+{
+ return m_mint;
+}
+
+void VehicleEventGet::setInt(const DPL::SharedPtr<int>& arg)
+{
+ /* TODO: Add more implementation specific details */
+}
+
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGET_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGET_H
+
+#include <Commons/IEvent.h>
+#include <dpl/shared_ptr.h>
+#include <string>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleEventGet : public WrtDeviceApis::Commons::IEvent<VehicleEventGet>
+{
+public:
+ VehicleEventGet();
+
+ ~VehicleEventGet();
+
+ bool getResult() const;
+
+ void setResult(bool res);
+
+ std::string getEvent() const;
+ void setEvent(const std::string& arg);
+
+ DPL::SharedPtr<int> getInt() const;
+ void setInt(const DPL::SharedPtr<int>& arg);
+
+ /* TODO: Manually declare callback arguments (if any required) */
+
+protected:
+ bool m_result;
+ std::string m_mevent;
+ DPL::SharedPtr<int> m_mint;
+};
+
+typedef DPL::SharedPtr<VehicleEventGet> VehicleEventGetPtr;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGET_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "VehicleEventGetSupportedEventTypes.h"
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleEventGetSupportedEventTypes::VehicleEventGetSupportedEventTypes()
+: m_result(false)
+{
+}
+
+VehicleEventGetSupportedEventTypes::~VehicleEventGetSupportedEventTypes()
+{
+}
+
+bool VehicleEventGetSupportedEventTypes::getResult() const
+{
+ return m_result;
+}
+
+void VehicleEventGetSupportedEventTypes::setResult(bool res)
+{
+ m_result = res;
+}
+
+std::string VehicleEventGetSupportedEventTypes::getType() const
+{
+ return m_mtype;
+}
+
+void VehicleEventGetSupportedEventTypes::setType(const std::string& arg)
+{
+ m_mtype = arg;
+}
+
+
+bool VehicleEventGetSupportedEventTypes::getWriteable() const
+{
+ return m_mwriteable;
+}
+
+void VehicleEventGetSupportedEventTypes::setWriteable(bool arg)
+{
+ m_mwriteable = arg;
+}
+
+std::vector< std::string > VehicleEventGetSupportedEventTypes::getCallbackFuncReturnData() const
+{
+ return m_mreturnData;
+}
+
+void VehicleEventGetSupportedEventTypes::setCallbackFuncReturnData(const std::vector< std::string >& arg)
+{
+ m_mreturnData = arg;
+}
+
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGETSUPPORTEDEVENTTYPES_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGETSUPPORTEDEVENTTYPES_H
+
+#include <Commons/IEvent.h>
+#include <dpl/shared_ptr.h>
+#include <vector>
+#include <string>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleEventGetSupportedEventTypes : public WrtDeviceApis::Commons::IEvent<VehicleEventGetSupportedEventTypes>
+{
+public:
+ VehicleEventGetSupportedEventTypes();
+
+ ~VehicleEventGetSupportedEventTypes();
+
+ bool getResult() const;
+
+ void setResult(bool res);
+
+ std::string getType() const;
+ void setType(const std::string& arg);
+
+ bool getWriteable() const;
+ void setWriteable(bool arg);
+
+ std::vector< std::string > getCallbackFuncReturnData() const;
+ void setCallbackFuncReturnData(const std::vector< std::string >& arg);
+
+protected:
+ bool m_result;
+ std::string m_mtype;
+ bool m_mwriteable;
+ std::vector< std::string > m_mreturnData;
+};
+
+typedef DPL::SharedPtr<VehicleEventGetSupportedEventTypes> VehicleEventGetSupportedEventTypesPtr;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTGETSUPPORTEDEVENTTYPES_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "VehicleEventSet.h"
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleEventSet::VehicleEventSet()
+: m_result(false)
+{
+}
+
+VehicleEventSet::~VehicleEventSet()
+{
+}
+
+bool VehicleEventSet::getResult() const
+{
+ return m_result;
+}
+
+void VehicleEventSet::setResult(bool res)
+{
+ m_result = res;
+}
+
+std::string VehicleEventSet::getEvent() const
+{
+ return m_mevent;
+}
+
+void VehicleEventSet::setEvent(const std::string& arg)
+{
+ /* TODO: Add more implementation specific details */
+}
+
+
+DPL::SharedPtr<int> VehicleEventSet::getValue() const
+{
+ return m_mvalue;
+}
+
+void VehicleEventSet::setValue(const DPL::SharedPtr<int>& arg)
+{
+ /* TODO: Add more implementation specific details */
+}
+
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTSET_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTSET_H
+
+#include <Commons/IEvent.h>
+#include <dpl/shared_ptr.h>
+#include <string>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleEventSet : public WrtDeviceApis::Commons::IEvent<VehicleEventSet>
+{
+public:
+ VehicleEventSet();
+
+ ~VehicleEventSet();
+
+ bool getResult() const;
+
+ void setResult(bool res);
+
+ std::string getEvent() const;
+ void setEvent(const std::string& arg);
+
+ DPL::SharedPtr<int> getValue() const;
+ void setValue(const DPL::SharedPtr<int>& arg);
+
+ /* TODO: Manually declare callback arguments (if any required) */
+
+protected:
+ bool m_result;
+ std::string m_mevent;
+ DPL::SharedPtr<int> m_mvalue;
+};
+
+typedef DPL::SharedPtr<VehicleEventSet> VehicleEventSetPtr;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLE_VEHICLEEVENTSET_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "VehicleFactory.h"
+#include "Vehicle.h"
+#include <Tizen/Vehicle/Vehicle.h>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleFactory::VehicleFactory()
+{
+}
+
+VehicleFactory::~VehicleFactory()
+{
+}
+
+VehicleFactory& VehicleFactory::getInstance()
+{
+ static VehicleFactory theInstance;
+ return theInstance;
+}
+
+DPL::SharedPtr< Vehicle > VehicleFactory::createVehicleObject()
+{
+
+ VehiclePtr result(new TizenApis::Platform::Vehicle::Vehicle());
+ return result;
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLEFACTORY_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLEFACTORY_H
+
+#include <dpl/shared_ptr.h>
+#include <dpl/noncopyable.h>
+
+namespace TizenApis {
+namespace Vehicle {
+
+class Vehicle;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleFactory : private DPL::Noncopyable
+{
+public:
+ static VehicleFactory& getInstance();
+
+ virtual ~VehicleFactory();
+
+ DPL::SharedPtr< Vehicle > createVehicleObject();
+
+private:
+ VehicleFactory();
+};
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLEFACTORY_H
+
--- /dev/null
+
+get_current_path()
+set(SRCS_PLATFORM_API_VEHICLE
+ ${CURRENT_PATH}/VehicleEventGet.cpp
+ ${CURRENT_PATH}/VehicleEventGetSupportedEventTypes.cpp
+ ${CURRENT_PATH}/VehicleFactory.cpp
+ ${CURRENT_PATH}/VehicleEventSet.cpp
+ ${CURRENT_PATH}/Vehicle.cpp
+ PARENT_SCOPE
+)
include_config_file(Notification)
include_config_file(Download)
include_config_file(Device)
+include_config_file(Vehicle)
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "Vehicle.h"
+//#include "MessageSender.h"
+#include <DBus/Connection.h>
+#include <DBus/MessageEvent.h>
+#include <dpl/log/log.h>
+
+using namespace TizenApis::Platform::DBus;
+using namespace WrtDeviceApis::Commons;
+
+namespace TizenApis {
+namespace Platform {
+namespace Vehicle {
+
+Vehicle::Vehicle() :
+ m_dbusConnection(new DBus::Connection()),
+ m_dbusWorkerThread(new DPL::Thread())
+{
+ LogDebug("!#!entered: src/platform/Tizen/Vehicle/Vehicle.cpp");
+ m_dbusWorkerThread->Run();
+ m_dbusConnection->setWorkerThread(m_dbusWorkerThread);
+ m_dbusConnection->addFilter("interface='org.automotive'");
+ m_dbusConnection->AddListener(this);
+}
+
+Vehicle::~Vehicle()
+{
+ /*TODO: add details*/
+ LogDebug("entered");
+ m_dbusConnection->RemoveListener(this);
+ m_dbusWorkerThread->Quit();
+ delete m_dbusWorkerThread;
+}
+
+void Vehicle::OnEventReceived(const DBus::MessageEvent& event)
+{
+ LogDebug("entered Vehicle::OnEventReceived2");
+ DBus::MessagePtr message = event.GetArg0();
+ DBus::Message::ReadIterator it = message->getReadIterator();
+
+ while (it->isValid()) {
+ LogDebug("message: " << it->getArgType() << " (arg type), " << it->getInt() << "(int).");
+ it->next();
+ }
+}
+
+void Vehicle::OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventGetSupportedEventTypes > &event)
+{
+
+ LogDebug("received function parameters " << event->getWriteable() << " and " << event->getType());
+
+ std::vector< std::string > vec;
+
+ vec.push_back("running_status_speedometer");
+ vec.push_back("running_status_engine_speed");
+ vec.push_back("running_status_transmission_gear_status");
+ vec.push_back("running_status_steering_wheel_angle");
+
+
+ event->setCallbackFuncReturnData(vec);
+ event->setResult(true);
+
+ //m_dbusConnection->open(DBUS_BUS_SYSTEM);
+}
+
+void Vehicle::OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventGet > &event)
+{
+ /*TODO: add details*/
+ LogDebug("entered");
+}
+
+void Vehicle::OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventSet > &event)
+{
+ /*TODO: add details*/
+ LogDebug("entered");
+}
+
+} //namespace Vehicle
+} //namespace Platform
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_PLATFORM_VEHICLE_VEHICLE_H
+#define TIZENAPIS_TIZEN_PLATFORM_VEHICLE_VEHICLE_H
+
+#include <dpl/shared_ptr.h>
+#include <dpl/event/event_listener.h>
+#include <API/Vehicle/Vehicle.h>
+#include <DBus/Connection.h>
+#include <DBus/MessageEvent.h>
+
+
+namespace TizenApis {
+namespace Platform {
+namespace Vehicle {
+
+class Vehicle
+ : public TizenApis::Vehicle::Vehicle,
+ private DPL::Event::EventListener<DBus::MessageEvent>
+{
+public:
+ Vehicle();
+
+ virtual ~Vehicle();
+
+protected:
+ virtual void OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventGetSupportedEventTypes > &event);
+
+ virtual void OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventGet > &event);
+
+ virtual void OnRequestReceived(const DPL::SharedPtr< TizenApis::Vehicle::VehicleEventSet > &event);
+
+ protected:
+ void OnEventReceived(const DBus::MessageEvent& event);
+
+ private:
+ DBus::ConnectionPtr m_dbusConnection;
+ DPL::Thread* m_dbusWorkerThread;
+
+};
+
+} //namespace Vehicle
+} //namespace Platform
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_PLATFORM_VEHICLE_VEHICLE_H
+
--- /dev/null
+get_current_path()
+
+set(INCLUDES_PLATFORM_IMPLEMENTATION_VEHICLE
+ ${INCLUDES_PLATFORM_IMPLEMENTATION_DBUS}
+ PARENT_SCOPE
+)
+
+set(LIBS_PLATFORM_IMPLEMENTATION_VEHICLE
+ ${LIBS_PLATFORM_IMPLEMENTATION_DBUS}
+ PARENT_SCOPE
+)
+
+set(SRCS_PLATFORM_IMPLEMENTATION_VEHICLE
+ ${CURRENT_PATH}/Vehicle.cpp
+ ${SRCS_PLATFORM_IMPLEMENTATION_DBUS}
+ PARENT_SCOPE
+)
include_config_file(Notification)
include_config_file(Download)
include_config_file(Device)
+include_config_file(Vehicle)
add_subdir(Notification)
add_subdir(Download)
add_subdir(Device)
+add_subdir(Vehicle)
#add_subdir(SecureStorage)
#add_subdir(Account)
#add_subdir(DeviceInteraction)
--- /dev/null
+set(TARGET_NAME "wrt-plugins-tizen-1.0-vehicle")
+set(DESTINATION_NAME "tizen-1.0-vehicle")
+set(TARGET_IMPL_NAME "wrt-plugins-tizen-1.0-vehicle-impl")
+
+# TODO: Add package dependences here e.g.
+# pkg_search_module(wrt-plugins-plugin-manager REQUIRED wrt-plugins-plugin-manager)
+# include_directories(
+# ${wrt-plugins-plugin-manager_INCLUDE_DIRS}
+# )
+
+include_directories(
+ ${INCLUDES_PLATFORM_IMPLEMENTATION_VEHICLE}
+)
+
+set(CMAKE_INSTALL_RPATH
+ ${CMAKE_INSTALL_RPATH}
+ ${CMAKE_INSTALL_PREFIX}/${DESTINATION_NAME}
+ ${CMAKE_INSTALL_PREFIX}/tizen-1.0-tizen
+)
+
+set(SRCS_IMPL
+ ${SRCS_PLATFORM_API_VEHICLE}
+ ${SRCS_PLATFORM_IMPLEMENTATION_VEHICLE}
+ VehicleAsyncCallbackManager.cpp
+ JSVehicle.cpp
+ VehicleResponseDispatcher.cpp
+ VehicleListenerManager.cpp
+ VehicleConverter.cpp
+ PluginConfig.cpp
+)
+
+add_library(${TARGET_IMPL_NAME} SHARED ${SRCS_IMPL})
+target_link_libraries(${TARGET_IMPL_NAME}
+ ${LIBS_COMMON}
+ ${LIBS_PLATFORM_IMPLEMENTATION_VEHICLE}
+ wrt-plugins-tizen-1.0-tizen-impl
+)
+
+set(SRCS
+ PluginInitializer.cpp
+)
+
+add_library(${TARGET_NAME} SHARED ${SRCS})
+target_link_libraries(${TARGET_NAME}
+ ${TARGET_IMPL_NAME}
+)
+
+INSTALL(TARGETS ${TARGET_NAME} ${TARGET_IMPL_NAME} LIBRARY DESTINATION ${DESTINATION_NAME})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.xml DESTINATION ${DESTINATION_NAME})
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Tizen/Common/JSTizenException.h>
+#include <Tizen/Common/JSTizenExceptionFactory.h>
+#include <Tizen/Common/SecurityExceptions.h>
+#include <CommonsJavaScript/PrivateObject.h>
+#include <CommonsJavaScript/Converter.h>
+#include <CommonsJavaScript/JSUtils.h>
+#include <CommonsJavaScript/Utils.h>
+#include <CommonsJavaScript/Validator.h>
+#include <CommonsJavaScript/ScopedJSStringRef.h>
+#include <CommonsJavaScript/JSCallbackManager.h>
+#include <dpl/log/log.h>
+#include <API/Vehicle/VehicleFactory.h>
+
+#include "JSVehicle.h"
+#include <vector>
+#include <string>
+#include <API/Vehicle/VehicleEventGet.h>
+#include <API/Vehicle/VehicleEventSet.h>
+#include <API/Vehicle/VehicleEventGetSupportedEventTypes.h>
+#include "VehicleConverter.h"
+#include "VehicleConverter.h"
+#include "PluginConfig.h"
+
+#include "VehicleResponseDispatcher.h"
+#include "VehicleAsyncCallbackManager.h"
+
+
+using namespace WrtDeviceApis::Commons;
+using namespace WrtDeviceApis::CommonsJavaScript;
+using namespace TizenApis::Commons;
+
+namespace TizenApis {
+namespace Vehicle {
+
+typedef WrtDeviceApis::CommonsJavaScript::PrivateObject< DPL::SharedPtr<Vehicle>, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSVehiclePriv;
+
+JSClassRef JSVehicle::m_classRef = NULL;
+
+JSStaticFunction JSVehicle::m_functions[] = {
+ { VEHICLE_FUNCTION_API_GETSUPPORTEDEVENTTYPES, JSVehicle::getSupportedEventTypes, kJSPropertyAttributeNone},
+ { VEHICLE_FUNCTION_API_GET, JSVehicle::get, kJSPropertyAttributeNone},
+ { VEHICLE_FUNCTION_API_SET, JSVehicle::set, kJSPropertyAttributeNone},
+ { 0, 0, 0 }/*name, callAsFunction, attributes*/
+};
+
+JSStaticValue JSVehicle::m_properties[] = {
+ { 0, 0, 0, 0 } /*name, getProperty, setProperty, attributes*/
+};
+
+JSClassDefinition JSVehicle::m_classDefinition = {
+ 0, /* int version; current (and only) version is 0 */
+ kJSClassAttributeNone, /* JSClassAttributes attributes; */
+ "Vehicle", /* const char* className; */
+ NULL, /* JSClassRef parentClass; */
+ JSVehicle::m_properties, /* const JSStaticValue* staticValues; */
+ JSVehicle::m_functions, /* const JSStaticFunction* staticFunctions; */
+ JSVehicle::initialize, /* JSObjectInitializeCallback initialize; */
+ JSVehicle::finalize, /* JSObjectFinalizeCallback finalize; */
+ NULL, /* JSObjectHasPropertyCallback hasProperty; */
+ NULL, /* JSObjectGetPropertyCallback getProperty; */
+ NULL, /* JSObjectSetPropertyCallback setProperty; */
+ NULL, /* JSObjectDeletePropertyCallback deleteProperty; */
+ NULL, /* JSObjectGetPropertyNamesCallback getPropertyNames; */
+ NULL, /* JSObjectCallAsFunctionCallback callAsFunction; */
+ NULL, /* JSObjectCallAsConstructorCallback callAsConstructor; */
+ NULL, /* JSObjectHasInstanceCallback hasInstance; */
+ NULL /* JSObjectConvertToTypeCallback convertToType; */
+};
+
+JSVehicle::JSVehicle()
+{
+ /* TODO: Add more implementation specific details */
+}
+
+JSVehicle::~JSVehicle()
+{
+ /* TODO: Add more implementation specific details */
+}
+
+const JSClassRef JSVehicle::getClassRef()
+{
+ if (!m_classRef) {
+ m_classRef = JSClassCreate(&m_classDefinition);
+ }
+ return m_classRef;
+}
+
+JSValueRef JSVehicle::createJSObject(JSContextRef context,
+ const DPL::SharedPtr<Vehicle>& impl)
+{
+ JSVehiclePriv *priv = new JSVehiclePriv(context, impl);
+ JSObjectRef result = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
+ if (result == NULL) {
+ LogError("object creation error");
+ return JSValueMakeUndefined(context);
+ }
+ return result;
+}
+
+DPL::SharedPtr<Vehicle> JSVehicle::getVehiclePtr(JSContextRef context,
+ JSValueRef value)
+{
+ if (!JSValueIsObjectOfClass(context, value, getClassRef())) {
+ ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Invalid Argument");
+ }
+ JSObjectRef object = JSValueToObject(context, value, NULL);
+ return getVehiclePtr(context, object);
+}
+
+DPL::SharedPtr<Vehicle> JSVehicle::getVehiclePtr(JSContextRef context,
+ JSObjectRef object)
+{
+ if (!object) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Object is null");
+ }
+ JSVehiclePriv *priv = static_cast<JSVehiclePriv*>(JSObjectGetPrivate(object));
+ if (!priv) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
+ }
+ DPL::SharedPtr<Vehicle> result = priv->getObject();
+ if (!result) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
+ }
+ return result;
+}
+
+void JSVehicle::initialize(JSContextRef context,
+ JSObjectRef object)
+{
+ LogDebug("entered");
+ if (!JSObjectGetPrivate(object)) {
+ LogDebug("Create private object");
+ DPL::SharedPtr<Vehicle> obj = VehicleFactory::getInstance().createVehicleObject();
+ JSVehiclePriv *priv = new JSVehiclePriv(context, obj);
+ if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
+ delete priv;
+ }
+ }
+}
+
+void JSVehicle::finalize(JSObjectRef object)
+{
+ LogDebug("entered");
+ JSVehiclePriv *priv = static_cast<JSVehiclePriv*>(JSObjectGetPrivate(object));
+ if (priv) {
+ delete priv;
+ JSObjectSetPrivate(object, NULL);
+ }
+}
+
+JSValueRef JSVehicle::getSupportedEventTypes(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception)
+{
+
+ AceSecurityStatus status = VEHICLE_CHECK_ACCESS(VEHICLE_FUNCTION_API_GETSUPPORTEDEVENTTYPES);
+ TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
+ Try
+ {
+ LogDebug("entered, argc = " << argumentCount);
+
+ JSVehiclePriv *privateObject = static_cast<JSVehiclePriv*>(JSObjectGetPrivate(thisObject));
+ if (!privateObject) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
+ }
+
+ DPL::SharedPtr<Vehicle> vehicle = privateObject->getObject();
+
+ VehicleConverter converter(context);
+#if 0
+ /* ASYNC CALL EXAMPLE */
+ JSContextRef globalContext = privateObject->getContext();
+ JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);
+
+ callbackManager->setOnSuccess(arguments[2]);
+ callbackManager->setObject(thisObject);
+#endif
+ VehicleEventGetSupportedEventTypesPtr event(new VehicleEventGetSupportedEventTypes());
+
+#if 0
+ event->setPrivateData(DPL::StaticPointerCast<IEventPrivateData>(callbackManager));
+ event->setForAsynchronousCall(&VehicleResponseDispatcher::getInstance());
+
+ vehicle->getSupportedEventTypes(event);
+ VehicleAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, globalContext);
+#endif
+
+ event->setForSynchronousCall();
+ event->setType(converter.toString(arguments[0]));
+ event->setWriteable(converter.toBool(arguments[1]));
+
+ vehicle->getSupportedEventTypes(event);
+ if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
+ ThrowMsg(NotFoundException, "Given package not found.");
+ } else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::UnknownException) {
+ ThrowMsg(Exception, "Unknown error occurred.");
+ }
+ LogDebug("return data to the application");
+ return converter.toJSValueRef(event->getCallbackFuncReturnData());
+
+ }
+ Catch(UnsupportedException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(InvalidArgumentException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(ConversionException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch (NotFoundException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(Exception)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
+ }
+
+ return JSValueMakeUndefined(context);
+}
+
+JSValueRef JSVehicle::get(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception)
+{
+ LogDebug("entered, argc = " << argumentCount);
+
+ AceSecurityStatus status = VEHICLE_CHECK_ACCESS(VEHICLE_FUNCTION_API_GET);
+ TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
+ Try
+ {
+ JSVehiclePriv *privateObject = static_cast<JSVehiclePriv*>(JSObjectGetPrivate(thisObject));
+ if (!privateObject) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
+ }
+
+ /* TODO: Add implementational specific details here */
+ }
+ Catch(UnsupportedException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(InvalidArgumentException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(ConversionException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch (NotFoundException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(Exception)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
+ }
+
+ return JSValueMakeUndefined(context);
+}
+
+JSValueRef JSVehicle::set(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception)
+{
+ LogDebug("entered, argc = " << argumentCount);
+
+ AceSecurityStatus status = VEHICLE_CHECK_ACCESS(VEHICLE_FUNCTION_API_SET);
+ TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
+ Try
+ {
+ JSVehiclePriv *privateObject = static_cast<JSVehiclePriv*>(JSObjectGetPrivate(thisObject));
+ if (!privateObject) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
+ }
+
+ /* TODO: Add implementational specific details here */
+ }
+ Catch(UnsupportedException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(InvalidArgumentException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(ConversionException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch (NotFoundException)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
+ }
+ Catch(Exception)
+ {
+ LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
+ }
+
+ return JSValueMakeUndefined(context);
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_JSVEHICLE_H
+#define TIZENAPIS_TIZEN_VEHICLE_JSVEHICLE_H
+
+#include <JavaScriptCore/JavaScript.h>
+#include <CommonsJavaScript/PrivateObject.h>
+#include <dpl/shared_ptr.h>
+#include <API/Vehicle/Vehicle.h>
+
+namespace TizenApis {
+namespace Vehicle {
+
+class JSVehicle
+{
+public:
+ virtual ~JSVehicle();
+
+ static const JSClassRef getClassRef();
+
+ static JSValueRef createJSObject(JSContextRef context,
+ const DPL::SharedPtr<Vehicle>& impl);
+
+ static DPL::SharedPtr<Vehicle> getVehiclePtr(JSContextRef context,
+ JSValueRef value);
+
+ static DPL::SharedPtr<Vehicle> getVehiclePtr(JSContextRef context,
+ JSObjectRef object);
+
+
+private:
+ JSVehicle();
+
+ static void initialize(JSContextRef context,
+ JSObjectRef object);
+
+ static void finalize(JSObjectRef object);
+
+ // Methods
+ static JSValueRef getSupportedEventTypes(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception);
+
+ static JSValueRef get(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception);
+
+ static JSValueRef set(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception);
+
+ // Class members
+ static JSClassDefinition m_classDefinition;
+ static JSClassRef m_classRef;
+ static JSStaticFunction m_functions[];
+ static JSStaticValue m_properties[];
+
+};
+
+typedef DPL::SharedPtr<JSVehicle> JSVehiclePtr;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_JSVEHICLE_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <Commons/Exception.h>
+#include <dpl/exception.h>
+#include <Commons/FunctionDefinition.h>
+#include <map>
+#include "PluginConfig.h"
+
+using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::Commons;
+
+namespace TizenApis {
+namespace Vehicle {
+
+#define VEHICLE_FEATURE_API "http://tizen.org/api/vehicle"
+
+#define VEHICLE_DEVICE_CAP "vehicle"
+
+static FunctionMapping createVehicleFunctions();
+
+static FunctionMapping VehicleFunctions = createVehicleFunctions();
+
+DEFINE_FUNCTION_GETTER(Vehicle, VehicleFunctions);
+
+static FunctionMapping createVehicleFunctions()
+{
+
+ /**
+ * Device capabilities
+ */
+ ACE_CREATE_DEVICE_CAP(DEVICE_CAP_VEHICLE, VEHICLE_DEVICE_CAP);
+
+ ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_VEHICLE);
+ ACE_ADD_DEVICE_CAP(DEVICE_LIST_VEHICLE, DEVICE_CAP_VEHICLE);
+
+ /**
+ * Api Features
+ */
+ ACE_CREATE_FEATURE(FEATURE_VEHICLE, VEHICLE_FEATURE_API);
+
+ ACE_CREATE_FEATURE_LIST(VEHICLE_FEATURES);
+
+
+ /** TODO: add features to features list */
+ ACE_ADD_API_FEATURE(VEHICLE_FEATURES, FEATURE_VEHICLE);
+
+ /**
+ * Functions
+ */
+ FunctionMapping vehicleMapping;
+
+ /** TODO: create function(s) and insert it into the map e.g. */
+ AceFunction getSupported = ACE_CREATE_FUNCTION(
+ FUNCTION_GET,
+ VEHICLE_FUNCTION_API_GETSUPPORTEDEVENTTYPES,
+ VEHICLE_FEATURES,
+ DEVICE_LIST_VEHICLE);
+
+ vehicleMapping.insert(
+ std::make_pair(VEHICLE_FUNCTION_API_GETSUPPORTEDEVENTTYPES,
+ getSupported));
+
+
+ AceFunction getFunc = ACE_CREATE_FUNCTION(
+ FUNCTION_GET,
+ VEHICLE_FUNCTION_API_GET,
+ VEHICLE_FEATURES,
+ DEVICE_LIST_VEHICLE);
+
+ vehicleMapping.insert(std::make_pair(VEHICLE_FUNCTION_API_GET, getFunc));
+
+ AceFunction setFunc = ACE_CREATE_FUNCTION(
+ FUNCTION_SET,
+ VEHICLE_FUNCTION_API_SET,
+ VEHICLE_FEATURES,
+ DEVICE_LIST_VEHICLE);
+
+ vehicleMapping.insert(std::make_pair(VEHICLE_FUNCTION_API_SET, setFunc));
+
+ return vehicleMapping;
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_PLUGINCONFIG_H
+#define TIZENAPIS_TIZEN_VEHICLE_PLUGINCONFIG_H
+
+#include <string>
+#include <Commons/FunctionDeclaration.h>
+
+namespace TizenApis {
+namespace Vehicle {
+
+#define VEHICLE_FUNCTION_API_GETSUPPORTEDEVENTTYPES "getSupportedEventTypes"
+#define VEHICLE_FUNCTION_API_GET "get"
+#define VEHICLE_FUNCTION_API_SET "set"
+
+DECLARE_FUNCTION_GETTER(Vehicle);
+
+#define VEHICLE_CHECK_ACCESS(functionName) aceCheckAccess<AceFunctionGetter, DefaultArgsVerifier<> >( getVehicleFunctionData, functionName)
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_PLUGINCONFIG_H
+
--- /dev/null
+#include <Commons/plugin_initializer_def.h>
+#include <Commons/WrtAccess/WrtAccess.h>
+#include <Commons/Exception.h>
+#include <dpl/log/log.h>
+#include "VehicleAsyncCallbackManager.h"
+#include "VehicleListenerManager.h"
+#include "JSVehicle.h"
+
+using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::Commons;
+
+namespace TizenApis {
+namespace Vehicle {
+
+void on_widget_start_callback(int widgetId)
+{
+ LogDebug("[Tizen/Vehicle] on_widget_start_callback (" << widgetId << ")");
+ Try {
+ WrtAccessSingleton::Instance().initialize(widgetId);
+ } Catch (Exception) {
+ LogError("WrtAccess initialization failed");
+ }
+}
+
+void on_widget_stop_callback(int widgetId)
+{
+ LogDebug("[Tizen/Vehicle] on_widget_stop_callback (" << widgetId << ")");
+ Try {
+ WrtAccessSingleton::Instance().deinitialize(widgetId);
+ } Catch (Exception) {
+ LogError("WrtAccess deinitialization failed");
+ }
+}
+
+void on_frame_load_callback(const void * context)
+{
+}
+
+void on_frame_unload_callback(const void * context)
+{
+ VehicleAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
+ VehicleListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
+}
+
+PLUGIN_ON_WIDGET_START(on_widget_start_callback)
+PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
+
+PLUGIN_ON_FRAME_LOAD(on_frame_load_callback)
+PLUGIN_ON_FRAME_UNLOAD(on_frame_unload_callback)
+
+PLUGIN_CLASS_MAP_BEGIN
+
+ PLUGIN_CLASS_MAP_ADD_CLASS(
+ WRT_JS_EXTENSION_OBJECT_TIZEN,
+ "vehicle",
+ (js_class_template_getter)JSVehicle::getClassRef,
+ NULL)
+
+PLUGIN_CLASS_MAP_END
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dpl/singleton.h>
+#include <dpl/singleton_impl.h>
+#include "VehicleAsyncCallbackManager.h"
+
+IMPLEMENT_SINGLETON( TizenApis::Vehicle::VehicleAsyncCallbackManager )
+
+namespace TizenApis {
+namespace Vehicle {
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLEASYNCCALLBACKMANAGER_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLEASYNCCALLBACKMANAGER_H
+
+#include <Tizen/Common/AsyncCallbackManager.h>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleAsyncCallbackManager : public TizenApis::Commons::AsyncCallbackManager
+{
+public:
+ virtual ~VehicleAsyncCallbackManager()
+ {
+ }
+
+private:
+ VehicleAsyncCallbackManager()
+ {
+ }
+
+ friend class DPL::Singleton< VehicleAsyncCallbackManager >;
+
+};
+
+typedef DPL::Singleton< VehicleAsyncCallbackManager > VehicleAsyncCallbackManagerSingleton;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLEASYNCCALLBACKMANAGER_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Commons/Exception.h>
+#include <CommonsJavaScript/JSUtils.h>
+#include "VehicleConverter.h"
+
+#include <API/Vehicle/Vehicle.h>
+#include "JSVehicle.h"
+
+namespace TizenApis {
+namespace Vehicle {
+
+using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::CommonsJavaScript;
+
+VehicleConverter::VehicleConverter(JSContextRef context) : Converter(context)
+{
+}
+
+VehicleConverter::~VehicleConverter()
+{
+}
+
+JSValueRef VehicleConverter::toJSValueRefVehicle(const DPL::SharedPtr<Vehicle> &arg)
+{
+ if(arg == NULL) {
+ ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Object is null");
+ }
+ return CommonsJavaScript::JSUtils::makeObject(m_context, JSVehicle::getClassRef(), arg);
+}
+
+const DPL::SharedPtr<Vehicle> VehicleConverter::toVehicle(const JSValueRef &arg)
+{
+ if (JSValueIsNull(m_context, arg) || JSValueIsUndefined(m_context, arg)) {
+ ThrowMsg(Commons::ConversionException, "Invalid Argument");
+ }
+ /* TODO: Add/change more implementation specific details */
+ DPL::SharedPtr<Vehicle> createme;
+ return createme;
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLECONVERTER_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLECONVERTER_H
+
+#include <JavaScriptCore/JavaScript.h>
+#include <CommonsJavaScript/Converter.h>
+
+namespace TizenApis {
+namespace Vehicle {
+
+class Vehicle;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleConverter : public WrtDeviceApis::CommonsJavaScript::Converter
+{
+public:
+ using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
+
+public:
+ explicit VehicleConverter(JSContextRef context);
+
+ virtual ~VehicleConverter();
+
+ // interfaces
+ JSValueRef toJSValueRefVehicle(const DPL::SharedPtr<Vehicle> &arg);
+
+ const DPL::SharedPtr<Vehicle> toVehicle(const JSValueRef &arg);
+
+};
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLECONVERTER_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <map>
+#include <dpl/log/log.h>
+#include "VehicleListenerManager.h"
+
+
+IMPLEMENT_SINGLETON( TizenApis::Vehicle::VehicleListenerManager )
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleListenerCanceller::VehicleListenerCanceller(JSContextRef context, JSObjectRef object, long watchId)
+ : TizenApis::Commons::IListenerItem(context, object, watchId)
+{
+}
+
+VehicleListenerCanceller::~VehicleListenerCanceller()
+{
+}
+
+void VehicleListenerCanceller::cancelListener()
+{
+ /** TODO: add cancellation logic here
+ */
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLELISTENERMANAGER_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLELISTENERMANAGER_H
+
+#include <dpl/singleton.h>
+#include <dpl/singleton_impl.h>
+#include <dpl/shared_ptr.h>
+#include <JavaScriptCore/JavaScript.h>
+#include <Tizen/Common/IListenerManager.h>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleListenerManager : public TizenApis::Commons::IListenerController
+{
+public:
+ virtual ~VehicleListenerManager()
+ {
+ }
+
+private:
+ VehicleListenerManager()
+ {
+ }
+
+ friend class DPL::Singleton< VehicleListenerManager >;
+
+};
+
+typedef DPL::Singleton< VehicleListenerManager > VehicleListenerManagerSingleton;
+
+class VehicleListenerCanceller : public TizenApis::Commons::IListenerItem
+{
+public:
+ VehicleListenerCanceller(JSContextRef context, JSObjectRef object, long watchId);
+
+ virtual ~VehicleListenerCanceller();
+
+ virtual void cancelListener();
+
+};
+
+typedef DPL::SharedPtr< VehicleListenerCanceller > VehicleListenerCancellerPtr;
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLELISTENERMANAGER_H
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Commons/ThreadPool.h>
+#include <CommonsJavaScript/JSCallbackManager.h>
+#include "VehicleResponseDispatcher.h"
+#include "VehicleAsyncCallbackManager.h"
+#include "VehicleConverter.h"
+
+using namespace WrtDeviceApis::CommonsJavaScript;
+
+namespace TizenApis {
+namespace Vehicle {
+
+VehicleResponseDispatcher& VehicleResponseDispatcher::getInstance()
+{
+ static VehicleResponseDispatcher instance;
+ return instance;
+}
+
+VehicleResponseDispatcher::VehicleResponseDispatcher()
+ : WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventGetSupportedEventTypes>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD),
+ WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventGet>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD),
+ WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventSet>(WrtDeviceApis::Commons::ThreadEnum::VEHICLE_THREAD)
+{
+ /*TODO: add details*/
+}
+
+VehicleResponseDispatcher::~VehicleResponseDispatcher()
+{
+ /*TODO: add details*/
+}
+
+void VehicleResponseDispatcher::OnAnswerReceived(const DPL::SharedPtr<VehicleEventGetSupportedEventTypes> &event)
+{
+#if 0
+ /* ASYNC CALL EXAMPLE */
+ LogDebug("entered");
+ JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
+ if (!callbackManager) {
+ LogError("no callback manager");
+ return;
+ }
+
+ JSContextRef context = callbackManager->getContext();
+ VehicleAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
+
+ if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::None) {
+ VehicleConverter converter(context);
+ JSValueRef result = converter.toJSValueRef(event->getCallbackFuncReturnData());
+ callbackManager->callOnSuccess(result);
+ }
+ LogDebug("exit");
+#endif
+}
+
+void VehicleResponseDispatcher::OnAnswerReceived(const DPL::SharedPtr<VehicleEventGet> &event)
+{
+ /* TODO: Add implementation specific details */
+}
+
+void VehicleResponseDispatcher::OnAnswerReceived(const DPL::SharedPtr<VehicleEventSet> &event)
+{
+ /* TODO: Add implementation specific details */
+}
+
+} //namespace Vehicle
+} //namespace TizenApis
+
--- /dev/null
+/*
+ * Tizen JavaScript bindings
+ * Copyright (c) 2011-2012, Intel Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TIZENAPIS_TIZEN_VEHICLE_VEHICLERESPONSEDISPATCHER_H
+#define TIZENAPIS_TIZEN_VEHICLE_VEHICLERESPONSEDISPATCHER_H
+
+#include <JavaScriptCore/JavaScript.h>
+#include <Commons/EventReceiver.h>
+#include <Commons/EventListener.h>
+
+#include <API/Vehicle/VehicleEventGet.h>
+#include <API/Vehicle/VehicleEventGetSupportedEventTypes.h>
+#include <API/Vehicle/VehicleEventSet.h>
+
+
+namespace TizenApis {
+namespace Vehicle {
+
+class VehicleResponseDispatcher
+ : public WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventGetSupportedEventTypes>,
+ public WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventGet>,
+ public WrtDeviceApis::Commons::EventAnswerReceiver<VehicleEventSet>
+{
+public:
+ static VehicleResponseDispatcher& getInstance();
+
+ virtual ~VehicleResponseDispatcher();
+
+protected:
+ void OnAnswerReceived(const DPL::SharedPtr<VehicleEventGetSupportedEventTypes> &event);
+
+ void OnAnswerReceived(const DPL::SharedPtr<VehicleEventGet> &event);
+
+ void OnAnswerReceived(const DPL::SharedPtr<VehicleEventSet> &event);
+
+private:
+ VehicleResponseDispatcher();
+
+};
+
+} //namespace Vehicle
+} //namespace TizenApis
+
+#endif // TIZENAPIS_TIZEN_VEHICLE_VEHICLERESPONSEDISPATCHER_H
+
--- /dev/null
+<?xml version="1.0" ?>
+<!DOCTYPE plugin-properties SYSTEM "/usr/etc/tizen-apis/config.dtd">
+<plugin-properties>
+ <library-name>libwrt-plugins-tizen-1.0-vehicle.so</library-name>
+ <feature-install-uri>vehicle.install.uri</feature-install-uri>
+ <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
+ <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
+ <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
+
+ <api-feature>
+ <name>http://tizen.org/api/vehicle</name>
+ <device-capability>vehicle</device-capability>
+ </api-feature>
+
+</plugin-properties>