10418
|
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
|
10419
|
35 typedef struct _GaimSavedStatus GaimSavedStatus;
|
|
36 typedef struct _GaimSavedStatusSub GaimSavedStatusSub;
|
10418
|
37
|
10447
|
38 #include "status.h"
|
|
39
|
10418
|
40 /**************************************************************************/
|
|
41 /** @name Saved status subsystem */
|
|
42 /**************************************************************************/
|
|
43 /*@{*/
|
|
44
|
|
45 /**
|
|
46 * Create a new saved status. This will add the saved status to the
|
|
47 * list of saved statuses and writes the revised list to status.xml.
|
|
48 *
|
|
49 * @param title The title of the saved status. This must be unique.
|
|
50 * @param type The type of saved status.
|
|
51 *
|
10420
|
52 * @return The newly created saved status, or NULL if the title you
|
|
53 * used was already taken.
|
10418
|
54 */
|
10419
|
55 GaimSavedStatus *gaim_savedstatus_new(const char *title,
|
|
56 GaimStatusPrimitive type);
|
10418
|
57
|
|
58 /**
|
10420
|
59 * Set the message for the given saved status.
|
|
60 *
|
|
61 * @param status The saved status.
|
|
62 * @param message The message, or NULL if you want to unset the
|
|
63 * message for this status.
|
|
64 */
|
|
65 void gaim_savedstatus_set_message(GaimSavedStatus *status,
|
|
66 const char *message);
|
|
67
|
|
68 /**
|
10418
|
69 * Delete a saved status. This removes the saved status from the list
|
|
70 * of saved statuses, and writes the revised list to status.xml.
|
|
71 *
|
|
72 * @param title The title of the saved status.
|
|
73 *
|
|
74 * @return TRUE if the status was successfully deleted. FALSE if the
|
|
75 * status could not be deleted because no saved status exists
|
|
76 * with the given title.
|
|
77 */
|
10419
|
78 gboolean gaim_savedstatus_delete(const char *title);
|
10418
|
79
|
|
80 /**
|
|
81 * Returns all saved statuses.
|
|
82 *
|
|
83 * @return A list of saved statuses.
|
|
84 */
|
|
85 const GList *gaim_savedstatuses_get_all(void);
|
|
86
|
|
87 /**
|
|
88 * Finds a saved status with the specified title.
|
|
89 *
|
|
90 * @param title The name of the saved status.
|
|
91 *
|
|
92 * @return The saved status if found, or NULL.
|
|
93 */
|
10419
|
94 GaimSavedStatus *gaim_savedstatus_find(const char *title);
|
10418
|
95
|
|
96 /**
|
|
97 * Return the name of a given saved status.
|
|
98 *
|
|
99 * @param saved_status The saved status.
|
|
100 *
|
|
101 * @return The title.
|
|
102 */
|
10419
|
103 const char *gaim_savedstatus_get_title(const GaimSavedStatus *saved_status);
|
10418
|
104
|
|
105 /**
|
|
106 * Return the name of a given saved status.
|
|
107 *
|
|
108 * @param saved_status The saved status.
|
|
109 *
|
|
110 * @return The name.
|
|
111 */
|
10419
|
112 GaimStatusPrimitive gaim_savedstatus_get_type(const GaimSavedStatus *saved_status);
|
10418
|
113
|
|
114 /**
|
|
115 * Return the name of a given saved status.
|
|
116 *
|
|
117 * @param saved_status The saved status.
|
|
118 *
|
|
119 * @return The name.
|
|
120 */
|
10419
|
121 const char *gaim_savedstatus_get_message(const GaimSavedStatus *saved_status);
|
10418
|
122
|
|
123 /**
|
|
124 * Get the handle for the status subsystem.
|
|
125 *
|
|
126 * @return the handle to the status subsystem
|
|
127 */
|
|
128 void *gaim_savedstatuses_get_handle();
|
|
129
|
|
130 /**
|
|
131 * Initializes the status subsystem.
|
|
132 */
|
|
133 void gaim_savedstatuses_init(void);
|
|
134
|
|
135 /**
|
|
136 * Uninitializes the status subsystem.
|
|
137 */
|
|
138 void gaim_savedstatuses_uninit(void);
|
|
139
|
|
140 /*@}*/
|
|
141
|
|
142 #endif /* _GAIM_SAVEDSTATUSES_H_ */
|