Mercurial > pidgin.yaz
comparison libpurple/privacy.h @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | 516f14bef90e |
comparison
equal
deleted
inserted
replaced
15822:84b0f9b23ede | 15823:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file privacy.h Privacy API | 2 * @file privacy.h Privacy API |
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * purple |
6 * | 6 * |
7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Purple 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 | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
9 * source distribution. | 9 * source distribution. |
10 * | 10 * |
11 * This program is free software; you can redistribute it and/or modify | 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 | 12 * it under the terms of the GNU General Public License as published by |
20 * | 20 * |
21 * You should have received a copy of the GNU General Public License | 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 | 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 | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 */ | 24 */ |
25 #ifndef _GAIM_PRIVACY_H_ | 25 #ifndef _PURPLE_PRIVACY_H_ |
26 #define _GAIM_PRIVACY_H_ | 26 #define _PURPLE_PRIVACY_H_ |
27 | 27 |
28 #include "account.h" | 28 #include "account.h" |
29 | 29 |
30 /** | 30 /** |
31 * Privacy data types. | 31 * Privacy data types. |
32 */ | 32 */ |
33 typedef enum _GaimPrivacyType | 33 typedef enum _PurplePrivacyType |
34 { | 34 { |
35 GAIM_PRIVACY_ALLOW_ALL = 1, | 35 PURPLE_PRIVACY_ALLOW_ALL = 1, |
36 GAIM_PRIVACY_DENY_ALL, | 36 PURPLE_PRIVACY_DENY_ALL, |
37 GAIM_PRIVACY_ALLOW_USERS, | 37 PURPLE_PRIVACY_ALLOW_USERS, |
38 GAIM_PRIVACY_DENY_USERS, | 38 PURPLE_PRIVACY_DENY_USERS, |
39 GAIM_PRIVACY_ALLOW_BUDDYLIST | 39 PURPLE_PRIVACY_ALLOW_BUDDYLIST |
40 } GaimPrivacyType; | 40 } PurplePrivacyType; |
41 | 41 |
42 #ifdef __cplusplus | 42 #ifdef __cplusplus |
43 extern "C" { | 43 extern "C" { |
44 #endif | 44 #endif |
45 | 45 |
46 /** | 46 /** |
47 * Privacy core/UI operations. | 47 * Privacy core/UI operations. |
48 */ | 48 */ |
49 typedef struct | 49 typedef struct |
50 { | 50 { |
51 void (*permit_added)(GaimAccount *account, const char *name); | 51 void (*permit_added)(PurpleAccount *account, const char *name); |
52 void (*permit_removed)(GaimAccount *account, const char *name); | 52 void (*permit_removed)(PurpleAccount *account, const char *name); |
53 void (*deny_added)(GaimAccount *account, const char *name); | 53 void (*deny_added)(PurpleAccount *account, const char *name); |
54 void (*deny_removed)(GaimAccount *account, const char *name); | 54 void (*deny_removed)(PurpleAccount *account, const char *name); |
55 | 55 |
56 } GaimPrivacyUiOps; | 56 } PurplePrivacyUiOps; |
57 | 57 |
58 /** | 58 /** |
59 * Adds a user to the account's permit list. | 59 * Adds a user to the account's permit list. |
60 * | 60 * |
61 * @param account The account. | 61 * @param account The account. |
63 * @param local_only If TRUE, only the local list is updated, and not | 63 * @param local_only If TRUE, only the local list is updated, and not |
64 * the server. | 64 * the server. |
65 * | 65 * |
66 * @return TRUE if the user was added successfully, or @c FALSE otherwise. | 66 * @return TRUE if the user was added successfully, or @c FALSE otherwise. |
67 */ | 67 */ |
68 gboolean gaim_privacy_permit_add(GaimAccount *account, const char *name, | 68 gboolean purple_privacy_permit_add(PurpleAccount *account, const char *name, |
69 gboolean local_only); | 69 gboolean local_only); |
70 | 70 |
71 /** | 71 /** |
72 * Removes a user from the account's permit list. | 72 * Removes a user from the account's permit list. |
73 * | 73 * |
76 * @param local_only If TRUE, only the local list is updated, and not | 76 * @param local_only If TRUE, only the local list is updated, and not |
77 * the server. | 77 * the server. |
78 * | 78 * |
79 * @return TRUE if the user was removed successfully, or @c FALSE otherwise. | 79 * @return TRUE if the user was removed successfully, or @c FALSE otherwise. |
80 */ | 80 */ |
81 gboolean gaim_privacy_permit_remove(GaimAccount *account, const char *name, | 81 gboolean purple_privacy_permit_remove(PurpleAccount *account, const char *name, |
82 gboolean local_only); | 82 gboolean local_only); |
83 | 83 |
84 /** | 84 /** |
85 * Adds a user to the account's deny list. | 85 * Adds a user to the account's deny list. |
86 * | 86 * |
89 * @param local_only If TRUE, only the local list is updated, and not | 89 * @param local_only If TRUE, only the local list is updated, and not |
90 * the server. | 90 * the server. |
91 * | 91 * |
92 * @return TRUE if the user was added successfully, or @c FALSE otherwise. | 92 * @return TRUE if the user was added successfully, or @c FALSE otherwise. |
93 */ | 93 */ |
94 gboolean gaim_privacy_deny_add(GaimAccount *account, const char *name, | 94 gboolean purple_privacy_deny_add(PurpleAccount *account, const char *name, |
95 gboolean local_only); | 95 gboolean local_only); |
96 | 96 |
97 /** | 97 /** |
98 * Removes a user from the account's deny list. | 98 * Removes a user from the account's deny list. |
99 * | 99 * |
102 * @param local_only If TRUE, only the local list is updated, and not | 102 * @param local_only If TRUE, only the local list is updated, and not |
103 * the server. | 103 * the server. |
104 * | 104 * |
105 * @return TRUE if the user was removed successfully, or @c FALSE otherwise. | 105 * @return TRUE if the user was removed successfully, or @c FALSE otherwise. |
106 */ | 106 */ |
107 gboolean gaim_privacy_deny_remove(GaimAccount *account, const char *name, | 107 gboolean purple_privacy_deny_remove(PurpleAccount *account, const char *name, |
108 gboolean local_only); | 108 gboolean local_only); |
109 | 109 |
110 /** | 110 /** |
111 * Allow a user to send messages. If current privacy setting for the account is: | 111 * Allow a user to send messages. If current privacy setting for the account is: |
112 * GAIM_PRIVACY_ALLOW_USERS: The user is added to the allow-list. | 112 * PURPLE_PRIVACY_ALLOW_USERS: The user is added to the allow-list. |
113 * GAIM_PRIVACY_DENY_USERS : The user is removed from the deny-list. | 113 * PURPLE_PRIVACY_DENY_USERS : The user is removed from the deny-list. |
114 * GAIM_PRIVACY_ALLOW_ALL : No changes made. | 114 * PURPLE_PRIVACY_ALLOW_ALL : No changes made. |
115 * GAIM_PRIVACY_DENY_ALL : The privacy setting is changed to | 115 * PURPLE_PRIVACY_DENY_ALL : The privacy setting is changed to |
116 * GAIM_PRIVACY_ALLOW_USERS and the user | 116 * PURPLE_PRIVACY_ALLOW_USERS and the user |
117 * is added to the allow-list. | 117 * is added to the allow-list. |
118 * GAIM_PRIVACY_ALLOW_BUDDYLIST: No changes made if the user is already in | 118 * PURPLE_PRIVACY_ALLOW_BUDDYLIST: No changes made if the user is already in |
119 * the buddy-list. Otherwise the setting is | 119 * the buddy-list. Otherwise the setting is |
120 * changed to GAIM_PRIVACY_ALLOW_USERS, all the | 120 * changed to PURPLE_PRIVACY_ALLOW_USERS, all the |
121 * buddies are added to the allow-list, and the | 121 * buddies are added to the allow-list, and the |
122 * user is also added to the allow-list. | 122 * user is also added to the allow-list. |
123 * | 123 * |
124 * @param account The account. | 124 * @param account The account. |
125 * @param who The name of the user. | 125 * @param who The name of the user. |
126 * @param local Whether the change is local-only. | 126 * @param local Whether the change is local-only. |
127 * @param restore Should the previous allow/deny list be restored if the | 127 * @param restore Should the previous allow/deny list be restored if the |
128 * privacy setting is changed. | 128 * privacy setting is changed. |
129 */ | 129 */ |
130 void gaim_privacy_allow(GaimAccount *account, const char *who, gboolean local, | 130 void purple_privacy_allow(PurpleAccount *account, const char *who, gboolean local, |
131 gboolean restore); | 131 gboolean restore); |
132 | 132 |
133 /** | 133 /** |
134 * Block messages from a user. If current privacy setting for the account is: | 134 * Block messages from a user. If current privacy setting for the account is: |
135 * GAIM_PRIVACY_ALLOW_USERS: The user is removed from the allow-list. | 135 * PURPLE_PRIVACY_ALLOW_USERS: The user is removed from the allow-list. |
136 * GAIM_PRIVACY_DENY_USERS : The user is added to the deny-list. | 136 * PURPLE_PRIVACY_DENY_USERS : The user is added to the deny-list. |
137 * GAIM_PRIVACY_DENY_ALL : No changes made. | 137 * PURPLE_PRIVACY_DENY_ALL : No changes made. |
138 * GAIM_PRIVACY_ALLOW_ALL : The privacy setting is changed to | 138 * PURPLE_PRIVACY_ALLOW_ALL : The privacy setting is changed to |
139 * GAIM_PRIVACY_DENY_USERS and the user is | 139 * PURPLE_PRIVACY_DENY_USERS and the user is |
140 * added to the deny-list. | 140 * added to the deny-list. |
141 * GAIM_PRIVACY_ALLOW_BUDDYLIST: If the user is not in the buddy-list, | 141 * PURPLE_PRIVACY_ALLOW_BUDDYLIST: If the user is not in the buddy-list, |
142 * then no changes made. Otherwise, the setting | 142 * then no changes made. Otherwise, the setting |
143 * is changed to GAIM_PRIVACY_ALLOW_USERS, all | 143 * is changed to PURPLE_PRIVACY_ALLOW_USERS, all |
144 * the buddies are added to the allow-list, and | 144 * the buddies are added to the allow-list, and |
145 * this user is removed from the list. | 145 * this user is removed from the list. |
146 * | 146 * |
147 * @param account The account. | 147 * @param account The account. |
148 * @param who The name of the user. | 148 * @param who The name of the user. |
149 * @param local Whether the change is local-only. | 149 * @param local Whether the change is local-only. |
150 * @param restore Should the previous allow/deny list be restored if the | 150 * @param restore Should the previous allow/deny list be restored if the |
151 * privacy setting is changed. | 151 * privacy setting is changed. |
152 */ | 152 */ |
153 void gaim_privacy_deny(GaimAccount *account, const char *who, gboolean local, | 153 void purple_privacy_deny(PurpleAccount *account, const char *who, gboolean local, |
154 gboolean restore); | 154 gboolean restore); |
155 | 155 |
156 /** | 156 /** |
157 * Check the privacy-setting for a user. | 157 * Check the privacy-setting for a user. |
158 * | 158 * |
159 * @param account The account. | 159 * @param account The account. |
160 * @param who The name of the user. | 160 * @param who The name of the user. |
161 * | 161 * |
162 * @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. | 162 * @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. |
163 */ | 163 */ |
164 gboolean gaim_privacy_check(GaimAccount *account, const char *who); | 164 gboolean purple_privacy_check(PurpleAccount *account, const char *who); |
165 | 165 |
166 /** | 166 /** |
167 * Sets the UI operations structure for the privacy subsystem. | 167 * Sets the UI operations structure for the privacy subsystem. |
168 * | 168 * |
169 * @param ops The UI operations structure. | 169 * @param ops The UI operations structure. |
170 */ | 170 */ |
171 void gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops); | 171 void purple_privacy_set_ui_ops(PurplePrivacyUiOps *ops); |
172 | 172 |
173 /** | 173 /** |
174 * Returns the UI operations structure for the privacy subsystem. | 174 * Returns the UI operations structure for the privacy subsystem. |
175 * | 175 * |
176 * @return The UI operations structure. | 176 * @return The UI operations structure. |
177 */ | 177 */ |
178 GaimPrivacyUiOps *gaim_privacy_get_ui_ops(void); | 178 PurplePrivacyUiOps *purple_privacy_get_ui_ops(void); |
179 | 179 |
180 /** | 180 /** |
181 * Initializes the privacy subsystem. | 181 * Initializes the privacy subsystem. |
182 */ | 182 */ |
183 void gaim_privacy_init(void); | 183 void purple_privacy_init(void); |
184 | 184 |
185 #ifdef __cplusplus | 185 #ifdef __cplusplus |
186 } | 186 } |
187 #endif | 187 #endif |
188 | 188 |
189 #endif /* _GAIM_PRIVACY_H_ */ | 189 #endif /* _PURPLE_PRIVACY_H_ */ |