upload tizen1.0 source
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / plugin_initializer.cpp
index 87360e2..386c9a1 100755 (executable)
@@ -18,7 +18,7 @@
 #include <dpl/log/log.h>
 
 #include <Commons/plugin_initializer_def.h>
-#include <Commons/WrtWrapper/WrtWrappersMgr.h>
+#include <Commons/WrtAccess/WrtAccess.h>
 #include <Commons/Exception.h>
 #include "JSCalendarManager.h"
 #include "JSCalendarEvent.h"
@@ -32,16 +32,29 @@ namespace TizenApis {
 namespace Tizen1_0 {
 namespace Calendar {
 
-void on_widget_start_callback(int widgetId,
-        JavaScriptContext context,
-        const engine_interface_t *interface)
+using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::Commons;
+
+void on_widget_start_callback(int widgetId)
 {
     LogDebug("[Tizen\\Calendar] on_widget_start_callback (" << widgetId << ")");
+
+       Try {
+        WrtAccessSingleton::Instance().initialize(widgetId);
+       } Catch (Commons::Exception) {
+               LogError("WrtAccess initialization failed");
+       }
 }
 
 void on_widget_stop_callback(int widgetId)
 {
     LogDebug("[Tizen\\Calendar] on_widget_stop_callback (" << widgetId << ")");
+
+       Try {
+        WrtAccessSingleton::Instance().deinitialize(widgetId);
+       } Catch (Commons::Exception) {
+               LogError("WrtAccess deinitialization failed");
+       }
 }
 
 PLUGIN_ON_WIDGET_START(on_widget_start_callback)
@@ -58,7 +71,7 @@ PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN,
                NULL)
 PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN,
         TIZEN_INTERFACE_CALENDAR_TASK,
-        JSCalendarEvent::getClassRef(),
+        JSCalendarTask::getClassRef(),
         NULL)
 PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN,
         TIZEN_INTERFACE_CALENDAR_ATTENDEE,