From d3c7069617f3b7746bb27f339bde0c3afeeaf96c Mon Sep 17 00:00:00 2001 From: Nicolas Clapies Date: Wed, 12 Jan 2005 17:21:11 +0000 Subject: Added low level classes for interaction service specification. --- lasso/xml/is_help.c | 105 ++++++++++++++++++++++++++++++ lasso/xml/is_help.h | 67 +++++++++++++++++++ lasso/xml/is_inquiry.c | 118 +++++++++++++++++++++++++++++++++ lasso/xml/is_inquiry.h | 72 +++++++++++++++++++++ lasso/xml/is_inquiry_element.c | 114 ++++++++++++++++++++++++++++++++ lasso/xml/is_inquiry_element.h | 75 +++++++++++++++++++++ lasso/xml/is_interaction_request.c | 122 +++++++++++++++++++++++++++++++++++ lasso/xml/is_interaction_request.h | 83 ++++++++++++++++++++++++ lasso/xml/is_interaction_response.c | 115 +++++++++++++++++++++++++++++++++ lasso/xml/is_interaction_response.h | 73 +++++++++++++++++++++ lasso/xml/is_interaction_statement.c | 105 ++++++++++++++++++++++++++++++ lasso/xml/is_interaction_statement.h | 72 +++++++++++++++++++++ lasso/xml/is_item.c | 109 +++++++++++++++++++++++++++++++ lasso/xml/is_item.h | 67 +++++++++++++++++++ lasso/xml/is_parameter.c | 105 ++++++++++++++++++++++++++++++ lasso/xml/is_parameter.h | 68 +++++++++++++++++++ lasso/xml/is_redirect_request.c | 102 +++++++++++++++++++++++++++++ lasso/xml/is_redirect_request.h | 70 ++++++++++++++++++++ lasso/xml/is_select.c | 109 +++++++++++++++++++++++++++++++ lasso/xml/is_select.h | 70 ++++++++++++++++++++ lasso/xml/is_text.c | 110 +++++++++++++++++++++++++++++++ lasso/xml/is_text.h | 67 +++++++++++++++++++ lasso/xml/is_user_interaction.c | 121 ++++++++++++++++++++++++++++++++++ lasso/xml/is_user_interaction.h | 78 ++++++++++++++++++++++ 24 files changed, 2197 insertions(+) create mode 100644 lasso/xml/is_help.c create mode 100644 lasso/xml/is_help.h create mode 100644 lasso/xml/is_inquiry.c create mode 100644 lasso/xml/is_inquiry.h create mode 100644 lasso/xml/is_inquiry_element.c create mode 100644 lasso/xml/is_inquiry_element.h create mode 100644 lasso/xml/is_interaction_request.c create mode 100644 lasso/xml/is_interaction_request.h create mode 100644 lasso/xml/is_interaction_response.c create mode 100644 lasso/xml/is_interaction_response.h create mode 100644 lasso/xml/is_interaction_statement.c create mode 100644 lasso/xml/is_interaction_statement.h create mode 100644 lasso/xml/is_item.c create mode 100644 lasso/xml/is_item.h create mode 100644 lasso/xml/is_parameter.c create mode 100644 lasso/xml/is_parameter.h create mode 100644 lasso/xml/is_redirect_request.c create mode 100644 lasso/xml/is_redirect_request.h create mode 100644 lasso/xml/is_select.c create mode 100644 lasso/xml/is_select.h create mode 100644 lasso/xml/is_text.c create mode 100644 lasso/xml/is_text.h create mode 100644 lasso/xml/is_user_interaction.c create mode 100644 lasso/xml/is_user_interaction.h (limited to 'lasso') diff --git a/lasso/xml/is_help.c b/lasso/xml/is_help.c new file mode 100644 index 00000000..3b97e277 --- /dev/null +++ b/lasso/xml/is_help.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "label", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsHelp, label) }, + { "link", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsHelp, link) }, + { "moreLink", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsHelp, moreLink) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsHelp *node) +{ + node->label = NULL; + node->link = NULL; + node->moreLink = NULL; +} + +static void +class_init(LassoIsHelpClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Help"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_help_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsHelpClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsHelp), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsHelp", &this_info, 0); + } + return this_type; +} + +LassoIsHelp* +lasso_is_help_new() +{ + LassoIsHelp *node; + + node = g_object_new(LASSO_TYPE_IS_HELP, NULL); + + return node; +} diff --git a/lasso/xml/is_help.h b/lasso/xml/is_help.h new file mode 100644 index 00000000..23314260 --- /dev/null +++ b/lasso/xml/is_help.h @@ -0,0 +1,67 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_HELP_H__ +#define __LASSO_IS_HELP_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_HELP (lasso_is_help_get_type()) +#define LASSO_IS_HELP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_HELP, LassoIsHelp)) +#define LASSO_IS_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_IS_HELP, LassoIsHelpClass)) +#define LASSO_IS_IS_HELP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_HELP)) +#define LASSO_IS_IS_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_HELP)) +#define LASSO_IS_HELP_GET_CLASS(o) \(G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_HELP, \ + LassoIsHelpClass)) + +typedef struct _LassoIsHelp LassoIsHelp; +typedef struct _LassoIsHelpClass LassoIsHelpClass; + +struct _LassoIsHelp { + LassoNode parent; + + char *label; + char *link; + char *moreLink; +}; + +struct _LassoIsHelpClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_help_get_type(void); + +LASSO_EXPORT LassoIsHelp* lasso_is_help_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_HELP_H__ */ diff --git a/lasso/xml/is_inquiry.c b/lasso/xml/is_inquiry.c new file mode 100644 index 00000000..c9b42187 --- /dev/null +++ b/lasso/xml/is_inquiry.c @@ -0,0 +1,118 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Help", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInquiry, Help) }, + { "Select", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInquiry, Select) }, + { "Confirm", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInquiry, Confirm) }, + { "Text", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInquiry, Text) }, + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInquiry, id) }, + { "title", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInquiry, title) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsInquiry *node) +{ + node->Help = NULL; + node->Select = NULL; + node->Confirm = NULL; + node->Text = NULL; + node->id = NULL; + node->title = NULL; +} + +static void +class_init(LassoIsInquiryClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Inquiry"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_inquiry_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsInquiryClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsInquiry), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsInquiry", &this_info, 0); + } + return this_type; +} + +LassoIsInquiry* +lasso_is_inquiry_new() +{ + LassoIsInquiry *node; + + node = g_object_new(LASSO_TYPE_IS_INQUIRY, NULL); + + return node; +} diff --git a/lasso/xml/is_inquiry.h b/lasso/xml/is_inquiry.h new file mode 100644 index 00000000..19c661eb --- /dev/null +++ b/lasso/xml/is_inquiry.h @@ -0,0 +1,72 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_INQUIRY_H__ +#define __LASSO_IS_INQUIRY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_INQUIRY (lasso_is_inquiry_get_type()) +#define LASSO_IS_INQUIRY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_INQUIRY, LassoIsInquiry)) +#define LASSO_IS_INQUIRY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_INQUIRY, LassoIsInquiryClass)) +#define LASSO_IS_IS_INQUIRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_INQUIRY)) +#define LASSO_IS_IS_INQUIRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_INQUIRY)) +#define LASSO_IS_INQUIRY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_INQUIRY, LassoIsInquiryClass)) + +typedef struct _LassoIsInquiry LassoIsInquiry; +typedef struct _LassoIsInquiryClass LassoIsInquiryClass; + +struct _LassoIsInquiry { + LassoNode parent; + + GList *Help; + GList *Select; + GList *Confirm; + GList *Text; + + char *id; + char *title; +}; + +struct _LassoIsInquiryClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_inquiry_get_type(void); + +LASSO_EXPORT LassoIsInquiry* lasso_is_inquiry_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_INQUIRY_H__ */ diff --git a/lasso/xml/is_inquiry_element.c b/lasso/xml/is_inquiry_element.c new file mode 100644 index 00000000..b443e955 --- /dev/null +++ b/lasso/xml/is_inquiry_element.c @@ -0,0 +1,114 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Help", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInquiryElement, Help) }, + { "Hint", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInquiryElement, Hint) }, + { "Label", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInquiryElement, Label) }, + { "Value", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInquiryElement, Value) }, + { "name", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInquiryElement, name) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsInquiryElement *node) +{ + node->Help = NULL; + node->Hint = NULL; + node->Label = NULL; + node->Value = NULL; + node->name = NULL; +} + +static void +class_init(LassoIsInquiryElementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "InquiryElement"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_inquiry_element_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsInquiryElementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsInquiryElement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsInquiryElement", &this_info, 0); + } + return this_type; +} + +LassoIsInquiryElement* +lasso_is_inquiry_element_new(const char *name) +{ + LassoIsInquiryElement *node; + + node = g_object_new(LASSO_TYPE_IS_INQUIRY_ELEMENT, NULL); + + node->name = g_strdup(name); + + return node; +} diff --git a/lasso/xml/is_inquiry_element.h b/lasso/xml/is_inquiry_element.h new file mode 100644 index 00000000..4d852491 --- /dev/null +++ b/lasso/xml/is_inquiry_element.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_INQUIRY_ELEMENT_H__ +#define __LASSO_IS_INQUIRY_ELEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#define LASSO_TYPE_IS_INQUIRY_ELEMENT (lasso_is_inquiry_element_get_type()) +#define LASSO_IS_INQUIRY_ELEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_INQUIRY_ELEMENT, LassoIsInquiryElement)) +#define LASSO_IS_INQUIRY_ELEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_INQUIRY_ELEMENT, \ + LassoIsInquiryElementClass)) +#define LASSO_IS_IS_INQUIRY_ELEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_INQUIRY_ELEMENT)) +#define LASSO_IS_IS_INQUIRY_ELEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_INQUIRY_ELEMENT)) +#define LASSO_IS_INQUIRY_ELEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_INQUIRY_ELEMENT, LassoIsInquiryElementClass)) + +typedef struct _LassoIsInquiryElement LassoIsInquiryElement; +typedef struct _LassoIsInquiryElementClass LassoIsInquiryElementClass; + +struct _LassoIsInquiryElement { + LassoNode parent; + + LassoIsHelp *Help; + char *Hint; + char *Label; + char *Value; + + char *name; +}; + +struct _LassoIsInquiryElementClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_inquiry_element_get_type(void); + +LASSO_EXPORT LassoIsInquiryElement* lasso_is_inquiry_element_new(); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_INQUIRY_ELEMENT_H__ */ diff --git a/lasso/xml/is_interaction_request.c b/lasso/xml/is_interaction_request.c new file mode 100644 index 00000000..3aea80cc --- /dev/null +++ b/lasso/xml/is_interaction_request.c @@ -0,0 +1,122 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "ResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInteractionRequest, ResourceID) }, + { "EncryptedResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInteractionRequest, + EncryptedResourceID) }, + { "Inquiry", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInteractionRequest, Inquiry) }, + /* TODO : KeyInfo */ + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInteractionRequest, id) }, + { "language", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInteractionRequest, language) }, + { "maxInteractTime", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsInteractionRequest, + maxInteractTime) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsInteractionRequest *node) +{ + node->ResourceID = NULL; + node->EncryptedResourceID = NULL; + node->Inquiry = NULL; + /* TODO : KeyInfo */ + node->id = NULL; + node->language = NULL; + node->maxInteractTime = 0; /* FIXME : optional integer attribute */ + /* TODO : signed */ +} + +static void +class_init(LassoIsInteractionRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "InteractionRequest"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_interaction_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsInteractionRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsInteractionRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsInteractionRequest", &this_info, 0); + } + return this_type; +} + +LassoIsInteractionRequest* +lasso_is_interaction_request_new() +{ + LassoIsInteractionRequest *node; + + node = g_object_new(LASSO_TYPE_IS_INTERACTION_REQUEST, NULL); + + return node; +} diff --git a/lasso/xml/is_interaction_request.h b/lasso/xml/is_interaction_request.h new file mode 100644 index 00000000..37b8bc87 --- /dev/null +++ b/lasso/xml/is_interaction_request.h @@ -0,0 +1,83 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_INTERACTION_REQUEST_H__ +#define __LASSO_IS_INTERACTION_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include +#include + + +#define LASSO_TYPE_IS_INTERACTION_REQUEST (lasso_is_interaction_request_get_type()) +#define LASSO_IS_INTERACTION_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_INTERACTION_REQUEST, \ + LassoIsInteractionRequest)) +#define LASSO_IS_INTERACTION_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_INTERACTION_REQUEST, \ + LassoIsInteractionRequestClass)) +#define LASSO_IS_IS_INTERACTION_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_INTERACTION_REQUEST)) +#define LASSO_IS_IS_INTERACTION_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_INTERACTION_REQUEST)) +#define LASSO_IS_INTERACTION_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_INTERACTION_REQUEST, \ + LassoIsInteractionRequestClass)) + +typedef struct _LassoIsInteractionRequest LassoIsInteractionRequest; +typedef struct _LassoIsInteractionRequestClass LassoIsInteractionRequestClass; + +struct _LassoIsInteractionRequest { + LassoNode parent; + + LassoDiscoResourceID *ResourceID; + LassoDiscoEncryptedResourceID *EncryptedResourceID; + GList *Inquiry; + /* TODO : ds:KeyInfo */ + + char *id; + char *language; + int maxInteractTime; + /* TODO : signed */ +}; + +struct _LassoIsInteractionRequestClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_interaction_request_get_type(void); + +LASSO_EXPORT LassoIsInteractionRequest* lasso_is_interaction_request_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_INTERACTION_REQUEST_H__ */ diff --git a/lasso/xml/is_interaction_response.c b/lasso/xml/is_interaction_response.c new file mode 100644 index 00000000..6622cbeb --- /dev/null +++ b/lasso/xml/is_interaction_response.c @@ -0,0 +1,115 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Status", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInteractionResponse, Status) }, + { "InteractionStatement", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInteractionResponse, + InteractionStatement) }, + { "Parameter", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInteractionResponse, + Parameter) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsInteractionResponse *node) +{ + node->Status = NULL; + node->InteractionStatement = NULL; + node->Parameter = NULL; +} + +static void +class_init(LassoIsInteractionResponseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "InteractionResponse"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_interaction_response_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsInteractionResponseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsInteractionResponse), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsInteractionResponse", &this_info, 0); + } + return this_type; +} + +LassoIsInteractionResponse* +lasso_is_interaction_response_new(LassoUtilityStatus *status) +{ + LassoIsInteractionResponse *node; + + node = g_object_new(LASSO_TYPE_IS_INTERACTION_RESPONSE, NULL); + + node->Status = status; + + return node; +} diff --git a/lasso/xml/is_interaction_response.h b/lasso/xml/is_interaction_response.h new file mode 100644 index 00000000..e0f011a3 --- /dev/null +++ b/lasso/xml/is_interaction_response.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_INTERACTION_RESPONSE_H__ +#define __LASSO_IS_INTERACTION_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#define LASSO_TYPE_IS_INTERACTION_RESPONSE (lasso_is_interaction_response_get_type()) +#define LASSO_IS_INTERACTION_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_INTERACTION_RESPONSE, LassoIsText)) +#define LASSO_IS_INTERACTION_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_INTERACTION_RESPONSE, \ + LassoIsInteractionResponseClass)) +#define LASSO_IS_IS_INTERACTION_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_INTERACTION_RESPONSE)) +#define LASSO_IS_IS_INTERACTION_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_INTERACTION_RESPONSE)) +#define LASSO_IS_INTERACTION_RESPONSE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_INTERACTION_RESPONSE, \ + LassoIsInteractionResponseClass)) + +typedef struct _LassoIsInteractionResponse LassoIsInteractionResponse; +typedef struct _LassoIsInteractionResponseClass LassoIsInteractionResponseClass; + +struct _LassoIsInteractionResponse { + LassoNode parent; /* FIXME : inherit of LassoIsInquiryElement */ + + LassoUtilityStatus *Status; + GList *InteractionStatement; + GList *Parameter; +}; + +struct _LassoIsInteractionResponseClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_interaction_response_get_type(void); + +LASSO_EXPORT LassoIsInteractionResponse* lasso_is_interaction_response_new(); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_INTERACTION_RESPONSE_H__ */ diff --git a/lasso/xml/is_interaction_statement.c b/lasso/xml/is_interaction_statement.c new file mode 100644 index 00000000..7b7998a9 --- /dev/null +++ b/lasso/xml/is_interaction_statement.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Inquiry", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInteractionStatement, Inquiry) }, + /* TODO : Signature */ + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsInteractionStatement *node) +{ + node->Inquiry = NULL; +} + +static void +class_init(LassoIsInteractionStatementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "InteractionStatement"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_interaction_statement_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsInteractionStatementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsInteractionStatement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsInteractionStatement", &this_info, 0); + } + return this_type; +} + +LassoIsInteractionStatement* +lasso_is_interaction_statement_new(LassoIsInquiry *inquiry) +{ + LassoIsInteractionStatement *node; + + node = g_object_new(LASSO_TYPE_IS_INTERACTION_STATEMENT, NULL); + + node->Inquiry = inquiry; + + return node; +} diff --git a/lasso/xml/is_interaction_statement.h b/lasso/xml/is_interaction_statement.h new file mode 100644 index 00000000..93c3d835 --- /dev/null +++ b/lasso/xml/is_interaction_statement.h @@ -0,0 +1,72 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_INTERACTION_STATEMENT_H__ +#define __LASSO_IS_INTERACTION_STATEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#define LASSO_TYPE_IS_INTERACTION_STATEMENT (lasso_is_interaction_statement_get_type()) +#define LASSO_IS_INTERACTION_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_INTERACTION_STATEMENT, \ + LassoIsInteractionStatement)) +#define LASSO_IS_INTERACTION_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_INTERACTION_STATEMENT, \ + LassoIsInteractionStatementClass)) +#define LASSO_IS_IS_INTERACTION_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_INTERACTION_STATEMENT)) +#define LASSO_IS_IS_INTERACTION_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_INTERACTION_STATEMENT)) +#define LASSO_IS_INTERACTION_STATEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_INTERACTION_STATEMENT, \ + LassoIsInteractionStatementClass)) + +typedef struct _LassoIsInteractionStatement LassoIsInteractionStatement; +typedef struct _LassoIsInteractionStatementClass LassoIsInteractionStatementClass; + +struct _LassoIsInteractionStatement { + LassoNode parent; /* FIXME : inherit of LassoIsInquiryElement */ + + LassoIsInquiry *Inquiry; +}; + +struct _LassoIsInteractionStatementClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_interaction_statement_get_type(void); + +LASSO_EXPORT LassoIsInteractionStatement* lasso_is_interaction_statement_new(); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_INTERACTION_STATEMENT_H__ */ diff --git a/lasso/xml/is_item.c b/lasso/xml/is_item.c new file mode 100644 index 00000000..77ed2bc2 --- /dev/null +++ b/lasso/xml/is_item.c @@ -0,0 +1,109 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsItem *node) +{ + node->Hint = NULL; + node->label = NULL; + node->value = NULL; +} + +static void +class_init(LassoIsItemClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Item"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_item_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsItemClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsItem), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsItem", &this_info, 0); + } + return this_type; +} + +LassoIsItem* +lasso_is_item_new(const char *value) +{ + LassoIsItem *node; + + node = g_object_new(LASSO_TYPE_IS_ITEM, NULL); + + node->value = g_strdup(value); + + return node; +} diff --git a/lasso/xml/is_item.h b/lasso/xml/is_item.h new file mode 100644 index 00000000..305d5fc4 --- /dev/null +++ b/lasso/xml/is_item.h @@ -0,0 +1,67 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_ITEM_H__ +#define __LASSO_IS_ITEM_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_ITEM (lasso_is_item_get_type()) +#define LASSO_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_ITEM, LassoIsItem)) +#define LASSO_IS_ITEM_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_ITEM, LassoIsItemClass)) +#define LASSO_IS_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_ITEM)) +#define LASSO_IS_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_ITEM)) +#define LASSO_IS_ITEM_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_ITEM, LassoIsItemClass)) + +typedef struct _LassoIsItem LassoIsItem; +typedef struct _LassoIsItemClass LassoIsItemClass; + +struct _LassoIsItem { + LassoNode parent; + + char *Hint; + char *label; + char *value; +}; + +struct _LassoIsItemClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_item_get_type(void); + +LASSO_EXPORT LassoIsItem* lasso_is_item_new(const char *value); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_ITEM_H__ */ diff --git a/lasso/xml/is_parameter.c b/lasso/xml/is_parameter.c new file mode 100644 index 00000000..85aec54b --- /dev/null +++ b/lasso/xml/is_parameter.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "name", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsParameter, name) }, + { "value", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsParameter, value) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsParameter *node) +{ + node->name = NULL; + node->value = NULL; +} + +static void +class_init(LassoIsParameterClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Parameter"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_parameter_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsParameterClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsParameter), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsParameter", &this_info, 0); + } + return this_type; +} + +LassoIsParameter* +lasso_is_parameter_new(const char *name, const char *value) +{ + LassoIsParameter *node; + + node = g_object_new(LASSO_TYPE_IS_PARAMETER, NULL); + + node->name = g_strdup(name); + node->value = g_strdup(value); + + return node; +} diff --git a/lasso/xml/is_parameter.h b/lasso/xml/is_parameter.h new file mode 100644 index 00000000..9cf9beeb --- /dev/null +++ b/lasso/xml/is_parameter.h @@ -0,0 +1,68 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_PARAMETER_H__ +#define __LASSO_IS_PARAMETER_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_PARAMETER (lasso_is_parameter_get_type()) +#define LASSO_IS_PARAMETER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_PARAMETER, LassoIsParameter)) +#define LASSO_IS_PARAMETER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_PARAMETER, LassoIsParameterClass)) +#define LASSO_IS_IS_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_PARAMETER)) +#define LASSO_IS_IS_PARAMETER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_PARAMETER)) +#define LASSO_IS_PARAMETER_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_PARAMETER, LassoIsParameterClass)) + +typedef struct _LassoIsParameter LassoIsParameter; +typedef struct _LassoIsParameterClass LassoIsParameterClass; + +struct _LassoIsParameter { + LassoNode parent; + + char *name; + char *value; +}; + +struct _LassoIsParameterClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_parameter_get_type(void); + +LASSO_EXPORT LassoIsParameter* lasso_is_parameter_new(); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_PARAMETER_H__ */ diff --git a/lasso/xml/is_redirect_request.c b/lasso/xml/is_redirect_request.c new file mode 100644 index 00000000..4aa40cf3 --- /dev/null +++ b/lasso/xml/is_redirect_request.c @@ -0,0 +1,102 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "redirectURL", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoIsRedirectRequest, redirectURL) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsRedirectRequest *node) +{ + node->redirectURL = NULL; +} + +static void +class_init(LassoIsRedirectRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "RedirectRequest"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_redirect_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsRedirectRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsRedirectRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsRedirectRequest", &this_info, 0); + } + return this_type; +} + +LassoIsRedirectRequest* +lasso_is_redirect_request_new(const char *redirectURL) +{ + LassoIsRedirectRequest *node; + + node = g_object_new(LASSO_TYPE_IS_REDIRECT_REQUEST, NULL); + + node->redirectURL = g_strdup(redirectURL); + + return node; +} diff --git a/lasso/xml/is_redirect_request.h b/lasso/xml/is_redirect_request.h new file mode 100644 index 00000000..c8452e55 --- /dev/null +++ b/lasso/xml/is_redirect_request.h @@ -0,0 +1,70 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_REDIRECT_REQUEST_H__ +#define __LASSO_IS_REDIRECT_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_REDIRECT_REQUEST (lasso_is_redirect_request_get_type()) +#define LASSO_IS_REDIRECT_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_REDIRECT_REQUEST, LassoIsRedirectRequest)) +#define LASSO_IS_REDIRECT_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_REDIRECT_REQUEST, \ + LassoIsRedirectRequestClass)) +#define LASSO_IS_IS_REDIRECT_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_REDIRECT_REQUEST)) +#define LASSO_IS_IS_REDIRECT_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_REDIRECT_REQUEST)) +#define LASSO_IS_REDIRECT_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_REDIRECT_REQUEST, \ + LassoIsRedirectRequestClass)) + +typedef struct _LassoIsRedirectRequest LassoIsRedirectRequest; +typedef struct _LassoIsRedirectRequestClass LassoIsRedirectRequestClass; + +struct _LassoIsRedirectRequest { + LassoNode parent; + + char *redirectURL; +}; + +struct _LassoIsRedirectRequestClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_redirect_request_get_type(void); + +LASSO_EXPORT LassoIsRedirectRequest* lasso_is_redirect_request_new(const char *redirectURL); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_REDIRECT_REQUEST_H__ */ diff --git a/lasso/xml/is_select.c b/lasso/xml/is_select.c new file mode 100644 index 00000000..72fcba6c --- /dev/null +++ b/lasso/xml/is_select.c @@ -0,0 +1,109 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Item", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsSelect, Item) }, + { "multiple", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, + G_STRUCT_OFFSET(LassoIsSelect, multiple) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsSelect *node) +{ + node->Item = NULL; + node->multiple = FALSE; +} + +static void +class_init(LassoIsSelectClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Select"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_select_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsSelectClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsSelect), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsSelect", &this_info, 0); + } + return this_type; +} + +LassoIsSelect* +lasso_is_select_new(LassoIsItem *item1, LassoIsItem *item2) +{ + LassoIsSelect *node; + + node = g_object_new(LASSO_TYPE_IS_SELECT, NULL); + + return node; +} diff --git a/lasso/xml/is_select.h b/lasso/xml/is_select.h new file mode 100644 index 00000000..aa6948d4 --- /dev/null +++ b/lasso/xml/is_select.h @@ -0,0 +1,70 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_SELECT_H__ +#define __LASSO_IS_SELECT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#define LASSO_TYPE_IS_SELECT (lasso_is_select_get_type()) +#define LASSO_IS_SELECT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_SELECT, LassoIsSelect)) +#define LASSO_IS_SELECT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_SELECT, LassoIsSelectClass)) +#define LASSO_IS_IS_SELECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_SELECT)) +#define LASSO_IS_IS_SELECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_IS_SELECT)) +#define LASSO_IS_SELECT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_SELECT, LassoIsSelectClass)) + +typedef struct _LassoIsSelect LassoIsSelect; +typedef struct _LassoIsSelectClass LassoIsSelectClass; + +struct _LassoIsSelect { + LassoNode parent; /* FIXME : must inherit of InquiryElement class */ + + GList *Item; + + gboolean multiple; +}; + +struct _LassoIsSelectClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_select_get_type(void); + +LASSO_EXPORT LassoIsSelect* lasso_is_select_new(LassoIsItem *item1, LassoIsItem *item2); + /* FIXME : choose proper names */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_SELECT_H__ */ diff --git a/lasso/xml/is_text.c b/lasso/xml/is_text.c new file mode 100644 index 00000000..a370a295 --- /dev/null +++ b/lasso/xml/is_text.c @@ -0,0 +1,110 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "minChars", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsText, minChars) }, + { "maxChars", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsText, maxChars) }, + { "format", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsText, format) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsText *node) +{ + node->minChars = 0; + node->maxChars = 0; + node->format = NULL; +} + +static void +class_init(LassoIsTextClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Text"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_text_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsTextClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsText), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsText", &this_info, 0); + } + return this_type; +} + +LassoIsText* +lasso_is_text_new() +{ + LassoIsText *node; + + node = g_object_new(LASSO_TYPE_IS_TEXT, NULL); + + return node; +} diff --git a/lasso/xml/is_text.h b/lasso/xml/is_text.h new file mode 100644 index 00000000..9e51d427 --- /dev/null +++ b/lasso/xml/is_text.h @@ -0,0 +1,67 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_TEXT_H__ +#define __LASSO_IS_TEXT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_TEXT (lasso_is_text_get_type()) +#define LASSO_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_TEXT, LassoIsText)) +#define LASSO_IS_TEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_TEXT, LassoIsTextClass)) +#define LASSO_IS_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_TEXT)) +#define LASSO_IS_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_TEXT)) +#define LASSO_IS_TEXT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_TEXT, LassoIsTextClass)) + +typedef struct _LassoIsText LassoIsText; +typedef struct _LassoIsTextClass LassoIsTextClass; + +struct _LassoIsText { + LassoNode parent; /* FIXME : inherit of LassoIsInquiryElement */ + + int minChars; + int maxChars; + char *format; +}; + +struct _LassoIsTextClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_text_get_type(void); + +LASSO_EXPORT LassoIsText* lasso_is_text_new(); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_TEXT_H__ */ diff --git a/lasso/xml/is_user_interaction.c b/lasso/xml/is_user_interaction.c new file mode 100644 index 00000000..5e6244bf --- /dev/null +++ b/lasso/xml/is_user_interaction.c @@ -0,0 +1,121 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +/* + * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd): + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "InteractionService", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoIsUserInteraction, InteractionService) }, + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, id) }, + { "interact", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, interact) }, + { "language", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, language) }, + { "redirect", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, + G_STRUCT_OFFSET(LassoIsUserInteraction, redirect) }, + { "maxInteractTime", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoIsUserInteraction, maxInteractTime) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoIsUserInteraction *node) +{ + node->InteractionService = NULL; + node->id = NULL; + node->interact = g_strdup(LASSO_IS_INTERACT_ATTR_INTERACT_IF_NEEDED); + node->language = NULL; + node->redirect = FALSE; + node->maxInteractTime = 0; +} + +static void +class_init(LassoIsUserInteractionClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "UserInteraction"); + lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_is_user_interaction_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoIsUserInteractionClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoIsUserInteraction), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoIsUserInteraction", &this_info, 0); + } + return this_type; +} + +LassoIsUserInteraction* +lasso_is_user_interaction_new() +{ + LassoIsUserInteraction *node; + + node = g_object_new(LASSO_TYPE_IS_USER_INTERACTION, NULL); + + return node; +} diff --git a/lasso/xml/is_user_interaction.h b/lasso/xml/is_user_interaction.h new file mode 100644 index 00000000..b47d87b5 --- /dev/null +++ b/lasso/xml/is_user_interaction.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Nicolas Clapies + * Valery Febvre + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_IS_USER_INTERACTION_H__ +#define __LASSO_IS_USER_INTERACTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#define LASSO_TYPE_IS_USER_INTERACTION (lasso_is_user_interaction_get_type()) +#define LASSO_IS_USER_INTERACTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_IS_USER_INTERACTION, LassoIsUserInteraction)) +#define LASSO_IS_USER_INTERACTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_IS_USER_INTERACTION, \ + LassoIsUserInteractionClass)) +#define LASSO_IS_IS_USER_INTERACTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_IS_USER_INTERACTION)) +#define LASSO_IS_IS_USER_INTERACTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_IS_USER_INTERACTION)) +#define LASSO_IS_USER_INTERACTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_IS_USER_INTERACTION, \ + LassoIsUserInteractionClass)) + +typedef struct _LassoIsUserInteraction LassoIsUserInteraction; +typedef struct _LassoIsUserInteractionClass LassoIsUserInteractionClass; + +struct _LassoIsUserInteraction { + LassoNode parent; + + GList *InteractionService; + + gchar *id; + gchar *interact; + gchar *language; + gboolean redirect; + gint maxInteractTime; + + /* FIXME : implement soap:actor and soap:mustUnderstand */ +}; + +struct _LassoIsUserInteractionClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_is_user_interaction_get_type(void); + +LASSO_EXPORT LassoIsUserInteraction* lasso_is_user_interaction_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_IS_USER_INTERACTION_H__ */ -- cgit