Update wrt-plugins-common_0.3.53
[framework/web/wrt-plugins-common.git] / src / Commons / plugin_initializer_def.h
index 84bd4b7..f2429f9 100755 (executable)
@@ -73,6 +73,21 @@ typedef java_script_context_t JavaScriptContext;
 #define PLUGIN_ON_WIDGET_START(CALLBACK_NAME) extern "C" const on_widget_start_proc PLUGIN_WIDGET_START_PROC EXPORT_SYMBOL = CALLBACK_NAME;
 
 /*
+ *  You have to(!) call this macro in your plugin_initializer.cpp(!) file
+ *  providing callback that will be called while loading each widget
+ * (for every loaded widget this function will be called)
+ *  Example:
+ *       plugin_initializer.cpp
+ *        void on_widget_init_callback(feature_mapping_interface_t *mapping)
+ *        {
+ *          //...
+ *        }
+ *        PLUGIN_ON_WIDGET_INIT(on_widget_init_callback)
+ */
+#define PLUGIN_ON_WIDGET_INIT(CALLBACK_NAME) extern "C" \
+const on_widget_init_proc PLUGIN_WIDGET_INIT_PROC EXPORT_SYMBOL = CALLBACK_NAME;
+
+/*
  *  You have to(!) call this macro in your plugin_initializer.cpp(!) file providing callback that will be called while unloading each widget (for every unloaded widget this function will be called)
  *  Example:
  *        void on_widget_stop_callback(int widgetId)
@@ -84,6 +99,28 @@ typedef java_script_context_t JavaScriptContext;
 #define PLUGIN_ON_WIDGET_STOP(CALLBACK_NAME) extern "C" const on_widget_stop_proc PLUGIN_WIDGET_STOP_PROC EXPORT_SYMBOL = CALLBACK_NAME;
 
 /*
+ *  You have to(!) call this macro in your plugin_initializer.cpp(!) file providing callback that will be called while unloading each page (for every loaded page, including nested page, this function will be called)
+ *  Example:
+ *        void on_frame_load_callback(java_script_context_t context)
+ *        {
+ *          //...
+ *        }
+ *        PLUGIN_ON_FRAME_LOAD(on_frame_load_callback)
+ */
+#define PLUGIN_ON_FRAME_LOAD(CALLBACK_NAME) extern "C" const on_frame_load_proc PLUGIN_FRAME_LOAD_PROC EXPORT_SYMBOL = CALLBACK_NAME;
+
+/*
+ *  You have to(!) call this macro in your plugin_initializer.cpp(!) file providing callback that will be called while ununloading each page (for every unloaded page, including nested page, this function will be called)
+ *  Example:
+ *        void on_frame_unload_callback(java_script_context_t context)
+ *        {
+ *          //...
+ *        }
+ *        PLUGIN_ON_FRAME_UNLOAD(on_frame_unload_callback)
+ */
+#define PLUGIN_ON_FRAME_UNLOAD(CALLBACK_NAME) extern "C" const on_frame_unload_proc PLUGIN_FRAME_UNLOAD_PROC EXPORT_SYMBOL = CALLBACK_NAME;
+
+/*
  * You have to(!) define an array of structures in your plugin_initializer.cpp(!) file describing a JS class (class_definition) and it's parent class name (parent_name).
  * JS class will be bind to a parent class name (parent_name.jsclass_name).
  * Example:
@@ -94,11 +131,29 @@ typedef java_script_context_t JavaScriptContext;
  *      PLUGIN_CLASS_MAP_END
  *
  */
-#define PLUGIN_CLASS_MAP_BEGIN extern "C" const class_definition_t PLUGIN_CLASS_MAP[] EXPORT_SYMBOL = {
-#define PLUGIN_CLASS_MAP_ADD_CLASS(PARENTNAME,CLASSNAME,JSCLASSTEMPLATE,PRIVDATA) {PARENTNAME,CLASSNAME,JSCLASSTEMPLATE,PRIVDATA},
-#define PLUGIN_CLASS_MAP_END {NULL,NULL,NULL,NULL} };
+#define PLUGIN_CLASS_MAP_BEGIN extern "C" const js_entity_definition_t\
+            PLUGIN_CLASS_MAP[] EXPORT_SYMBOL = {
+
+#define PLUGIN_CLASS_MAP_ADD_INTERFACE(PARENTNAME,INTERFACENAME,\
+            JSPRODUCTCLASSTEMPLATE,PRODUCTCONSTRUCTORCB,PRIVDATA) \
+                {PARENTNAME,INTERFACENAME,"",JSPRODUCTCLASSTEMPLATE,\
+                 PRODUCTCONSTRUCTORCB,PRIVDATA},
+
+#define PLUGIN_CLASS_MAP_ADD_INTERFACE_PRODUCT(PARENTNAME,OBJECTNAME,\
+            INTERFACENAME,PRIVDATA)\
+                {PARENTNAME,OBJECTNAME,INTERFACENAME,NULL,NULL,PRIVDATA},
+
+#define PLUGIN_CLASS_MAP_ADD_CLASS(PARENTNAME,CLASSNAME,JSCLASSTEMPLATE,\
+            PRIVDATA)\
+                {PARENTNAME,CLASSNAME,"",JSCLASSTEMPLATE,NULL,PRIVDATA},
+
+#define PLUGIN_CLASS_MAP_END {NULL,NULL,NULL,NULL,NULL,NULL} };
+
+#define PLUGIN_CLASS_MAP_BEGIN_STATIC static const js_entity_definition_t\
+                PLUGIN_CLASS_MAP[] = {
 
-#define PLUGIN_CLASS_MAP_BEGIN_STATIC static const class_definition_t PLUGIN_CLASS_MAP[] = {
-#define PLUGIN_GET_CLASS_MAP(CALLBACK_NAME) extern "C" const get_widget_class_map_proc PLUGIN_GET_CLASS_PROC_MAP EXPORT_SYMBOL = CALLBACK_NAME;
+#define PLUGIN_GET_CLASS_MAP(CALLBACK_NAME) extern "C" const\
+                get_widget_entity_map_proc\
+                PLUGIN_GET_CLASS_PROC_MAP EXPORT_SYMBOL = CALLBACK_NAME;
 
 #endif // WRTDEVICEAPIS_COMMONS_PLUGIN_INITIALIZER_DEF_H_