Sun, 26 Dec 2004 02:03:14 +0000
[gaim-migrate @ 11670]
Added some GaimStatusPrimitive<-->text mapping functions
Renamed the GaimStatusSaved data types to GaimSavedStatus
Modifying a status will now bring up an editor thing with the
correct values set
| 10418 | 1 | /** |
| 2 | * @file savedstatuses.h Saved Status API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 25 | #ifndef _GAIM_SAVEDSTATUSES_H_ | |
| 26 | #define _GAIM_SAVEDSTATUSES_H_ | |
| 27 | ||
| 28 | /** | |
| 29 | * Saved statuses don't really interact much with the rest of Gaim. It | |
| 30 | * could really be a plugin. It's just a list of away states. When | |
| 31 | * a user chooses one of the saved states, their Gaim accounts are set | |
| 32 | * to the settings of that state. | |
| 33 | */ | |
| 34 | ||
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
35 | typedef struct _GaimSavedStatus GaimSavedStatus; |
|
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
36 | typedef struct _GaimSavedStatusSub GaimSavedStatusSub; |
| 10418 | 37 | |
| 38 | /**************************************************************************/ | |
| 39 | /** @name Saved status subsystem */ | |
| 40 | /**************************************************************************/ | |
| 41 | /*@{*/ | |
| 42 | ||
| 43 | /** | |
| 44 | * Create a new saved status. This will add the saved status to the | |
| 45 | * list of saved statuses and writes the revised list to status.xml. | |
| 46 | * | |
| 47 | * @param title The title of the saved status. This must be unique. | |
| 48 | * @param type The type of saved status. | |
| 49 | * | |
| 50 | * @return The newly created saved status. | |
| 51 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
52 | GaimSavedStatus *gaim_savedstatus_new(const char *title, |
|
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
53 | GaimStatusPrimitive type); |
| 10418 | 54 | |
| 55 | /** | |
| 56 | * Delete a saved status. This removes the saved status from the list | |
| 57 | * of saved statuses, and writes the revised list to status.xml. | |
| 58 | * | |
| 59 | * @param title The title of the saved status. | |
| 60 | * | |
| 61 | * @return TRUE if the status was successfully deleted. FALSE if the | |
| 62 | * status could not be deleted because no saved status exists | |
| 63 | * with the given title. | |
| 64 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
65 | gboolean gaim_savedstatus_delete(const char *title); |
| 10418 | 66 | |
| 67 | /** | |
| 68 | * Returns all saved statuses. | |
| 69 | * | |
| 70 | * @return A list of saved statuses. | |
| 71 | */ | |
| 72 | const GList *gaim_savedstatuses_get_all(void); | |
| 73 | ||
| 74 | /** | |
| 75 | * Finds a saved status with the specified title. | |
| 76 | * | |
| 77 | * @param title The name of the saved status. | |
| 78 | * | |
| 79 | * @return The saved status if found, or NULL. | |
| 80 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
81 | GaimSavedStatus *gaim_savedstatus_find(const char *title); |
| 10418 | 82 | |
| 83 | /** | |
| 84 | * Return the name of a given saved status. | |
| 85 | * | |
| 86 | * @param saved_status The saved status. | |
| 87 | * | |
| 88 | * @return The title. | |
| 89 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
90 | const char *gaim_savedstatus_get_title(const GaimSavedStatus *saved_status); |
| 10418 | 91 | |
| 92 | /** | |
| 93 | * Return the name of a given saved status. | |
| 94 | * | |
| 95 | * @param saved_status The saved status. | |
| 96 | * | |
| 97 | * @return The name. | |
| 98 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
99 | GaimStatusPrimitive gaim_savedstatus_get_type(const GaimSavedStatus *saved_status); |
| 10418 | 100 | |
| 101 | /** | |
| 102 | * Return the name of a given saved status. | |
| 103 | * | |
| 104 | * @param saved_status The saved status. | |
| 105 | * | |
| 106 | * @return The name. | |
| 107 | */ | |
|
10419
cb6b7316fdba
[gaim-migrate @ 11670]
Mark Doliner <markdoliner@pidgin.im>
parents:
10418
diff
changeset
|
108 | const char *gaim_savedstatus_get_message(const GaimSavedStatus *saved_status); |
| 10418 | 109 | |
| 110 | /** | |
| 111 | * Get the handle for the status subsystem. | |
| 112 | * | |
| 113 | * @return the handle to the status subsystem | |
| 114 | */ | |
| 115 | void *gaim_savedstatuses_get_handle(); | |
| 116 | ||
| 117 | /** | |
| 118 | * Initializes the status subsystem. | |
| 119 | */ | |
| 120 | void gaim_savedstatuses_init(void); | |
| 121 | ||
| 122 | /** | |
| 123 | * Uninitializes the status subsystem. | |
| 124 | */ | |
| 125 | void gaim_savedstatuses_uninit(void); | |
| 126 | ||
| 127 | /*@}*/ | |
| 128 | ||
| 129 | #endif /* _GAIM_SAVEDSTATUSES_H_ */ |