comparison src/savedstatuses.h @ 10418:bed2c96bc1fb

[gaim-migrate @ 11669] I split the status-saving code into it's own little API, because it really is separate from the other status.c savedstatuses.c sits on top of the rest of the status API. And you can delete saved statuses now. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 26 Dec 2004 00:46:26 +0000
parents
children c9b1f3fac753
comparison
equal deleted inserted replaced
10417:823ad21cd95a 10418:bed2c96bc1fb
1 /**
2 * @file savedstatuses.h Saved Status API
3 * @ingroup core
4 *
5 * gaim
6 *
7 * Gaim is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25 #ifndef _GAIM_SAVEDSTATUSES_H_
26 #define _GAIM_SAVEDSTATUSES_H_
27
28 /**
29 * Saved statuses don't really interact much with the rest of Gaim. It
30 * could really be a plugin. It's just a list of away states. When
31 * a user chooses one of the saved states, their Gaim accounts are set
32 * to the settings of that state.
33 */
34
35 typedef struct _GaimStatusSaved GaimStatusSaved;
36 typedef struct _GaimStatusSavedSub GaimStatusSavedSub;
37
38 /**************************************************************************/
39 /** @name Saved status subsystem */
40 /**************************************************************************/
41 /*@{*/
42
43 /**
44 * Create a new saved status. This will add the saved status to the
45 * list of saved statuses and writes the revised list to status.xml.
46 *
47 * @param title The title of the saved status. This must be unique.
48 * @param type The type of saved status.
49 *
50 * @return The newly created saved status.
51 */
52 GaimStatusSaved *gaim_savedstatuses_new(const char *title, GaimStatusPrimitive type);
53
54 /**
55 * Delete a saved status. This removes the saved status from the list
56 * of saved statuses, and writes the revised list to status.xml.
57 *
58 * @param title The title of the saved status.
59 *
60 * @return TRUE if the status was successfully deleted. FALSE if the
61 * status could not be deleted because no saved status exists
62 * with the given title.
63 */
64 gboolean gaim_savedstatuses_delete(const char *title);
65
66 /**
67 * Returns all saved statuses.
68 *
69 * @return A list of saved statuses.
70 */
71 const GList *gaim_savedstatuses_get_all(void);
72
73 /**
74 * Finds a saved status with the specified title.
75 *
76 * @param title The name of the saved status.
77 *
78 * @return The saved status if found, or NULL.
79 */
80 GaimStatusSaved *gaim_savedstatuses_find(const char *title);
81
82 /**
83 * Create a new saved status and add it to the list
84 * of saved statuses.
85 *
86 * @param title The title for the new saved status.
87 * @param type The type of saved status.
88 *
89 * @return The newly created saved status.
90 */
91 GaimStatusSaved *gaim_savedstatuses_new(const char *title,
92 GaimStatusPrimitive type);
93
94 /**
95 * Return the name of a given saved status.
96 *
97 * @param saved_status The saved status.
98 *
99 * @return The title.
100 */
101 const char *gaim_savedstatuses_get_title(const GaimStatusSaved *saved_status);
102
103 /**
104 * Return the name of a given saved status.
105 *
106 * @param saved_status The saved status.
107 *
108 * @return The name.
109 */
110 GaimStatusPrimitive gaim_savedstatuses_get_type(const GaimStatusSaved *saved_status);
111
112 /**
113 * Return the name of a given saved status.
114 *
115 * @param saved_status The saved status.
116 *
117 * @return The name.
118 */
119 const char *gaim_savedstatuses_get_message(const GaimStatusSaved *saved_status);
120
121 /**
122 * Get the handle for the status subsystem.
123 *
124 * @return the handle to the status subsystem
125 */
126 void *gaim_savedstatuses_get_handle();
127
128 /**
129 * Initializes the status subsystem.
130 */
131 void gaim_savedstatuses_init(void);
132
133 /**
134 * Uninitializes the status subsystem.
135 */
136 void gaim_savedstatuses_uninit(void);
137
138 /*@}*/
139
140 #endif /* _GAIM_SAVEDSTATUSES_H_ */