annotate src/savedstatuses.h @ 13887:7d3256b253ec

[gaim-migrate @ 16368] Minor tweaks to Makefile and some other things. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 28 Jun 2006 18:50:33 +0000
parents c4be649e2aca
children a8a033a89ee0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
1 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
2 * @file savedstatuses.h Saved Status API
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
3 * @ingroup core
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
4 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
5 * gaim
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
6 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
9 * source distribution.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
10 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
14 * (at your option) any later version.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
15 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
19 * GNU General Public License for more details.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
20 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
24 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
25 #ifndef _GAIM_SAVEDSTATUSES_H_
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
26 #define _GAIM_SAVEDSTATUSES_H_
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
27
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
28 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
29 * Saved statuses don't really interact much with the rest of Gaim. It
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
30 * could really be a plugin. It's just a list of away states. When
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
31 * a user chooses one of the saved states, their Gaim accounts are set
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
32 * to the settings of that state.
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
33 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
34 * In the savedstatus API, there is the concept of a 'transient'
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
35 * saved status. A transient saved status is one that is not
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
36 * permanent. Gaim will removed it automatically if it isn't
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
37 * used for a period of time. Transient saved statuses don't
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
38 * have titles and they don't show up in the list of saved
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
39 * statuses. In fact, if a saved status does not have a title
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
40 * then it is transient. If it does have a title, then it is not
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
41 * transient.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
42 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
43 * What good is a transient status, you ask? They can be used to
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
44 * keep track of the user's 5 most recently used statuses, for
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
45 * example. Basically if they just set a message on the fly,
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
46 * we'll cache it for them in case they want to use it again. If
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
47 * they don't use it again, we'll just delete it.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
48 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
49
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
50 /*
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
51 * TODO: Hmm. We should probably just be saving GaimPresences. That's
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
52 * something we should look into once the status box gets fleshed
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
53 * out more.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
54 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
55
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
56 typedef struct _GaimSavedStatus GaimSavedStatus;
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
57 typedef struct _GaimSavedStatusSub GaimSavedStatusSub;
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
58
10447
6feef0a9098a [gaim-migrate @ 11712]
Mark Doliner <mark@kingant.net>
parents: 10420
diff changeset
59 #include "status.h"
6feef0a9098a [gaim-migrate @ 11712]
Mark Doliner <mark@kingant.net>
parents: 10420
diff changeset
60
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
61 /**************************************************************************/
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
62 /** @name Saved status subsystem */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
63 /**************************************************************************/
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
64 /*@{*/
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
65
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
66 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
67 * Create a new saved status. This will add the saved status to the
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
68 * list of saved statuses and writes the revised list to status.xml.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
69 *
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
70 * @param title The title of the saved status. This must be
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
71 * unique. Or, if you want to create a transient
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
72 * saved status, then pass in NULL.
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
73 * @param type The type of saved status.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
74 *
10420
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
75 * @return The newly created saved status, or NULL if the title you
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
76 * used was already taken.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
77 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
78 GaimSavedStatus *gaim_savedstatus_new(const char *title,
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
79 GaimStatusPrimitive type);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
80
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
81 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
82 * Set the title for the given saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
83 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
84 * @param status The saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
85 * @param title The title of the saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
86 */
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
87 void gaim_savedstatus_set_title(GaimSavedStatus *status,
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
88 const char *title);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
89
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
90 /**
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
91 * Set the type for the given saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
92 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
93 * @param status The saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
94 * @param type The type of saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
95 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
96 void gaim_savedstatus_set_type(GaimSavedStatus *status,
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
97 GaimStatusPrimitive type);
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
98
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
99 /**
10420
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
100 * Set the message for the given saved status.
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
101 *
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
102 * @param status The saved status.
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
103 * @param message The message, or NULL if you want to unset the
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
104 * message for this status.
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
105 */
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
106 void gaim_savedstatus_set_message(GaimSavedStatus *status,
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
107 const char *message);
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
108
854c972ea863 [gaim-migrate @ 11671]
Mark Doliner <mark@kingant.net>
parents: 10419
diff changeset
109 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
110 * Set a substatus for an account in a saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
111 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
112 * @param status The saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
113 * @param account The account.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
114 * @param type The status type for the account in the staved
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
115 * status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
116 * @param message The message for the account in the substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
117 */
12080
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
118 void gaim_savedstatus_set_substatus(GaimSavedStatus *status,
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
119 const GaimAccount *account,
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
120 const GaimStatusType *type,
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
121 const char *message);
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
122
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
123 /**
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
124 * Unset a substatus for an account in a saved status. This clears
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
125 * the previosly set substatus for the GaimSavedStatus. If this
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
126 * saved status is activated then this account will use the default
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
127 * status type and message.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
128 *
12245
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
129 * @param saved_status The saved status.
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
130 * @param account The account.
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
131 */
12080
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
132 void gaim_savedstatus_unset_substatus(GaimSavedStatus *saved_status,
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
133 const GaimAccount *account);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
134
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
135 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
136 * Delete a saved status. This removes the saved status from the list
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
137 * of saved statuses, and writes the revised list to status.xml.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
138 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
139 * @param title The title of the saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
140 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
141 * @return TRUE if the status was successfully deleted. FALSE if the
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
142 * status could not be deleted because no saved status exists
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
143 * with the given title.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
144 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
145 gboolean gaim_savedstatus_delete(const char *title);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
146
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
147 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
148 * Returns all saved statuses.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
149 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
150 * @return A list of saved statuses.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
151 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
152 const GList *gaim_savedstatuses_get_all(void);
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
153
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
154 /**
12688
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
155 * Returns the n most popular saved statuses. "Popularity" is
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
156 * determined by when the last time a saved_status was used and
13673
5948086807cd [gaim-migrate @ 16075]
Mark Doliner <mark@kingant.net>
parents: 13244
diff changeset
157 * how many times it has been used. If the current status would
5948086807cd [gaim-migrate @ 16075]
Mark Doliner <mark@kingant.net>
parents: 13244
diff changeset
158 * normally show up in this list, then it is omited and instead
13675
53fdb7cc6940 [gaim-migrate @ 16077]
Mark Doliner <mark@kingant.net>
parents: 13673
diff changeset
159 * the "how_many+1" saved status will appear in the list. Also
53fdb7cc6940 [gaim-migrate @ 16077]
Mark Doliner <mark@kingant.net>
parents: 13673
diff changeset
160 * transient statuses without messages are not included in the
53fdb7cc6940 [gaim-migrate @ 16077]
Mark Doliner <mark@kingant.net>
parents: 13673
diff changeset
161 * list.
12688
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
162 *
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
163 * @param how_many The maximum number of saved statuses
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
164 * to return, or '0' to get all saved
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
165 * statuses sorted by popularity.
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
166 * @return A linked list containing at most how_many
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
167 * GaimSavedStatuses. This list should be
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
168 * g_list_free'd by the caller (but the
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
169 * GaimSavedStatuses must not be free'd).
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
170 */
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
171 GList *gaim_savedstatuses_get_popular(unsigned int how_many);
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
172
473c23442a36 [gaim-migrate @ 15031]
Mark Doliner <mark@kingant.net>
parents: 12323
diff changeset
173 /**
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
174 * Returns the currently selected saved status.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
175 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
176 * @return A pointer to the in-use GaimSavedStatus.
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
177 * This function never returns NULL.
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
178 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
179 GaimSavedStatus *gaim_savedstatus_get_current(void);
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
180
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
181 /**
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
182 * Returns the saved status that gets used when your
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
183 * accounts become idle-away.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
184 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
185 * @return A pointer to the idle-away GaimSavedStatus.
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
186 * This function never returns NULL.
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
187 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
188 GaimSavedStatus *gaim_savedstatus_get_idleaway(void);
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
189
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
190 /**
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
191 * Returns the status to be used when gaim is starting up
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
192 *
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
193 * @return A pointer to the startup GaimSavedStatus.
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
194 * This function never returns NULL.
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
195 */
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
196 GaimSavedStatus *gaim_savedstatus_get_startup(void);
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
197
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
198 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
199 * Finds a saved status with the specified title.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
200 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
201 * @param title The name of the saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
202 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
203 * @return The saved status if found, or NULL.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
204 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
205 GaimSavedStatus *gaim_savedstatus_find(const char *title);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
206
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
207 /**
12690
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
208 * Finds a saved status with the specified creation time.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
209 *
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
210 * @param creation_time The timestamp when the saved
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
211 * status was created.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
212 *
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
213 * @return The saved status if found, or NULL.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
214 */
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
215 GaimSavedStatus *gaim_savedstatus_find_by_creation_time(time_t creation_time);
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
216
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
217 /**
13012
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
218 * Finds a saved status with the specified primitive and message.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
219 *
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
220 * @param type The GaimStatusPrimitive for the status you're trying
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
221 * to find.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
222 * @param message The message for the status you're trying
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
223 * to find.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
224 *
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
225 * @return The saved status if found, or NULL.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
226 */
13244
c97c76d9d347 [gaim-migrate @ 15610]
Mark Doliner <mark@kingant.net>
parents: 13121
diff changeset
227 GaimSavedStatus *gaim_savedstatus_find_transient_by_type_and_message(GaimStatusPrimitive type, const char *message);
13012
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
228
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
229 /**
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
230 * Determines if a given saved status is "transient."
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
231 * A transient saved status is one that was not
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
232 * explicitly added by the user. Transient statuses
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
233 * are automatically removed if they are not used
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
234 * for a period of time.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
235 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
236 * A transient saved statuses is automatically
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
237 * created by the status box when the user sets himself
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
238 * to one of the generic primitive statuses. The reason
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
239 * we need to save this status information is so we can
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
240 * restore it when Gaim restarts.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
241 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
242 * @param saved_status The saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
243 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
244 * @return TRUE if the saved status is transient.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
245 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
246 gboolean gaim_savedstatus_is_transient(const GaimSavedStatus *saved_status);
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
247
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
248 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
249 * Return the name of a given saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
250 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
251 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
252 *
12690
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
253 * @return The title. This value may be a static buffer which may
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
254 * be overwritten on subsequent calls to this function. If
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
255 * you need a reference to the title for prolonged use then
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
256 * you should make a copy of it.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
257 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
258 const char *gaim_savedstatus_get_title(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
259
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
260 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
261 * Return the type of a given saved status.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
262 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
263 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
264 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
265 * @return The name.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
266 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
267 GaimStatusPrimitive gaim_savedstatus_get_type(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
268
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
269 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
270 * Return the default message of a given saved status.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
271 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
272 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
273 *
13121
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
274 * @return The message. This will return NULL if the saved
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
275 * status does not have a message. This will
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
276 * contain the normal markup that is created by
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
277 * Gaim's IMHTML (basically HTML markup).
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
278 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
279 const char *gaim_savedstatus_get_message(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
280
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
281 /**
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
282 * Return the time in seconds-since-the-epoch when this
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
283 * saved status was created. Note: For any status created
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
284 * by Gaim 1.5.0 or older this value will be invalid and
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
285 * very small (close to 0). This is because Gaim 1.5.0
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
286 * and older did not record the timestamp when the status
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
287 * was created.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
288 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
289 * However, this value is guaranteed to be a unique
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
290 * identifier for the given saved status.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
291 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
292 * @param saved_status The saved status.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
293 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
294 * @return The timestamp when this saved status was created.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
295 */
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
296 time_t gaim_savedstatus_get_creation_time(const GaimSavedStatus *saved_status);
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
297
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
298 /**
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
299 * Determine if a given saved status has "substatuses,"
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
300 * or if it is a simple status (the same for all
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
301 * accounts).
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
302 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
303 * @param saved_status The saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
304 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
305 * @return TRUE if the saved_status has substatuses.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
306 * FALSE otherwise.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
307 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
308 gboolean gaim_savedstatus_has_substatuses(const GaimSavedStatus *saved_status);
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
309
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
310 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
311 * Get the substatus for an account in a saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
312 *
12245
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
313 * @param saved_status The saved status.
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
314 * @param account The account.
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
315 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
316 * @return The GaimSavedStatusSub for the account, or NULL if
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
317 * the given account does not have a substatus that
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
318 * differs from the default status of this GaimSavedStatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
319 */
12080
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
320 GaimSavedStatusSub *gaim_savedstatus_get_substatus(
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
321 const GaimSavedStatus *saved_status,
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
322 const GaimAccount *account);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
323
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
324 /**
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
325 * Get the status type of a given substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
326 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
327 * @param substatus The substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
328 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
329 * @return The status type.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
330 */
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
331 const GaimStatusType *gaim_savedstatus_substatus_get_type(const GaimSavedStatusSub *substatus);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
332
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
333 /**
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
334 * Get the message of a given substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
335 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
336 * @param substatus The substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
337 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
338 * @return The message of the substatus, or NULL if this substatus does
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
339 * not have a message.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
340 */
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
341 const char *gaim_savedstatus_substatus_get_message(const GaimSavedStatusSub *substatus);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
342
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
343 /**
11724
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
344 * Sets the statuses for all your accounts to those specified
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
345 * by the given saved_status. This function calls
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
346 * gaim_savedstatus_activate_for_account() for all your accounts.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
347 *
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
348 * @param saved_status The status you want to set your accounts to.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
349 */
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
350 void gaim_savedstatus_activate(GaimSavedStatus *saved_status);
11724
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
351
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
352 /**
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
353 * Sets the statuses for a given account to those specified
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
354 * by the given saved_status.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
355 *
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
356 * @param saved_status The status you want to set your accounts to.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
357 * @param account The account whose statuses you want to change.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
358 */
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
359 void gaim_savedstatus_activate_for_account(const GaimSavedStatus *saved_status, GaimAccount *account);
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
360
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
361 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
362 * Get the handle for the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
363 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
364 * @return the handle to the status subsystem
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
365 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
366 void *gaim_savedstatuses_get_handle(void);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
367
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
368 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
369 * Initializes the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
370 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
371 void gaim_savedstatuses_init(void);
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
372
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
373 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
374 * Uninitializes the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
375 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
376 void gaim_savedstatuses_uninit(void);
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
377
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
378 /*@}*/
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
379
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
380 #endif /* _GAIM_SAVEDSTATUSES_H_ */