1 /* $Id: dst_delete_item_base.c,v 1.0 2005/10/14 15:17:55 fpeters Exp $
2  *
3  * Lasso - A free implementation of the Liberty Alliance specifications.
4  *
5  * Copyright (C) 2004-2007 Entr'ouvert
6  * http://lasso.entrouvert.org
7  *
8  * Authors: See AUTHORS file in top-level directory.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "../private.h"
25 #include "dst_delete_item_base.h"
26 #include "idwsf2_strings.h"
27 
28 /**
29  * SECTION:dst_delete_item_base
30  * @short_description: &lt;dst:DeleteItemBase&gt;
31  *
32  * <figure><title>Schema fragment for dst:DeleteItemBase</title>
33  * <programlisting><![CDATA[
34  *
35  * <xs:complexType name="DeleteItemBaseType">
36  *   <xs:attributeGroup ref="dst:selectQualif"/>
37  *   <xs:attribute name="notChangedSince" use="optional" type="xs:dateTime"/>
38  *   <xs:attribute name="id" use="optional" type="xs:ID"/>
39  *   <xs:attribute ref="lu:itemID" use="optional"/>
40  * </xs:complexType>
41  * ]]></programlisting>
42  * </figure>
43  */
44 
45 /*****************************************************************************/
46 /* private methods                                                           */
47 /*****************************************************************************/
48 
49 
50 static struct XmlSnippet schema_snippets[] = {
51 	{ "notChangedSince", SNIPPET_ATTRIBUTE | SNIPPET_OPTIONAL,
52 		G_STRUCT_OFFSET(LassoIdWsf2DstDeleteItemBase, notChangedSince), NULL, NULL, NULL},
53 	{ "id", SNIPPET_ATTRIBUTE | SNIPPET_OPTIONAL,
54 		G_STRUCT_OFFSET(LassoIdWsf2DstDeleteItemBase, id), NULL, NULL, NULL},
55 	{ "itemID", SNIPPET_ATTRIBUTE | SNIPPET_OPTIONAL,
56 		G_STRUCT_OFFSET(LassoIdWsf2DstDeleteItemBase, itemID), NULL, NULL, NULL},
57 	{ "objectType", SNIPPET_ATTRIBUTE,
58 		G_STRUCT_OFFSET(LassoIdWsf2DstDeleteItemBase, objectType), NULL, NULL, NULL},
59 	{ "predefined", SNIPPET_ATTRIBUTE,
60 		G_STRUCT_OFFSET(LassoIdWsf2DstDeleteItemBase, predefined), NULL, NULL, NULL},
61 	{NULL, 0, 0, NULL, NULL, NULL}
62 };
63 
64 static LassoNodeClass *parent_class = NULL;
65 
66 
67 /*****************************************************************************/
68 /* instance and class init functions                                         */
69 /*****************************************************************************/
70 
71 
72 static void
class_init(LassoIdWsf2DstDeleteItemBaseClass * klass,void * unused G_GNUC_UNUSED)73 class_init(LassoIdWsf2DstDeleteItemBaseClass *klass, void *unused G_GNUC_UNUSED)
74 {
75 	LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
76 
77 	parent_class = g_type_class_peek_parent(klass);
78 	nclass->node_data = g_new0(LassoNodeClassData, 1);
79 	lasso_node_class_set_nodename(nclass, "DeleteItemBase");
80 	lasso_node_class_set_ns(nclass, LASSO_IDWSF2_DST_HREF, LASSO_IDWSF2_DST_PREFIX);
81 	lasso_node_class_add_snippets(nclass, schema_snippets);
82 }
83 
84 GType
lasso_idwsf2_dst_delete_item_base_get_type()85 lasso_idwsf2_dst_delete_item_base_get_type()
86 {
87 	static GType this_type = 0;
88 
89 	if (!this_type) {
90 		static const GTypeInfo this_info = {
91 			sizeof (LassoIdWsf2DstDeleteItemBaseClass),
92 			NULL,
93 			NULL,
94 			(GClassInitFunc) class_init,
95 			NULL,
96 			NULL,
97 			sizeof(LassoIdWsf2DstDeleteItemBase),
98 			0,
99 			NULL,
100 			NULL
101 		};
102 
103 		this_type = g_type_register_static(LASSO_TYPE_NODE,
104 				"LassoIdWsf2DstDeleteItemBase", &this_info, 0);
105 	}
106 	return this_type;
107 }
108 
109 /**
110  * lasso_idwsf2_dst_delete_item_base_new:
111  *
112  * Creates a new #LassoIdWsf2DstDeleteItemBase object.
113  *
114  * Return value: a newly created #LassoIdWsf2DstDeleteItemBase object
115  **/
116 LassoIdWsf2DstDeleteItemBase*
lasso_idwsf2_dst_delete_item_base_new()117 lasso_idwsf2_dst_delete_item_base_new()
118 {
119 	return g_object_new(LASSO_TYPE_IDWSF2_DST_DELETE_ITEM_BASE, NULL);
120 }
121