2
* Copyright (C) 2000 S�bastien LECACHEUR
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* @header gwcategory.h
23
* Copyright (C) 2000 S�bastien LECACHEUR<br><br>
24
* This Distributed under the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public Licence</a><br><br>
25
* This component was developed for the GWhere project.<br>
26
* It's an object for category representation. His structure gets many informations as file name, description, ...<br><br>
27
* @abstract This is the category data structure.
28
* @author S�bastien LECACHEUR <zero@gwhere.org>
29
* @version 1.0 2001/08/21
32
* @link GWhere Web Site <http://www.gwhere.org>
33
* @link GTK+ Web Site <http://www.gtk.org>
35
* @author Author <zero@gwhere.org>
39
#ifndef GW_DATA_CATEGORY_H
40
#define GW_DATA_CATEGORY_H
48
* @abstract Category data structure
49
* @discussion Category data is an opaque data structure containing information about a category.
55
* @function category_new
56
* @abstract Creates a new category.
57
* @discussion This function creates a new category. It's an allocation function.
58
* @result a pointer to the category structure.<br>
59
* Returns <i>NULL</i> when an error occured.<br>
61
struct category * category_new ( void);
65
* @function category_set_index
66
* @abstract Sets the category's index.
67
* @discussion This function sets the category's index. This index must be unique.<br>
68
* @param p the category to set the name
69
* @param index the index number
70
* @result an error code.<br>
71
* Returns <i>0</i> when it's done.<br>
72
* Returns <i>-1</i> when an error occured.<br>
74
gint category_set_index ( struct category *p, gint index);
78
* @function category_set_name
79
* @abstract Sets the category's name.
80
* @discussion This function sets the category's name.<br>
81
* The name may be <i>null</i>. It's dangerous!!
82
* @param p the category to set the name
83
* @param name the name
84
* @result an error code.<br>
85
* Returns <i>0</i> when it's done.<br>
86
* Returns <i>-1</i> when an error occured.<br>
88
gint category_set_name ( struct category *p, gchar *name);
92
* @function category_set_description
93
* @abstract Sets the category's description.
94
* @discussion This function sets the category's description.<br>
95
* @param p the category to set the description
96
* @param description the description
97
* @result an error code.<br>
98
* Returns <i>0</i> when it's done.<br>
99
* Returns <i>-1</i> when an error occured.<br>
101
gint category_set_description ( struct category *p, gchar *description);
105
* @function category_set_number_catalog
106
* @abstract Sets the category's number catalogs.
107
* @discussion This function sets the number of catalogs which use this category.<br>
108
* @param p the category to set the number of catalogs
109
* @param num the number of catalogs
110
* @result an error code.<br>
111
* Returns <i>0</i> when it's done.<br>
112
* Returns <i>-1</i> when an error occured.<br>
114
gint category_set_number_catalog ( struct category *p, gint num);
118
* @function category_set_number_disk
119
* @abstract Sets the category's number disks.
120
* @discussion This function sets the number of disks which use this category.<br>
121
* @param p the category to set the number of disks
122
* @param num the number of disks
123
* @result an error code.<br>
124
* Returns <i>0</i> when it's done.<br>
125
* Returns <i>-1</i> when an error occured.<br>
127
gint category_set_number_disk ( struct category *p, gint num);
131
* @function category_set_number_folder
132
* @abstract Sets the category's number folders.
133
* @discussion This function sets the number of folders which use this category.<br>
134
* @param p the category to set the number of folders
135
* @param num the number of folders
136
* @result an error code.<br>
137
* Returns <i>0</i> when it's done.<br>
138
* Returns <i>-1</i> when an error occured.<br>
140
gint category_set_number_folder ( struct category *p, gint num);
144
* @function category_set_number_file
145
* @abstract Sets the category's number files.
146
* @discussion This function sets the number of files which use this category.<br>
147
* @param p the category to set the number of files
148
* @param num the number of files
149
* @result an error code.<br>
150
* Returns <i>0</i> when it's done.<br>
151
* Returns <i>-1</i> when an error occured.<br>
153
gint category_set_number_file ( struct category *p, gint num);
157
* @function category_get_index
158
* @abstract Gets the category's index.
159
* @discussion This function gets the category's index.<br>
160
* @param p the category to get index
161
* @result the category index.<br>
162
* Returns <i>-1</i> when an error occured.<br>
164
gint category_get_index ( struct category *p);
168
* @function category_get_name
169
* @abstract Gets the category's name.
170
* @discussion This function gets the category's name.<br>
171
* @param p the category to get name
172
* @result the category name.<br>
173
* Returns <i>""</i> if the category name is <i>NULL</i>
174
* Returns <i>NULL</i> when an error occured.<br>
176
gchar * category_get_name ( struct category *p);
180
* @function category_get_description
181
* @abstract Gets the category's description.
182
* @discussion This function gets the category's description.<br>
183
* @param p the category to get description
184
* @result the category description.<br>
185
* Returns <i>""</i> if the category description is <i>NULL</i>
186
* Returns <i>NULL</i> when an error occured.<br>
188
gchar * category_get_description ( struct category *p);
192
* @function category_get_number_catalog
193
* @abstract Gets the category's number catalogs.
194
* @discussion This function gets the number of catalogs which use this category.<br>
195
* @param p the category to get number of catalogs
196
* @result the number of catalogs.<br>
197
* Returns <i>-1</i> when an error occured.<br>
199
gint category_get_number_catalog ( struct category *p);
203
* @function category_get_number_disk
204
* @abstract Gets the category's number disks.
205
* @discussion This function gets the number of disks which use this category.<br>
206
* @param p the category to get number of disks
207
* @result the number of disks.<br>
208
* Returns <i>-1</i> when an error occured.<br>
210
gint category_get_number_disk ( struct category *p);
214
* @function category_get_number_folder
215
* @abstract Gets the category's number folders.
216
* @discussion This function gets the number of folders which use this category.<br>
217
* @param p the category to get number of folders
218
* @result the number of folders.<br>
219
* Returns <i>-1</i> when an error occured.<br>
221
gint category_get_number_folder ( struct category *p);
225
* @function category_get_number_file
226
* @abstract Gets the category's number files.
227
* @discussion This function gets the number of files which use this category.<br>
228
* @param p the category to get number of files
229
* @result the number of files.<br>
230
* Returns <i>-1</i> when an error occured.<br>
232
gint category_get_number_file ( struct category *p);
236
* @function category_add_catalog
237
* @abstract Adds a catalog to the category
238
* @discussion This function adds a catalog that use this category. This function increments the category's number of catalogs.<br>
239
* @param p the category to add a catalog
240
* @result the number of catalogs.<br>
241
* Returns <i>-1</i> when an error occured.<br>
243
gint category_add_catalog ( struct category *p);
247
* @function category_add_disk
248
* @abstract Adds a disk to the category
249
* @discussion This function adds a disk that use this category. This function increments the category's number of disks.<br>
250
* @param p the category to add a disk
251
* @result the number of disks.<br>
252
* Returns <i>-1</i> when an error occured.<br>
254
gint category_add_disk ( struct category *p);
258
* @function category_add_folder
259
* @abstract Adds a folder to the category
260
* @discussion This function adds a folder that use this category. This function increments the category's number of folders.<br>
261
* @param p the category to add a folder
262
* @result the number of folders.<br>
263
* Returns <i>-1</i> when an error occured.<br>
265
gint category_add_folder ( struct category *p);
269
* @function category_add_file
270
* @abstract Adds a file to the category
271
* @discussion This function adds a file that use this category. This function increments the category's number of files.<br>
272
* @param p the category to add a file
273
* @result the number of files.<br>
274
* Returns <i>-1</i> when an error occured.<br>
276
gint category_add_file ( struct category *p);
280
* @function category_remove_catalog
281
* @abstract Removes a catalog to the category
282
* @discussion This function removes a catalog that use this category. This function decriment the category's number of catalogs.<br>
283
* @param p the category to remove a catalog
284
* @result the number of catalogs.<br>
285
* Returns <i>-1</i> when an error occured.<br>
287
gint category_remove_catalog ( struct category *p);
291
* @function category_remove_disk
292
* @abstract Removes a disk to the category
293
* @discussion This function removes a disk that use this category. This function decriment the category's number of disks.<br>
294
* @param p the category to remove a disk
295
* @result the number of disks.<br>
296
* Returns <i>-1</i> when an error occured.<br>
298
gint category_remove_disk ( struct category *p);
302
* @function category_remove_folder
303
* @abstract Removes a folder to the category
304
* @discussion This function removes a folder that use this category. This function decriment the category's number of folders.<br>
305
* @param p the category to remove a folder
306
* @result the number of folders.<br>
307
* Returns <i>-1</i> when an error occured.<br>
309
gint category_remove_folder ( struct category *p);
313
* @function category_remove_file
314
* @abstract Removes a file to the category
315
* @discussion This function removes a file that use this category. This function decriment the category's number of files.<br>
316
* @param p the category to remove a file
317
* @result the number of files.<br>
318
* Returns <i>-1</i> when an error occured.<br>
320
gint category_remove_file ( struct category *p);
324
* @function category_can_removed
325
* @abstract Gets if the category can be removed.
326
* @discussion This function gets if the category can be removed. The category can be removed if nothing use this category<br>
327
* @param p the category to know if it can be removed
328
* @result is can be removed.<br>
329
* Returns <i>FALSE</i> when an error occured.<br>
331
gboolean category_can_removed ( struct category *p);
335
* @function category_free
336
* @abstract Frees datas structure.
337
* @discussion This function frees the category's datas.
338
* @param p the category to free
339
* @result an error code.<br>
340
* Returns <i>0</i> when it's done.<br>
341
* Returns <i>-1</i> when an error occured.<br>
343
gint category_free ( struct category *p);