savedstatuses.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_SAVEDSTATUSES_H_
#define _PURPLE_SAVEDSTATUSES_H_
/*
* TODO: Hmm. We should probably just be saving PurplePresences. That's
* something we should look into once the status box gets fleshed
* out more.
*/
typedef struct _PurpleSavedStatus PurpleSavedStatus;
typedef struct _PurpleSavedStatusSub PurpleSavedStatusSub;
#include "status.h"
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
PurpleSavedStatus *purple_savedstatus_new(const char *title,
PurpleStatusPrimitive type);
void purple_savedstatus_set_title(PurpleSavedStatus *status,
const char *title);
void purple_savedstatus_set_type(PurpleSavedStatus *status,
PurpleStatusPrimitive type);
void purple_savedstatus_set_message(PurpleSavedStatus *status,
const char *message);
void purple_savedstatus_set_substatus(PurpleSavedStatus *status,
const PurpleAccount *account,
const PurpleStatusType *type,
const char *message);
void purple_savedstatus_unset_substatus(PurpleSavedStatus *saved_status,
const PurpleAccount *account);
gboolean purple_savedstatus_delete(const char *title);
void purple_savedstatus_delete_by_status(PurpleSavedStatus *saved_status);
GList *purple_savedstatuses_get_all(void);
GList *purple_savedstatuses_get_popular(unsigned int how_many);
PurpleSavedStatus *purple_savedstatus_get_current(void);
PurpleSavedStatus *purple_savedstatus_get_default(void);
PurpleSavedStatus *purple_savedstatus_get_idleaway(void);
gboolean purple_savedstatus_is_idleaway(void);
void purple_savedstatus_set_idleaway(gboolean idleaway);
PurpleSavedStatus *purple_savedstatus_get_startup(void);
PurpleSavedStatus *purple_savedstatus_find(const char *title);
PurpleSavedStatus *purple_savedstatus_find_by_creation_time(time_t creation_time);
PurpleSavedStatus *purple_savedstatus_find_transient_by_type_and_message(PurpleStatusPrimitive type, const char *message);
gboolean purple_savedstatus_is_transient(const PurpleSavedStatus *saved_status);
const char *purple_savedstatus_get_title(const PurpleSavedStatus *saved_status);
PurpleStatusPrimitive purple_savedstatus_get_type(const PurpleSavedStatus *saved_status);
const char *purple_savedstatus_get_message(const PurpleSavedStatus *saved_status);
time_t purple_savedstatus_get_creation_time(const PurpleSavedStatus *saved_status);
gboolean purple_savedstatus_has_substatuses(const PurpleSavedStatus *saved_status);
PurpleSavedStatusSub *purple_savedstatus_get_substatus(
const PurpleSavedStatus *saved_status,
const PurpleAccount *account);
const PurpleStatusType *purple_savedstatus_substatus_get_type(const PurpleSavedStatusSub *substatus);
const char *purple_savedstatus_substatus_get_message(const PurpleSavedStatusSub *substatus);
void purple_savedstatus_activate(PurpleSavedStatus *saved_status);
void purple_savedstatus_activate_for_account(const PurpleSavedStatus *saved_status, PurpleAccount *account);
void *purple_savedstatuses_get_handle(void);
void purple_savedstatuses_init(void);
void purple_savedstatuses_uninit(void);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_SAVEDSTATUSES_H_ */
purple_savedstatuses_get_popular
GList * purple_savedstatuses_get_popular(unsigned int how_many)
Returns the n most popular saved statuses.
purple_savedstatus_get_type
PurpleStatusPrimitive purple_savedstatus_get_type(const PurpleSavedStatus *saved_status)
Return the type of a given saved status.
PurpleStatusPrimitive
PurpleStatusPrimitive
A primitive defining the basic structure of a status type.
Definition: status.h:117
purple_savedstatus_get_default
PurpleSavedStatus * purple_savedstatus_get_default(void)
Returns the default saved status that is used when our accounts are not idle-away.
purple_savedstatus_set_substatus
void purple_savedstatus_set_substatus(PurpleSavedStatus *status, const PurpleAccount *account, const PurpleStatusType *type, const char *message)
Set a substatus for an account in a saved status.
purple_savedstatus_set_title
void purple_savedstatus_set_title(PurpleSavedStatus *status, const char *title)
Set the title for the given saved status.
purple_savedstatuses_init
void purple_savedstatuses_init(void)
Initializes the status subsystem.
purple_savedstatus_new
PurpleSavedStatus * purple_savedstatus_new(const char *title, PurpleStatusPrimitive type)
Create a new saved status.
purple_savedstatus_has_substatuses
gboolean purple_savedstatus_has_substatuses(const PurpleSavedStatus *saved_status)
Determine if a given saved status has "substatuses," or if it is a simple status (the same for all ac...
purple_savedstatuses_get_all
GList * purple_savedstatuses_get_all(void)
Returns all saved statuses.
_PurpleAccount
Structure representing an account.
Definition: account.h:126
purple_savedstatus_is_idleaway
gboolean purple_savedstatus_is_idleaway(void)
Return TRUE if we are currently idle-away.
purple_savedstatus_set_message
void purple_savedstatus_set_message(PurpleSavedStatus *status, const char *message)
Set the message for the given saved status.
purple_savedstatus_activate_for_account
void purple_savedstatus_activate_for_account(const PurpleSavedStatus *saved_status, PurpleAccount *account)
Sets the statuses for a given account to those specified by the given saved_status.
purple_savedstatus_get_current
PurpleSavedStatus * purple_savedstatus_get_current(void)
Returns the currently selected saved status.
purple_savedstatus_find
PurpleSavedStatus * purple_savedstatus_find(const char *title)
Finds a saved status with the specified title.
purple_savedstatus_find_transient_by_type_and_message
PurpleSavedStatus * purple_savedstatus_find_transient_by_type_and_message(PurpleStatusPrimitive type, const char *message)
Finds a saved status with the specified primitive and message.
PurpleSavedStatus
struct _PurpleSavedStatus PurpleSavedStatus
Saved statuses don&#39;t really interact much with the rest of Purple.
Definition: savedstatuses.h:58
purple_savedstatus_substatus_get_message
const char * purple_savedstatus_substatus_get_message(const PurpleSavedStatusSub *substatus)
Get the message of a given substatus.
purple_savedstatus_get_startup
PurpleSavedStatus * purple_savedstatus_get_startup(void)
Returns the status to be used when purple is starting up.
purple_savedstatuses_uninit
void purple_savedstatuses_uninit(void)
Uninitializes the status subsystem.
purple_savedstatus_activate
void purple_savedstatus_activate(PurpleSavedStatus *saved_status)
Sets the statuses for all your accounts to those specified by the given saved_status.
purple_savedstatus_get_substatus
PurpleSavedStatusSub * purple_savedstatus_get_substatus(const PurpleSavedStatus *saved_status, const PurpleAccount *account)
Get the substatus for an account in a saved status.
purple_savedstatus_get_message
const char * purple_savedstatus_get_message(const PurpleSavedStatus *saved_status)
Return the default message of a given saved status.
status.h
Status APIA brief explanation of the status API:
purple_savedstatus_delete_by_status
void purple_savedstatus_delete_by_status(PurpleSavedStatus *saved_status)
Delete a saved status.
purple_savedstatus_get_idleaway
PurpleSavedStatus * purple_savedstatus_get_idleaway(void)
Returns the saved status that is used when your accounts become idle-away.
purple_savedstatus_delete
gboolean purple_savedstatus_delete(const char *title)
Delete a saved status.
purple_savedstatus_unset_substatus
void purple_savedstatus_unset_substatus(PurpleSavedStatus *saved_status, const PurpleAccount *account)
Unset a substatus for an account in a saved status.
purple_savedstatus_set_type
void purple_savedstatus_set_type(PurpleSavedStatus *status, PurpleStatusPrimitive type)
Set the type for the given saved status.
purple_savedstatuses_get_handle
void * purple_savedstatuses_get_handle(void)
Get the handle for the status subsystem.
purple_savedstatus_is_transient
gboolean purple_savedstatus_is_transient(const PurpleSavedStatus *saved_status)
Determines if a given saved status is "transient." A transient saved status is one that was not expli...
purple_savedstatus_set_idleaway
void purple_savedstatus_set_idleaway(gboolean idleaway)
Set whether accounts in Purple are idle-away or not.
purple_savedstatus_find_by_creation_time
PurpleSavedStatus * purple_savedstatus_find_by_creation_time(time_t creation_time)
Finds a saved status with the specified creation time.
purple_savedstatus_substatus_get_type
const PurpleStatusType * purple_savedstatus_substatus_get_type(const PurpleSavedStatusSub *substatus)
Get the status type of a given substatus.
PurpleStatusType
struct _PurpleStatusType PurpleStatusType
PurpleStatusType&#39;s are created by each PRPL.
Definition: status.h:85
purple_savedstatus_get_title
const char * purple_savedstatus_get_title(const PurpleSavedStatus *saved_status)
Return the name of a given saved status.
purple_savedstatus_get_creation_time
time_t purple_savedstatus_get_creation_time(const PurpleSavedStatus *saved_status)
Return the time in seconds-since-the-epoch when this saved status was created.