upload tizen1.0 source
[framework/web/wrt-plugins-common.git] / src / Commons / WrtAccess / WrtAccess.cpp
similarity index 86%
rename from src/Commons/WrtWrapper/WrtWrapper.cpp
rename to src/Commons/WrtAccess/WrtAccess.cpp
index 79da373..ce55e8e 100644 (file)
 #include <dpl/assert.h>
 #include <wrt_plugin_export.h>
 #include <Commons/Exception.h>
-#include "WrtWrapper.h"
-#include "WrtCameraManager.h"
+#include "WrtAccess.h"
 #include <ace-client/ace_client.h>
+#include <dpl/singleton_impl.h>
+
+IMPLEMENT_SINGLETON(WrtDeviceApis::Commons::WrtAccess)
 
 namespace WrtDeviceApis {
 namespace Commons {
@@ -72,32 +74,39 @@ class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
     }
 };
 
-WrtWrapper::WrtWrapper(int widgetId,
-                       const engine_interface_t* interface) :
-    m_widgetId(widgetId)
+WrtAccess::WrtAccess()
+{
+    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
+}
+
+WrtAccess::~WrtAccess()
 {
-    m_wrt = interface;
+}
 
-    if (!interface) {
-        LogError("Pointer to interface is NULL");
+void WrtAccess::initialize(int widgetId)
+{
+    LogDebug("initialize");
+
+    if (widgetId < 0)
+    {
+        LogDebug("Invalid widget id");
+        Throw(Exception);
     }
 
-    m_cameraManager = IWrtCameraManagerPtr(
-        new WrtCameraManager(widgetId, interface));
+    m_widgetId = widgetId;
 }
 
-WrtWrapper::~WrtWrapper()
+void WrtAccess::deinitialize(int widgetId)
 {
-    LogDebug("entered");
+    LogDebug("deinitialize");
 }
 
-int WrtWrapper::getWidgetId() const
+int WrtAccess::getWidgetId() const
 {
-    LogDebug("entered");
     return m_widgetId;
 }
 
-bool WrtWrapper::checkAccess(const AceFunction& aceFunction) const
+bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
 {
     size_t deviceCount = aceFunction.deviceCapabilities.size();
 
@@ -155,10 +164,5 @@ bool WrtWrapper::checkAccess(const AceFunction& aceFunction) const
             Instance().checkFunctionCall(aceRequest);
 }
 
-IWrtCameraManagerPtr WrtWrapper::getCameraManagerInterface() const
-{
-    return m_cameraManager;
-}
-
 }
 } // WrtDeviceApisCommon