savedstatuses.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  *
00026  * @see @ref savedstatus-signals
00027  */
00028 #ifndef _PURPLE_SAVEDSTATUSES_H_
00029 #define _PURPLE_SAVEDSTATUSES_H_
00030 
00053 /*
00054  * TODO: Hmm.  We should probably just be saving PurplePresences.  That's
00055  *       something we should look into once the status box gets fleshed
00056  *       out more.
00057  */
00058 
00059 typedef struct _PurpleSavedStatus     PurpleSavedStatus;
00060 typedef struct _PurpleSavedStatusSub  PurpleSavedStatusSub;
00061 
00062 #include "status.h"
00063 
00064 #ifdef __cplusplus
00065 extern "C" {
00066 #endif
00067 
00068 /**************************************************************************/
00070 /**************************************************************************/
00085 PurpleSavedStatus *purple_savedstatus_new(const char *title,
00086                                       PurpleStatusPrimitive type);
00087 
00094 void purple_savedstatus_set_title(PurpleSavedStatus *status,
00095                                 const char *title);
00096 
00103 void purple_savedstatus_set_type(PurpleSavedStatus *status,
00104                                PurpleStatusPrimitive type);
00105 
00113 void purple_savedstatus_set_message(PurpleSavedStatus *status,
00114                                   const char *message);
00115 
00125 void purple_savedstatus_set_substatus(PurpleSavedStatus *status,
00126                                     const PurpleAccount *account,
00127                                     const PurpleStatusType *type,
00128                                     const char *message);
00129 
00139 void purple_savedstatus_unset_substatus(PurpleSavedStatus *saved_status,
00140                                                   const PurpleAccount *account);
00141 
00152 gboolean purple_savedstatus_delete(const char *title);
00153 
00162 void purple_savedstatus_delete_by_status(PurpleSavedStatus *saved_status);
00163 
00169 GList *purple_savedstatuses_get_all(void);
00170 
00188 GList *purple_savedstatuses_get_popular(unsigned int how_many);
00189 
00198 PurpleSavedStatus *purple_savedstatus_get_current(void);
00199 
00207 PurpleSavedStatus *purple_savedstatus_get_default(void);
00208 
00216 PurpleSavedStatus *purple_savedstatus_get_idleaway(void);
00217 
00224 gboolean purple_savedstatus_is_idleaway(void);
00225 
00233 void purple_savedstatus_set_idleaway(gboolean idleaway);
00234 
00241 PurpleSavedStatus *purple_savedstatus_get_startup(void);
00242 
00250 PurpleSavedStatus *purple_savedstatus_find(const char *title);
00251 
00260 PurpleSavedStatus *purple_savedstatus_find_by_creation_time(time_t creation_time);
00261 
00272 PurpleSavedStatus *purple_savedstatus_find_transient_by_type_and_message(PurpleStatusPrimitive type, const char *message);
00273 
00291 gboolean purple_savedstatus_is_transient(const PurpleSavedStatus *saved_status);
00292 
00303 const char *purple_savedstatus_get_title(const PurpleSavedStatus *saved_status);
00304 
00312 PurpleStatusPrimitive purple_savedstatus_get_type(const PurpleSavedStatus *saved_status);
00313 
00324 const char *purple_savedstatus_get_message(const PurpleSavedStatus *saved_status);
00325 
00341 time_t purple_savedstatus_get_creation_time(const PurpleSavedStatus *saved_status);
00342 
00353 gboolean purple_savedstatus_has_substatuses(const PurpleSavedStatus *saved_status);
00354 
00365 PurpleSavedStatusSub *purple_savedstatus_get_substatus(
00366                                     const PurpleSavedStatus *saved_status,
00367                                     const PurpleAccount *account);
00368 
00376 const PurpleStatusType *purple_savedstatus_substatus_get_type(const PurpleSavedStatusSub *substatus);
00377 
00386 const char *purple_savedstatus_substatus_get_message(const PurpleSavedStatusSub *substatus);
00387 
00395 void purple_savedstatus_activate(PurpleSavedStatus *saved_status);
00396 
00404 void purple_savedstatus_activate_for_account(const PurpleSavedStatus *saved_status, PurpleAccount *account);
00405 
00411 void *purple_savedstatuses_get_handle(void);
00412 
00416 void purple_savedstatuses_init(void);
00417 
00421 void purple_savedstatuses_uninit(void);
00422 
00425 #ifdef __cplusplus
00426 }
00427 #endif
00428 
00429 #endif /* _PURPLE_SAVEDSTATUSES_H_ */