Frameworks/libpurple.framework/Versions/0.6.2/Headers/privacy.h
changeset 2592 e8d15275025e
parent 2539 2c9881ea8cdf
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/privacy.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,194 @@
     1.4 +/**
     1.5 + * @file privacy.h Privacy API
     1.6 + * @ingroup core
     1.7 + */
     1.8 +
     1.9 +/* purple
    1.10 + *
    1.11 + * Purple is the legal property of its developers, whose names are too numerous
    1.12 + * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.13 + * source distribution.
    1.14 + *
    1.15 + * This program is free software; you can redistribute it and/or modify
    1.16 + * it under the terms of the GNU General Public License as published by
    1.17 + * the Free Software Foundation; either version 2 of the License, or
    1.18 + * (at your option) any later version.
    1.19 + *
    1.20 + * This program is distributed in the hope that it will be useful,
    1.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.23 + * GNU General Public License for more details.
    1.24 + *
    1.25 + * You should have received a copy of the GNU General Public License
    1.26 + * along with this program; if not, write to the Free Software
    1.27 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.28 + */
    1.29 +#ifndef _PURPLE_PRIVACY_H_
    1.30 +#define _PURPLE_PRIVACY_H_
    1.31 +
    1.32 +/**
    1.33 + * Privacy data types.
    1.34 + */
    1.35 +typedef enum _PurplePrivacyType
    1.36 +{
    1.37 +	PURPLE_PRIVACY_ALLOW_ALL = 1,
    1.38 +	PURPLE_PRIVACY_DENY_ALL,
    1.39 +	PURPLE_PRIVACY_ALLOW_USERS,
    1.40 +	PURPLE_PRIVACY_DENY_USERS,
    1.41 +	PURPLE_PRIVACY_ALLOW_BUDDYLIST
    1.42 +} PurplePrivacyType;
    1.43 +
    1.44 +#include "account.h"
    1.45 +
    1.46 +#ifdef __cplusplus
    1.47 +extern "C" {
    1.48 +#endif
    1.49 +
    1.50 +/**
    1.51 + * Privacy core/UI operations.
    1.52 + */
    1.53 +typedef struct
    1.54 +{
    1.55 +	void (*permit_added)(PurpleAccount *account, const char *name);
    1.56 +	void (*permit_removed)(PurpleAccount *account, const char *name);
    1.57 +	void (*deny_added)(PurpleAccount *account, const char *name);
    1.58 +	void (*deny_removed)(PurpleAccount *account, const char *name);
    1.59 +
    1.60 +	void (*_purple_reserved1)(void);
    1.61 +	void (*_purple_reserved2)(void);
    1.62 +	void (*_purple_reserved3)(void);
    1.63 +	void (*_purple_reserved4)(void);
    1.64 +} PurplePrivacyUiOps;
    1.65 +
    1.66 +/**
    1.67 + * Adds a user to the account's permit list.
    1.68 + *
    1.69 + * @param account    The account.
    1.70 + * @param name       The name of the user to add to the list.
    1.71 + * @param local_only If TRUE, only the local list is updated, and not
    1.72 + *                   the server.
    1.73 + *
    1.74 + * @return TRUE if the user was added successfully, or @c FALSE otherwise.
    1.75 + */
    1.76 +gboolean purple_privacy_permit_add(PurpleAccount *account, const char *name,
    1.77 +								 gboolean local_only);
    1.78 +
    1.79 +/**
    1.80 + * Removes a user from the account's permit list.
    1.81 + *
    1.82 + * @param account    The account.
    1.83 + * @param name       The name of the user to add to the list.
    1.84 + * @param local_only If TRUE, only the local list is updated, and not
    1.85 + *                   the server.
    1.86 + *
    1.87 + * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
    1.88 + */
    1.89 +gboolean purple_privacy_permit_remove(PurpleAccount *account, const char *name,
    1.90 +									gboolean local_only);
    1.91 +
    1.92 +/**
    1.93 + * Adds a user to the account's deny list.
    1.94 + *
    1.95 + * @param account    The account.
    1.96 + * @param name       The name of the user to add to the list.
    1.97 + * @param local_only If TRUE, only the local list is updated, and not
    1.98 + *                   the server.
    1.99 + *
   1.100 + * @return TRUE if the user was added successfully, or @c FALSE otherwise.
   1.101 + */
   1.102 +gboolean purple_privacy_deny_add(PurpleAccount *account, const char *name,
   1.103 +							   gboolean local_only);
   1.104 +
   1.105 +/**
   1.106 + * Removes a user from the account's deny list.
   1.107 + *
   1.108 + * @param account    The account.
   1.109 + * @param name       The name of the user to add to the list.
   1.110 + * @param local_only If TRUE, only the local list is updated, and not
   1.111 + *                   the server.
   1.112 + *
   1.113 + * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
   1.114 + */
   1.115 +gboolean purple_privacy_deny_remove(PurpleAccount *account, const char *name,
   1.116 +								  gboolean local_only);
   1.117 +
   1.118 +/**
   1.119 + * Allow a user to send messages. If current privacy setting for the account is:
   1.120 + *		PURPLE_PRIVACY_ALLOW_USERS:	The user is added to the allow-list.
   1.121 + *		PURPLE_PRIVACY_DENY_USERS	:	The user is removed from the deny-list.
   1.122 + *		PURPLE_PRIVACY_ALLOW_ALL	:	No changes made.
   1.123 + *		PURPLE_PRIVACY_DENY_ALL	:	The privacy setting is changed to
   1.124 + *									PURPLE_PRIVACY_ALLOW_USERS and the user
   1.125 + *									is added to the allow-list.
   1.126 + *		PURPLE_PRIVACY_ALLOW_BUDDYLIST: No changes made if the user is already in
   1.127 + *									the buddy-list. Otherwise the setting is
   1.128 + *									changed to PURPLE_PRIVACY_ALLOW_USERS, all the
   1.129 + *									buddies are added to the allow-list, and the
   1.130 + *									user is also added to the allow-list.
   1.131 + *
   1.132 + * @param account	The account.
   1.133 + * @param who		The name of the user.
   1.134 + * @param local		Whether the change is local-only.
   1.135 + * @param restore	Should the previous allow/deny list be restored if the
   1.136 + *					privacy setting is changed.
   1.137 + */
   1.138 +void purple_privacy_allow(PurpleAccount *account, const char *who, gboolean local,
   1.139 +						gboolean restore);
   1.140 +
   1.141 +/**
   1.142 + * Block messages from a user. If current privacy setting for the account is:
   1.143 + *		PURPLE_PRIVACY_ALLOW_USERS:	The user is removed from the allow-list.
   1.144 + *		PURPLE_PRIVACY_DENY_USERS	:	The user is added to the deny-list.
   1.145 + *		PURPLE_PRIVACY_DENY_ALL	:	No changes made.
   1.146 + *		PURPLE_PRIVACY_ALLOW_ALL	:	The privacy setting is changed to
   1.147 + *									PURPLE_PRIVACY_DENY_USERS and the user is
   1.148 + *									added to the deny-list.
   1.149 + *		PURPLE_PRIVACY_ALLOW_BUDDYLIST: If the user is not in the buddy-list,
   1.150 + *									then no changes made. Otherwise, the setting
   1.151 + *									is changed to PURPLE_PRIVACY_ALLOW_USERS, all
   1.152 + *									the buddies are added to the allow-list, and
   1.153 + *									this user is removed from the list.
   1.154 + *
   1.155 + * @param account	The account.
   1.156 + * @param who		The name of the user.
   1.157 + * @param local		Whether the change is local-only.
   1.158 + * @param restore	Should the previous allow/deny list be restored if the
   1.159 + *					privacy setting is changed.
   1.160 + */
   1.161 +void purple_privacy_deny(PurpleAccount *account, const char *who, gboolean local,
   1.162 +						gboolean restore);
   1.163 +
   1.164 +/**
   1.165 + * Check the privacy-setting for a user.
   1.166 + *
   1.167 + * @param account	The account.
   1.168 + * @param who		The name of the user.
   1.169 + *
   1.170 + * @return @c FALSE if the specified account's privacy settings block the user or @c TRUE otherwise. The meaning of "block" is protocol-dependent and generally relates to status and/or sending of messages.
   1.171 + */
   1.172 +gboolean purple_privacy_check(PurpleAccount *account, const char *who);
   1.173 +
   1.174 +/**
   1.175 + * Sets the UI operations structure for the privacy subsystem.
   1.176 + *
   1.177 + * @param ops The UI operations structure.
   1.178 + */
   1.179 +void purple_privacy_set_ui_ops(PurplePrivacyUiOps *ops);
   1.180 +
   1.181 +/**
   1.182 + * Returns the UI operations structure for the privacy subsystem.
   1.183 + *
   1.184 + * @return The UI operations structure.
   1.185 + */
   1.186 +PurplePrivacyUiOps *purple_privacy_get_ui_ops(void);
   1.187 +
   1.188 +/**
   1.189 + * Initializes the privacy subsystem.
   1.190 + */
   1.191 +void purple_privacy_init(void);
   1.192 +
   1.193 +#ifdef __cplusplus
   1.194 +}
   1.195 +#endif
   1.196 +
   1.197 +#endif /* _PURPLE_PRIVACY_H_ */