1 /* MManager - a Desktop wide manager for multimedia applications.
3 * Copyright (C) 2008 Cosimo Cecchi <cosimoc@gnome.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include "mm-attribute.h"
35 * mm_attribute_get_name:
36 * @attr: a #MMAttribute.
38 * Gets the name of @attr.
40 * Return value: a string containing the name of @attr.
44 mm_attribute_get_name (MMAttribute
*attr
)
50 * mm_attribute_get_description:
51 * @attr: a #MMAttribute.
53 * Gets a textual description of @attr.
55 * Return value: a string containing a description of @attr.
59 mm_attribute_get_description (MMAttribute
*attr
)
61 return attr
->description
;
65 * mm_attribute_get_value_type:
66 * @attr: a #MMAttribute.
68 * Gets the #GType that a possible value for @attr should have.
70 * Return value: a #GType.
74 mm_attribute_get_value_type (MMAttribute
*attr
)
80 * mm_attribute_get_id:
81 * @attr: a #MMAttribute.
83 * Gets the unique identifier of @attr.
85 * Return value: a string containing the unique identifier of @attr.
89 mm_attribute_get_id (MMAttribute
*attr
)
96 * @attr: a #MMAttribute.
98 * Release the memory occupied by a #MMAttribute.
102 mm_attribute_free (MMAttribute
*attr
)
105 g_free (attr
->description
);
108 g_slice_free (MMAttribute
, attr
);
113 * @type: the #GType that a possible value for this attribute should have.
114 * @id: a string containing an unique id for the attribute.
115 * @name: a string containing the attribute's name.
116 * @description: a string containing the attribute's description.
118 * Builds a new #MMAttribute structure, with the specified properties. This is
119 * useful only if you're implementing a #MMAttributeManager, as the attributes
120 * are supposed to be static and owned by the manager.
122 * Return value: a newly allocated #MMAttribute structure. Free it with
123 * #mm_attribute_free.
127 mm_attribute_new (GType type
,
130 const char *description
)
134 a
= g_slice_new0 (MMAttribute
);
135 a
->id
= g_strdup (id
);
136 a
->name
= g_strdup (name
);
137 a
->description
= g_strdup (description
);