14192
|
1 /**
|
|
2 * @file privacy.h Privacy API
|
|
3 * @ingroup core
|
|
4 *
|
|
5 * gaim
|
|
6 *
|
|
7 * Gaim 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
|
|
9 * source distribution.
|
|
10 *
|
|
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
|
|
13 * the Free Software Foundation; either version 2 of the License, or
|
|
14 * (at your option) any later version.
|
|
15 *
|
|
16 * This program is distributed in the hope that it will be useful,
|
|
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 * GNU General Public License for more details.
|
|
20 *
|
|
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
|
|
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
24 */
|
|
25 #ifndef _GAIM_PRIVACY_H_
|
|
26 #define _GAIM_PRIVACY_H_
|
|
27
|
|
28 #include "account.h"
|
|
29
|
|
30 /**
|
|
31 * Privacy data types.
|
|
32 */
|
|
33 typedef enum _GaimPrivacyType
|
|
34 {
|
|
35 GAIM_PRIVACY_ALLOW_ALL = 1,
|
|
36 GAIM_PRIVACY_DENY_ALL,
|
|
37 GAIM_PRIVACY_ALLOW_USERS,
|
|
38 GAIM_PRIVACY_DENY_USERS,
|
|
39 GAIM_PRIVACY_ALLOW_BUDDYLIST
|
|
40 } GaimPrivacyType;
|
|
41
|
|
42 #ifdef __cplusplus
|
|
43 extern "C" {
|
|
44 #endif
|
|
45
|
|
46 /**
|
|
47 * Privacy core/UI operations.
|
|
48 */
|
|
49 typedef struct
|
|
50 {
|
|
51 void (*permit_added)(GaimAccount *account, const char *name);
|
|
52 void (*permit_removed)(GaimAccount *account, const char *name);
|
|
53 void (*deny_added)(GaimAccount *account, const char *name);
|
|
54 void (*deny_removed)(GaimAccount *account, const char *name);
|
|
55
|
|
56 } GaimPrivacyUiOps;
|
|
57
|
|
58 /**
|
|
59 * Adds a user to the account's permit list.
|
|
60 *
|
|
61 * @param account The account.
|
|
62 * @param name The name of the user to add to the list.
|
|
63 * @param local_only If TRUE, only the local list is updated, and not
|
|
64 * the server.
|
|
65 *
|
|
66 * @return TRUE if the user was added successfully, or @c FALSE otherwise.
|
|
67 */
|
|
68 gboolean gaim_privacy_permit_add(GaimAccount *account, const char *name,
|
|
69 gboolean local_only);
|
|
70
|
|
71 /**
|
|
72 * Removes a user from the account's permit list.
|
|
73 *
|
|
74 * @param account The account.
|
|
75 * @param name The name of the user to add to the list.
|
|
76 * @param local_only If TRUE, only the local list is updated, and not
|
|
77 * the server.
|
|
78 *
|
|
79 * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
|
|
80 */
|
|
81 gboolean gaim_privacy_permit_remove(GaimAccount *account, const char *name,
|
|
82 gboolean local_only);
|
|
83
|
|
84 /**
|
|
85 * Adds a user to the account's deny list.
|
|
86 *
|
|
87 * @param account The account.
|
|
88 * @param name The name of the user to add to the list.
|
|
89 * @param local_only If TRUE, only the local list is updated, and not
|
|
90 * the server.
|
|
91 *
|
|
92 * @return TRUE if the user was added successfully, or @c FALSE otherwise.
|
|
93 */
|
|
94 gboolean gaim_privacy_deny_add(GaimAccount *account, const char *name,
|
|
95 gboolean local_only);
|
|
96
|
|
97 /**
|
|
98 * Removes a user from the account's deny list.
|
|
99 *
|
|
100 * @param account The account.
|
|
101 * @param name The name of the user to add to the list.
|
|
102 * @param local_only If TRUE, only the local list is updated, and not
|
|
103 * the server.
|
|
104 *
|
|
105 * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
|
|
106 */
|
|
107 gboolean gaim_privacy_deny_remove(GaimAccount *account, const char *name,
|
|
108 gboolean local_only);
|
|
109
|
|
110
|
|
111 /**
|
|
112 * Check the privacy-setting for a user.
|
|
113 *
|
|
114 * @param account The account.
|
|
115 * @param who The name of the user.
|
|
116 *
|
|
117 * @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.
|
|
118 */
|
|
119 gboolean gaim_privacy_check(GaimAccount *account, const char *who);
|
|
120
|
|
121 /**
|
|
122 * Sets the UI operations structure for the privacy subsystem.
|
|
123 *
|
|
124 * @param ops The UI operations structure.
|
|
125 */
|
|
126 void gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops);
|
|
127
|
|
128 /**
|
|
129 * Returns the UI operations structure for the privacy subsystem.
|
|
130 *
|
|
131 * @return The UI operations structure.
|
|
132 */
|
|
133 GaimPrivacyUiOps *gaim_privacy_get_ui_ops(void);
|
|
134
|
|
135 /**
|
|
136 * Initializes the privacy subsystem.
|
|
137 */
|
|
138 void gaim_privacy_init(void);
|
|
139
|
|
140 #ifdef __cplusplus
|
|
141 }
|
|
142 #endif
|
|
143
|
|
144 #endif /* _GAIM_PRIVACY_H_ */
|