savedstatuses.h

Go to the documentation of this file.
00001 
00007 /* purple
00008  *
00009  * Purple is the legal property of its developers, whose names are too numerous
00010  * to list here.  Please refer to the COPYRIGHT file distributed with this
00011  * source distribution.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00026  */
00027 #ifndef _PURPLE_SAVEDSTATUSES_H_
00028 #define _PURPLE_SAVEDSTATUSES_H_
00029 
00052 /*
00053  * TODO: Hmm.  We should probably just be saving PurplePresences.  That's
00054  *       something we should look into once the status box gets fleshed
00055  *       out more.
00056  */
00057 
00058 typedef struct _PurpleSavedStatus     PurpleSavedStatus;
00059 typedef struct _PurpleSavedStatusSub  PurpleSavedStatusSub;
00060 
00061 #include "status.h"
00062 
00063 #ifdef __cplusplus
00064 extern "C" {
00065 #endif
00066 
00067 /**************************************************************************/
00069 /**************************************************************************/
00084 PurpleSavedStatus *purple_savedstatus_new(const char *title,
00085                                       PurpleStatusPrimitive type);
00086 
00093 void purple_savedstatus_set_title(PurpleSavedStatus *status,
00094                                 const char *title);
00095 
00102 void purple_savedstatus_set_type(PurpleSavedStatus *status,
00103                                PurpleStatusPrimitive type);
00104 
00112 void purple_savedstatus_set_message(PurpleSavedStatus *status,
00113                                   const char *message);
00114 
00124 void purple_savedstatus_set_substatus(PurpleSavedStatus *status,
00125                                     const PurpleAccount *account,
00126                                     const PurpleStatusType *type,
00127                                     const char *message);
00128 
00138 void purple_savedstatus_unset_substatus(PurpleSavedStatus *saved_status,
00139                                                   const PurpleAccount *account);
00140 
00151 gboolean purple_savedstatus_delete(const char *title);
00152 
00161 void purple_savedstatus_delete_by_status(PurpleSavedStatus *saved_status);
00162 
00168 GList *purple_savedstatuses_get_all(void);
00169 
00184 GList *purple_savedstatuses_get_popular(unsigned int how_many);
00185 
00194 PurpleSavedStatus *purple_savedstatus_get_current(void);
00195 
00203 PurpleSavedStatus *purple_savedstatus_get_default(void);
00204 
00212 PurpleSavedStatus *purple_savedstatus_get_idleaway(void);
00213 
00220 gboolean purple_savedstatus_is_idleaway(void);
00221 
00229 void purple_savedstatus_set_idleaway(gboolean idleaway);
00230 
00237 PurpleSavedStatus *purple_savedstatus_get_startup(void);
00238 
00246 PurpleSavedStatus *purple_savedstatus_find(const char *title);
00247 
00256 PurpleSavedStatus *purple_savedstatus_find_by_creation_time(time_t creation_time);
00257 
00268 PurpleSavedStatus *purple_savedstatus_find_transient_by_type_and_message(PurpleStatusPrimitive type, const char *message);
00269 
00287 gboolean purple_savedstatus_is_transient(const PurpleSavedStatus *saved_status);
00288 
00299 const char *purple_savedstatus_get_title(const PurpleSavedStatus *saved_status);
00300 
00308 PurpleStatusPrimitive purple_savedstatus_get_type(const PurpleSavedStatus *saved_status);
00309 
00320 const char *purple_savedstatus_get_message(const PurpleSavedStatus *saved_status);
00321 
00337 time_t purple_savedstatus_get_creation_time(const PurpleSavedStatus *saved_status);
00338 
00349 gboolean purple_savedstatus_has_substatuses(const PurpleSavedStatus *saved_status);
00350 
00361 PurpleSavedStatusSub *purple_savedstatus_get_substatus(
00362                                     const PurpleSavedStatus *saved_status,
00363                                     const PurpleAccount *account);
00364 
00372 const PurpleStatusType *purple_savedstatus_substatus_get_type(const PurpleSavedStatusSub *substatus);
00373 
00382 const char *purple_savedstatus_substatus_get_message(const PurpleSavedStatusSub *substatus);
00383 
00391 void purple_savedstatus_activate(PurpleSavedStatus *saved_status);
00392 
00400 void purple_savedstatus_activate_for_account(const PurpleSavedStatus *saved_status, PurpleAccount *account);
00401 
00407 void *purple_savedstatuses_get_handle(void);
00408 
00412 void purple_savedstatuses_init(void);
00413 
00417 void purple_savedstatuses_uninit(void);
00418 
00421 #ifdef __cplusplus
00422 }
00423 #endif
00424 
00425 #endif /* _PURPLE_SAVEDSTATUSES_H_ */