<!-- structure declaration -->
<xsl:apply-templates select="install"> </xsl:apply-templates>
</xsl:template>
-
-<!--
-<config name="org.tizen.quickpanel.notiicons.message">
- <install>
- <file alias="HELLO" src="resource/quickpanel/data/images_noti_icons/Message" name="noti_message_failed.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
- <file src="resource/quickpanel/data/images_noti_icons/Message" name="noti_message_sending.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
- <file src="resource/quickpanel/data/images_noti_icons/Message" name="noti_message_mms_failed.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
- <file src="resource/quickpanel/data/images_noti_icons/Message" name="noti_message_cb-msg.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
- <file src="resource/quickpanel/data/images_noti_icons/Message" name="noti_voice_mail.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
- <file src="resource/quickpanel/data/images_noti_icons/Message" name="noti_message_OTA.png" dest="/usr/apps/org.tizen.quickpanel/shared/res/noti_icons" label="tizen::vconf::setting"/>
--->
-
<xsl:template match="install">
// enumeration for <xsl:value-of select="translate(../@name,'.','_')"/>
enum {
<xsl:when test="./@type='set'">
int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, char* value);<xsl:text>
</xsl:text>
+<xsl:text>
</xsl:text><xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
<!-- end choose STRING-->
<xsl:when test="./@type='set'">
int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, int value);<xsl:text>
</xsl:text>
+<xsl:text>
</xsl:text><xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
<!-- end choose INT -->
<xsl:when test="./@type='set'">
int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, bool value);<xsl:text>
</xsl:text>
+<xsl:text>
</xsl:text><xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
<!-- end choose BOOL -->
<xsl:when test="./@type='set'">
int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, float value);<xsl:text>
</xsl:text>
+<xsl:text>
</xsl:text><xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
<!-- end choose FLOAT -->
</xsl:when>
+ <xsl:when test="../../@type='list'">
+<!-- begin choose LIST -->
+<xsl:choose>
+ <xsl:when test="./@type='init'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>();<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="./@type='destroy'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>();<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="./@type='get'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>_list(char* key, void (*callback)(int,void* , void*), void* data);<xsl:text>
</xsl:text>
+ </xsl:when>
+
+ <!-- <xsl:when test="./@type='set'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, float value);<xsl:text>
</xsl:text>
+<xsl:text>
</xsl:text><xsl:text>
</xsl:text>
+ </xsl:when> -->
+</xsl:choose>
+<!-- end choose LIST -->
+ </xsl:when>
</xsl:choose>
<!-- end choose FLOAT -->
</xsl:when>
+<xsl:when test="../../@type='list'">
+<!-- begin choose LIST -->
+<xsl:choose>
+ <xsl:when test="./@type='init'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>()<xsl:text>
</xsl:text>
+{
+ return 0;
+}
+ </xsl:when>
+
+ <xsl:when test="./@type='destroy'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>()<xsl:text>
</xsl:text>
+{
+ return 0;
+}
+ </xsl:when>
+
+ <xsl:when test="./@type='get'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>_list(char* key, void (*tcf_iterator)(int,void*, void*), void* data)<xsl:text>
</xsl:text>
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(<xsl:value-of select="../../@name"/>_plugin_path(), "<xsl:value-of select="../@name"/>");
+ int val = config_manager_get_list(fn, key, tcf_iterator, data);
+ config_manager_close();
+ return val;
+}
+ </xsl:when>
+ <!--
+ <xsl:when test="./@type='set'">
+int <xsl:value-of select="../../@name"/>_<xsl:value-of select="./@type"/>(char* key, float value)<xsl:text>
</xsl:text>
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(<xsl:value-of select="../../@name"/>_plugin_path(), "<xsl:value-of select="../@name"/>");
+ config_manager_set_float(fn, key, value);
+ config_manager_close();
+ return 0;
+}
+ </xsl:when>
+ -->
+</xsl:choose>
+<!-- end choose LIST -->
+ </xsl:when>
+
</xsl:choose>
{
PluginTizenConfig* pt_table = (*fn)();
pt_table->init();
- char* str = pt_table->get_config(key);
+ char* str = pt_table->get_config_str(key);
pt_table->destroy();
return strdup(str);
{
PluginTizenConfig* pt_table = (*fn)();
pt_table->init();
- pt_table->set_config(key, value);
+ pt_table->set_config_str(key, value);
pt_table->destroy();
return 0;
}
+int config_manager_get_list(PluginTizenConfig* (*fn)(),char* key, void tcf_iterator(void (*callback)(int,void*, void*)), void* data)
+{
+ PluginTizenConfig* pt_table = (*fn)();
+ pt_table->init();
+ int val = pt_table->get_config_list(key, tcf_iterator, data);
+ pt_table->destroy();
+
+ return val;
+}
+
+#if 0
+int config_manager_set_float(PluginTizenConfig* (*fn)(),char* key, float value)
+{
+ PluginTizenConfig* pt_table = (*fn)();
+ pt_table->init();
+ pt_table->set_config_float(key, value);
+ pt_table->destroy();
+
+ return 0;
+}
+#endif
+
+
+
void config_manager_close()
{
// config_manager
PluginTizenConfig* (*config_manager(char* plugin_path, char* plugin_id))();
+//------------------------------------------------------------------------------
+// STRING
+//------------------------------------------------------------------------------
// plugin_manager_get
char* config_manager_get(PluginTizenConfig* (*fn)(int *), char* key);
// plugin_manager_set
int config_manager_set(PluginTizenConfig* (*fn)(int *), char* key, char* value);
+//------------------------------------------------------------------------------
+// INT
+//------------------------------------------------------------------------------
// plugin_manager_get
int config_manager_get_int(PluginTizenConfig* (*fn)(int *), char* key);
// plugin_manager_set
int config_manager_set_int(PluginTizenConfig* (*fn)(int *), char* key, int value);
+//------------------------------------------------------------------------------
+// BOOL
+//------------------------------------------------------------------------------
// plugin_manager_get
bool config_manager_get_bool(PluginTizenConfig* (*fn)(int *), char* key);
// plugin_manager_set
int config_manager_set_bool(PluginTizenConfig* (*fn)(int *), char* key, bool value);
+//------------------------------------------------------------------------------
+// FLOAT
+//------------------------------------------------------------------------------
// plugin_manager_get
float config_manager_get_float(PluginTizenConfig* (*fn)(int *), char* key);
// plugin_manager_set
int config_manager_set_float(PluginTizenConfig* (*fn)(int *), char* key, float value);
+//------------------------------------------------------------------------------
+// LIST
+//------------------------------------------------------------------------------
+// plugin_manager_get
+int config_manager_get_list(PluginTizenConfig* (*fn)(),char* key, void tcf_iterator(void (*callback)(int,void*, void*)), void* data);
+
void config_manager_close();
#ifdef __cplusplus
return val;
}
+char* get_list_version_plugin_path()
+{
+ return "/usr/lib/libhelloworld_plugin.so";
+}
+int get_list_version_get_list(char* key, void (*tcf_iterator)(int,void*, void*), void* data)
+{
+ PluginTizenConfig* (*fn)(int *);
+ fn = config_manager(get_list_version_plugin_path(), "get_plugin_hellolist_object");
+ int val = config_manager_get_list(fn, key, tcf_iterator, data);
+ config_manager_close();
+ return val;
+}
+
char* get_float_version_plugin_path()
{
return "/usr/lib/libhelloworld_plugin.so";
config_manager_close();
return 0;
}
-
+
\ No newline at end of file
char* get_complex_string_get(char* key);
char* get_simple_text_plugin_path();
char* get_simple_text_get(char* key);
+char* get_list_version_plugin_path();
+int get_list_version_get_list(char* key, void (*callback)(int,void* , void*), void* data);
char* get_float_version_plugin_path();
float get_float_version_get(char* key);
int get_float_version_set(char* key, float value);
<desc>simple text example</desc>
</config>
+ <config name="get_list_version" type="list">
+ <plugin name="get_plugin_hellolist_object" path="/usr/lib/libhelloworld_plugin.so">
+ <function type="get"/>
+ </plugin>
+ <desc>get_float_version</desc>
+ </config>
+
+
<config name="get_float_version" type="float">
<plugin name="get_plugin_hellofloat_object" path="/usr/lib/libhelloworld_plugin.so">
<function type="get"/>
static PluginTizenConfig config = {
.init = complex_init,
- .get_config = complex_get_config,
- .set_config = complex_set_config,
+ .get_config_str = complex_get_config,
+ .set_config_str = complex_set_config,
.destroy = complex_destroy
};
static PluginTizenConfig config = {
.init = simple_init,
- .get_config = simple_get_config,
- .set_config = simple_set_config,
+ .get_config_str = simple_get_config,
+ .set_config_str = simple_set_config,
.destroy = simple_destroy
};
static PluginTizenConfig config = {
.init = config_dbus_plugin_init,
- .get_config = config_dbus_plugin_get,
- .set_config = config_dbus_plugin_set,
+ .get_config_str = config_dbus_plugin_get,
+ .set_config_str = config_dbus_plugin_set,
.destroy = config_dbus_plugin_destroy
};
static PluginTizenConfig config = {
.init = config_ini_plugin_init,
- .get_config = config_ini_plugin_get,
- .set_config = config_ini_plugin_set,
+ .get_config_str = config_ini_plugin_get,
+ .set_config_str = config_ini_plugin_set,
.destroy = config_ini_plugin_destroy
};
static PluginTizenConfig config = {
.init = config_xml_plugin_init,
- .get_config = config_xml_plugin_get,
- .set_config = config_xml_plugin_set,
+ .get_config_str = config_xml_plugin_get,
+ .set_config_str = config_xml_plugin_set,
.destroy = config_xml_plugin_destroy
};
static PluginTizenConfig config = {
.init = config_net_plugin_init,
- .get_config = config_net_plugin_get,
- .set_config = config_net_plugin_set,
+ .get_config_str = config_net_plugin_get,
+ .set_config_str = config_net_plugin_set,
.destroy = config_net_plugin_destroy
};
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Werror-implicit-function-declaration")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-ADD_LIBRARY(helloworld_plugin SHARED helloworld_plugin.c helloint_plugin.c hellobool_plugin.c hellofloat_plugin.c)
+ADD_LIBRARY(helloworld_plugin SHARED helloworld_plugin.c helloint_plugin.c hellobool_plugin.c hellofloat_plugin.c hellolist_plugin.c)
SET(PLUGIN1_VERSION_MAJOR 1)
SET(PLUGIN1_VERSION_MINOR 1)
SET(PLUGIN1_VERSION_PATCH 0)
--- /dev/null
+#include <stdio.h>
+#include <plugin1.h>
+
+static int hellolist_init()
+{
+ printf("hellolist_init \n");
+ return 0;
+}
+
+static int hellolist_destroy()
+{
+ printf("hellolist_destroy \n");
+ return 0;
+}
+
+
+
+static int get_config_hello_list_int(char * key, void tcf_iterator(int, void*, void* ), void* data)
+{
+ printf("get_config_hello_list_int : %s \n", key);
+
+ int array[] = { 1, 2, 3, 4 };
+ int len = 4;
+ int i;
+ for(i = 0; i < len; i++)
+ {
+ if (tcf_iterator != NULL)
+ tcf_iterator(i, (void*)array[i], data);
+ }
+
+ return -100;
+}
+
+static int get_config_hello_list(char * key, void tcf_iterator(int, void*, void* ), void* data)
+{
+ printf("get_config_hello_list : %s \n", key);
+
+ char* array[] = { "kor", "usa", "japan", "china", "tiwan" };
+ int len = 5;
+ int i;
+ for(i = 0; i < len; i++)
+ {
+ if (tcf_iterator != NULL)
+ tcf_iterator(i, (void*)array[i], data);
+ }
+
+ return 0;
+}
+
+
+static PluginTizenConfig config = {
+ .init = hellolist_init,
+ .get_config_list = get_config_hello_list,
+ .destroy = hellolist_destroy
+};
+
+PluginTizenConfig* get_plugin_hellolist_object()
+{
+ return &config;
+}
static PluginTizenConfig config = {
.init = helloworld_init,
- .get_config = helloworld_get_config,
- .set_config = helloworld_set_config,
+ .get_config_str = helloworld_get_config,
+ .set_config_str = helloworld_set_config,
.destroy = helloworld_destroy
};
#endif
#endif
+void tcf_iterator(void(*callback)(int,void* , void*));
+
typedef struct _tagPluginTizenConfig
{
int (*init)(void);
- // char*
- char* (*get_config)(char * key);
- int (*set_config)(char * key, char* value);
+ // char*
+ char* (*get_config_str)(char * key);
+ int (*set_config_str)(char * key, char* value);
// int type
int (*get_config_int)(char * key);
float (*get_config_float)(char * key);
int (*set_config_float)(char * key, float value);
+ // get list type
+ int (*get_config_list)(char * key, void tcf_iterator(void (*callback)(int,void*, void*)), void* data);
+
+
+ // void map( void(*callback)(int,int,void*))
+
int (*destroy)(void);
} PluginTizenConfig;