annotate src/savedstatuses.h @ 14165:b04e36dae7af

[gaim-migrate @ 16815] If g_open isn't a macro, we need to specify the mode variable committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 17 Aug 2006 14:07:20 +0000
parents a8a033a89ee0
children
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 /**
14128
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
174 * Returns the currently selected saved status. If we are idle
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
175 * then this returns gaim_savedstatus_get_idleaway(). Otherwise
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
176 * it returns gaim_savedstatus_get_default().
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
177 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
178 * @return A pointer to the in-use GaimSavedStatus.
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
179 * This function never returns NULL.
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
180 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
181 GaimSavedStatus *gaim_savedstatus_get_current(void);
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
182
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
183 /**
14128
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
184 * Returns the default saved status that is used when our
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
185 * accounts are not idle-away.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
186 *
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
187 * @return A pointer to the in-use GaimSavedStatus.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
188 * This function never returns NULL.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
189 */
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
190 GaimSavedStatus *gaim_savedstatus_get_default(void);
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
191
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
192 /**
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
193 * Returns the saved status that is used when your
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
194 * accounts become idle-away.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
195 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
196 * @return A pointer to the idle-away GaimSavedStatus.
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
197 * This function never returns NULL.
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
198 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
199 GaimSavedStatus *gaim_savedstatus_get_idleaway(void);
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
200
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
201 /**
14128
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
202 * Return TRUE if we are currently idle-away. Otherwise
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
203 * returns FALSE.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
204 *
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
205 * @return TRUE if our accounts have been set to idle-away.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
206 */
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
207 gboolean gaim_savedstatus_is_idleaway(void);
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
208
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
209 /**
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
210 * Set whether accounts in Gaim are idle-away or not.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
211 *
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
212 * @param TRUE if accounts should be switched to use the
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
213 * idle-away saved status. FALSE if they should
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
214 * be switched to use the default status.
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
215 */
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
216 void gaim_savedstatus_set_idleaway(gboolean idleaway);
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
217
a8a033a89ee0 [gaim-migrate @ 16766]
Mark Doliner <mark@kingant.net>
parents: 13681
diff changeset
218 /**
13681
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
219 * Returns the status to be used when gaim is starting up
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
220 *
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
221 * @return A pointer to the startup GaimSavedStatus.
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
222 * This function never returns NULL.
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
223 */
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
224 GaimSavedStatus *gaim_savedstatus_get_startup(void);
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
225
c4be649e2aca [gaim-migrate @ 16084]
Mark Doliner <mark@kingant.net>
parents: 13675
diff changeset
226 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
227 * Finds a saved status with the specified title.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
228 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
229 * @param title The name of the saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
230 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
231 * @return The saved status if found, or NULL.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
232 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
233 GaimSavedStatus *gaim_savedstatus_find(const char *title);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
234
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
235 /**
12690
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
236 * Finds a saved status with the specified creation time.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
237 *
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
238 * @param creation_time The timestamp when the saved
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
239 * status was created.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
240 *
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
241 * @return The saved status if found, or NULL.
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
242 */
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
243 GaimSavedStatus *gaim_savedstatus_find_by_creation_time(time_t creation_time);
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
244
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
245 /**
13012
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
246 * Finds a saved status with the specified primitive and message.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
247 *
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
248 * @param type The GaimStatusPrimitive for the status you're trying
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
249 * to find.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
250 * @param message The message for the status you're trying
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
251 * to find.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
252 *
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
253 * @return The saved status if found, or NULL.
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
254 */
13244
c97c76d9d347 [gaim-migrate @ 15610]
Mark Doliner <mark@kingant.net>
parents: 13121
diff changeset
255 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
256
e3b9c6c7bcf6 [gaim-migrate @ 15365]
Mark Doliner <mark@kingant.net>
parents: 12857
diff changeset
257 /**
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
258 * Determines if a given saved status is "transient."
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
259 * A transient saved status is one that was not
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
260 * explicitly added by the user. Transient statuses
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
261 * are automatically removed if they are not used
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
262 * for a period of time.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
263 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
264 * A transient saved statuses is automatically
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
265 * created by the status box when the user sets himself
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
266 * to one of the generic primitive statuses. The reason
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
267 * we need to save this status information is so we can
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
268 * restore it when Gaim restarts.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
269 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
270 * @param saved_status The saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
271 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
272 * @return TRUE if the saved status is transient.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
273 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
274 gboolean gaim_savedstatus_is_transient(const GaimSavedStatus *saved_status);
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
275
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
276 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
277 * Return the name of a given saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
278 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
279 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
280 *
12690
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
281 * @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
282 * be overwritten on subsequent calls to this function. If
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
283 * you need a reference to the title for prolonged use then
d03afaccd41c [gaim-migrate @ 15033]
Mark Doliner <mark@kingant.net>
parents: 12688
diff changeset
284 * you should make a copy of it.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
285 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
286 const char *gaim_savedstatus_get_title(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
287
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
288 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
289 * Return the type of a given saved status.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
290 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
291 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
292 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
293 * @return The name.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
294 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
295 GaimStatusPrimitive gaim_savedstatus_get_type(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
296
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
297 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
298 * Return the default message of a given saved status.
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
299 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
300 * @param saved_status The saved status.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
301 *
13121
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
302 * @return The message. This will return NULL if the saved
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
303 * status does not have a message. This will
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
304 * contain the normal markup that is created by
e2a94ab60a7e [gaim-migrate @ 15483]
Mark Doliner <mark@kingant.net>
parents: 13012
diff changeset
305 * Gaim's IMHTML (basically HTML markup).
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
306 */
10419
c9b1f3fac753 [gaim-migrate @ 11670]
Mark Doliner <mark@kingant.net>
parents: 10418
diff changeset
307 const char *gaim_savedstatus_get_message(const GaimSavedStatus *saved_status);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
308
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
309 /**
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
310 * Return the time in seconds-since-the-epoch when this
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
311 * saved status was created. Note: For any status created
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
312 * 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
313 * 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
314 * and older did not record the timestamp when the status
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
315 * was created.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
316 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
317 * However, this value is guaranteed to be a unique
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
318 * identifier for the given saved status.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
319 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
320 * @param saved_status The saved status.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
321 *
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
322 * @return The timestamp when this saved status was created.
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
323 */
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
324 time_t gaim_savedstatus_get_creation_time(const GaimSavedStatus *saved_status);
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
325
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
326 /**
11651
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
327 * Determine if a given saved status has "substatuses,"
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
328 * or if it is a simple status (the same for all
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
329 * accounts).
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
330 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
331 * @param saved_status The saved status.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
332 *
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
333 * @return TRUE if the saved_status has substatuses.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
334 * FALSE otherwise.
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
335 */
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
336 gboolean gaim_savedstatus_has_substatuses(const GaimSavedStatus *saved_status);
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
337
723487d07aa0 [gaim-migrate @ 13935]
Mark Doliner <mark@kingant.net>
parents: 10447
diff changeset
338 /**
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
339 * Get the substatus for an account in a saved status.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
340 *
12245
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
341 * @param saved_status The saved status.
465ddcb3e9e8 [gaim-migrate @ 14547]
Mark Doliner <mark@kingant.net>
parents: 12125
diff changeset
342 * @param account The account.
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
343 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
344 * @return The GaimSavedStatusSub for the account, or NULL if
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
345 * the given account does not have a substatus that
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
346 * differs from the default status of this GaimSavedStatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
347 */
12080
3b52d94437f3 [gaim-migrate @ 14377]
Mark Doliner <mark@kingant.net>
parents: 12056
diff changeset
348 GaimSavedStatusSub *gaim_savedstatus_get_substatus(
12056
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
349 const GaimSavedStatus *saved_status,
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
350 const GaimAccount *account);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
351
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
352 /**
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
353 * Get the status type of a given substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
354 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
355 * @param substatus The substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
356 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
357 * @return The status type.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
358 */
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
359 const GaimStatusType *gaim_savedstatus_substatus_get_type(const GaimSavedStatusSub *substatus);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
360
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
361 /**
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
362 * Get the message of a given substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
363 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
364 * @param substatus The substatus.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
365 *
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
366 * @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
367 * not have a message.
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
368 */
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
369 const char *gaim_savedstatus_substatus_get_message(const GaimSavedStatusSub *substatus);
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
370
6dc48f991b8d [gaim-migrate @ 14351]
Mark Doliner <mark@kingant.net>
parents: 11724
diff changeset
371 /**
11724
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
372 * Sets the statuses for all your accounts to those specified
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
373 * by the given saved_status. This function calls
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
374 * gaim_savedstatus_activate_for_account() for all your accounts.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
375 *
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
376 * @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
377 */
12125
3c1bac709234 [gaim-migrate @ 14425]
Mark Doliner <mark@kingant.net>
parents: 12080
diff changeset
378 void gaim_savedstatus_activate(GaimSavedStatus *saved_status);
11724
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
379
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
380 /**
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
381 * Sets the statuses for a given account to those specified
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
382 * by the given saved_status.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
383 *
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
384 * @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
385 * @param account The account whose statuses you want to change.
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
386 */
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
387 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
388
a8ec0a291d14 [gaim-migrate @ 14015]
Mark Doliner <mark@kingant.net>
parents: 11651
diff changeset
389 /**
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
390 * Get the handle for the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
391 *
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
392 * @return the handle to the status subsystem
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
393 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 12245
diff changeset
394 void *gaim_savedstatuses_get_handle(void);
10418
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
395
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
396 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
397 * Initializes the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
398 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
399 void gaim_savedstatuses_init(void);
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
400
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
401 /**
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
402 * Uninitializes the status subsystem.
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
403 */
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
404 void gaim_savedstatuses_uninit(void);
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
405
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
406 /*@}*/
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
407
bed2c96bc1fb [gaim-migrate @ 11669]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
408 #endif /* _GAIM_SAVEDSTATUSES_H_ */