1 /* $Id$
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 "sa_password_transforms.h"
26 #include "idwsf_strings.h"
27 
28 /**
29  * SECTION:sa_password_transforms
30  * @short_description: &lt;sa:PasswordTransforms&gt;
31  *
32  * <figure><title>Schema fragment for sa:PasswordTransforms</title>
33  * <programlisting><![CDATA[
34  *   <xs:element name="PasswordTransforms">
35  *      <xs:annotation>
36  *        <xs:documentation>
37  *          Contains ordered list of sequential password transformations
38  *        </xs:documentation>
39  *      </xs:annotation>
40  *      <xs:complexType>
41  *        <xs:sequence>
42  *          <xs:element name="Transform" maxOccurs="unbounded">
43  *            <xs:complexType>
44  *              <xs:sequence>
45  *                <xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
46  *                <xs:complexType>
47  *                  <xs:simpleContent>
48  *                    <xs:extension base="xs:string">
49  *                      <xs:attribute name="name" type="xs:string" use="required"/>
50  *                    </xs:extension>
51  *                  </xs:simpleContent>
52  *                </xs:complexType>
53  *                </xs:eledment>
54  *              </xs:sequence>
55  *              <xs:attribute name="name" type="xs:anyURI" use="required"/>
56  *              <xs:attribute name="id" type="xs:ID"use="optional"/>
57  *            </xs:complexType>
58  *          </xs:element>
59  *        </xs:sequence>
60  *      </xs:complexType>
61  *  </xs:element>
62  * ]]></programlisting>
63  * </figure>
64  */
65 
66 /*****************************************************************************/
67 /* private methods                                                           */
68 /*****************************************************************************/
69 
70 static struct XmlSnippet schema_snippets[] = {
71 	{ "Transform", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSaPasswordTransforms, Transform), NULL, NULL, NULL},
72 	{NULL, 0, 0, NULL, NULL, NULL}
73 };
74 
75 /*****************************************************************************/
76 /* instance and class init functions                                         */
77 /*****************************************************************************/
78 
79 
80 static void
class_init(LassoSaPasswordTransformsClass * klass,void * unused G_GNUC_UNUSED)81 class_init(LassoSaPasswordTransformsClass *klass, void *unused G_GNUC_UNUSED)
82 {
83 	LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
84 
85 	nclass->node_data = g_new0(LassoNodeClassData, 1);
86 	lasso_node_class_set_nodename(nclass, "PasswordTransforms");
87 	lasso_node_class_set_ns(nclass, LASSO_SA_HREF, LASSO_SA_PREFIX);
88 	lasso_node_class_add_snippets(nclass, schema_snippets);
89 }
90 
91 GType
lasso_sa_password_transforms_get_type()92 lasso_sa_password_transforms_get_type()
93 {
94 	static GType this_type = 0;
95 
96 	if (!this_type) {
97 		static const GTypeInfo this_info = {
98 			sizeof (LassoSaPasswordTransformsClass),
99 			NULL,
100 			NULL,
101 			(GClassInitFunc) class_init,
102 			NULL,
103 			NULL,
104 			sizeof(LassoSaPasswordTransforms),
105 			0,
106 			NULL,
107 			NULL
108 		};
109 
110 		this_type = g_type_register_static(LASSO_TYPE_NODE,
111 				"LassoSaPasswordTransforms", &this_info, 0);
112 	}
113 	return this_type;
114 }
115 
116 LassoSaPasswordTransforms*
lasso_sa_password_transforms_new()117 lasso_sa_password_transforms_new()
118 {
119 	LassoSaPasswordTransforms *node;
120 
121 	node = g_object_new(LASSO_TYPE_SA_PASSWORD_TRANSFORMS, NULL);
122 
123 	return node;
124 }
125