Sat, 17 Apr 2004 18:29:20 +0000
[gaim-migrate @ 9437]
Excess whitespace bad, especially *that* much.
| 8675 | 1 | /* |
| 2 | * nmuserrecord.h | |
| 3 | * | |
| 4 | * Copyright © 2004 Unpublished Work of Novell, Inc. All Rights Reserved. | |
| 5 | * | |
| 6 | * THIS WORK IS AN UNPUBLISHED WORK OF NOVELL, INC. NO PART OF THIS WORK MAY BE | |
| 7 | * USED, PRACTICED, PERFORMED, COPIED, DISTRIBUTED, REVISED, MODIFIED, | |
| 8 | * TRANSLATED, ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, | |
| 9 | * RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, | |
| 10 | * INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT | |
| 11 | * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY. | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
12 | * |
| 8675 | 13 | * AS BETWEEN [GAIM] AND NOVELL, NOVELL GRANTS [GAIM] THE RIGHT TO REPUBLISH |
| 14 | * THIS WORK UNDER THE GPL (GNU GENERAL PUBLIC LICENSE) WITH ALL RIGHTS AND | |
| 15 | * LICENSES THEREUNDER. IF YOU HAVE RECEIVED THIS WORK DIRECTLY OR INDIRECTLY | |
| 16 | * FROM [GAIM] AS PART OF SUCH A REPUBLICATION, YOU HAVE ALL RIGHTS AND LICENSES | |
| 17 | * GRANTED BY [GAIM] UNDER THE GPL. IN CONNECTION WITH SUCH A REPUBLICATION, IF | |
| 18 | * ANYTHING IN THIS NOTICE CONFLICTS WITH THE TERMS OF THE GPL, SUCH TERMS | |
| 19 | * PREVAIL. | |
| 20 | * | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef __NM_USER_RECORD_H__ | |
| 24 | #define __NM_USER_RECORD_H__ | |
| 25 | ||
| 26 | #include <glib.h> | |
| 27 | ||
| 28 | typedef struct _NMUserRecord NMUserRecord; | |
| 29 | typedef struct _NMProperty NMProperty; | |
| 30 | ||
| 31 | #include "nmfield.h" | |
| 32 | #include "nmuser.h" | |
| 33 | ||
| 34 | /** | |
| 35 | * Creates an NMUserRecord | |
| 36 | * | |
| 37 | * The NMUserRecord should be released by calling | |
| 38 | * nm_release_user_record | |
| 39 | * | |
| 40 | * @return The new user record | |
| 41 | * | |
| 42 | */ | |
| 43 | NMUserRecord *nm_create_user_record(); | |
| 44 | ||
| 45 | /** | |
| 46 | * Creates an NMUserRecord | |
| 47 | * | |
| 48 | * The NMUserRecord should be released by calling | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
49 | * nm_release_user_record |
| 8675 | 50 | * |
| 51 | * @param details Should be a NM_A_FA_USER_DETAILS | |
| 52 | * | |
| 53 | * | |
| 54 | * @return The new user record | |
| 55 | * | |
| 56 | */ | |
| 57 | NMUserRecord *nm_create_user_record_from_fields(NMField * details); | |
| 58 | ||
| 59 | /** | |
| 60 | * Add a reference to an existing user_record | |
| 61 | * | |
| 62 | * The reference should be released by calling | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
63 | * nm_release_user_record |
| 8675 | 64 | * |
| 65 | * @param user_record The contact to addref | |
| 66 | * | |
| 67 | */ | |
| 68 | void nm_user_record_add_ref(NMUserRecord * user_record); | |
| 69 | ||
| 70 | /** | |
| 71 | * Release a reference to the user record | |
| 72 | * | |
| 73 | * @param user_record The user record | |
| 74 | * | |
| 75 | */ | |
| 76 | void nm_release_user_record(NMUserRecord * user_record); | |
| 77 | ||
| 78 | /** | |
| 79 | * Set the status for the user record | |
| 80 | * | |
| 81 | * @param user_record The user record | |
| 82 | * @param status The status for the user | |
| 83 | * @param text The status text for the user | |
| 84 | * | |
| 85 | */ | |
| 86 | void nm_user_record_set_status(NMUserRecord * user_record, NMSTATUS_T status, | |
| 87 | const char *text); | |
| 88 | ||
| 89 | /** | |
| 90 | * Get the status for the user record | |
| 91 | * | |
| 92 | * @param user_record The user record | |
| 93 | * | |
| 94 | * @return The status for the user record | |
| 95 | */ | |
| 96 | NMSTATUS_T nm_user_record_get_status(NMUserRecord * user_record); | |
| 97 | ||
| 98 | /** | |
| 99 | * Get the status text for the user record | |
| 100 | * | |
| 101 | * @param user_record The user record | |
| 102 | * | |
| 103 | * @return The status text if there is any, NULL otherwise | |
| 104 | * | |
| 105 | */ | |
| 106 | const char *nm_user_record_get_status_text(NMUserRecord * user_record); | |
| 107 | ||
| 108 | /** | |
| 109 | * Set the DN for the user record | |
| 110 | * | |
| 111 | * @param user_record The user record | |
| 112 | * @param dn The new DN for the user record | |
| 113 | * | |
| 114 | */ | |
| 115 | void nm_user_record_set_dn(NMUserRecord * user_record, const char *dn); | |
| 116 | ||
| 117 | /** | |
| 118 | * Get the DN for the user record | |
| 119 | * | |
| 120 | * @param user_record The user record | |
| 121 | * | |
| 122 | * @return The DN for the user record | |
| 123 | */ | |
| 124 | const char *nm_user_record_get_dn(NMUserRecord * user_record); | |
| 125 | ||
| 126 | /** | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
127 | * Set the user id for the |
| 8675 | 128 | * |
| 129 | * @param user_record The user record | |
| 130 | * @param userid The userid (CN) for the user record | |
| 131 | * | |
| 132 | */ | |
| 133 | void nm_user_record_set_userid(NMUserRecord * user_record, const char *userid); | |
| 134 | ||
| 135 | /** | |
| 136 | * Get the user id for the user record | |
| 137 | * | |
| 138 | * @param user_record The user record | |
| 139 | * | |
| 140 | * @return The user id for the user record | |
| 141 | */ | |
| 142 | const char *nm_user_record_get_userid(NMUserRecord * user_record); | |
| 143 | ||
| 144 | /** | |
| 145 | * Set the display id for the user record | |
| 146 | * | |
| 147 | * @param user_record The user record | |
| 148 | * @param display_id The new display id for the user | |
| 149 | * | |
| 150 | */ | |
| 151 | void nm_user_record_set_display_id(NMUserRecord * user_record, | |
| 152 | const char *display_id); | |
| 153 | ||
| 154 | /** | |
| 155 | * Get the display id for the user record | |
| 156 | * | |
| 157 | * @param user_record The user record | |
| 158 | * | |
| 159 | * @return The display id for the user record | |
| 160 | */ | |
| 161 | const char *nm_user_record_get_display_id(NMUserRecord * user_record); | |
| 162 | ||
| 163 | /** | |
| 164 | * Return whether or not the display id is an auth attribute or not. | |
| 165 | * | |
| 166 | * @param user_record The user record | |
| 167 | * | |
| 168 | * @return TRUE if display_id is an auth attribute, FALSE otherwise. | |
| 169 | */ | |
| 170 | gboolean | |
| 171 | nm_user_record_get_auth_attr(NMUserRecord *user_record); | |
| 172 | ||
| 173 | /** | |
| 174 | * Get the full name for the user record | |
| 175 | * | |
| 176 | * @param user_record The user record | |
| 177 | * | |
| 178 | * @return The full name for the user | |
| 179 | */ | |
| 180 | const char *nm_user_record_get_full_name(NMUserRecord * user_record); | |
| 181 | ||
| 182 | /** | |
| 183 | * Get the first name for the user record | |
| 184 | * | |
| 185 | * @param user_record The user record | |
| 186 | * | |
| 187 | * @return The first name for the user | |
| 188 | */ | |
| 189 | const char *nm_user_record_get_first_name(NMUserRecord * user_record); | |
| 190 | ||
| 191 | /** | |
| 192 | * Get the last name for the user record | |
| 193 | * | |
| 194 | * @param user_record The user record | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
195 | * |
| 8675 | 196 | * @return The last name for the user |
| 197 | */ | |
| 198 | const char *nm_user_record_get_last_name(NMUserRecord * user_record); | |
| 199 | ||
| 200 | /** | |
| 201 | * Set the user defined data for the user record | |
| 202 | * | |
| 203 | * @param user_record The user record | |
| 204 | * @param data The user defined data for the user record | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
205 | * |
| 8675 | 206 | */ |
| 207 | void nm_user_record_set_data(NMUserRecord * user_record, gpointer data); | |
| 208 | ||
| 209 | /** | |
| 210 | * Get the user defined data for the user record | |
| 211 | * | |
| 212 | * @param user_record The user record | |
| 213 | * | |
| 214 | * @return The user defined data for the user record | |
| 215 | */ | |
| 216 | gpointer nm_user_record_get_data(NMUserRecord * user_record); | |
| 217 | ||
| 218 | /** | |
| 219 | * Get the property count for the user record | |
| 220 | * | |
| 221 | * @param user_record The user record | |
| 222 | * | |
| 223 | * @return The number of information properties for the user record | |
| 224 | * | |
| 225 | */ | |
| 226 | int nm_user_record_get_property_count(NMUserRecord * user_record); | |
| 227 | ||
| 228 | /** | |
| 229 | * Get an info property for the user record. The property must be released | |
| 230 | * by calling nm_release_property() | |
| 231 | * | |
| 232 | * @param user_record The user record | |
| 233 | * @param index The index of the property to get (zero based) | |
| 234 | * | |
| 235 | * @return The property | |
| 236 | */ | |
| 237 | NMProperty *nm_user_record_get_property(NMUserRecord * user_record, int index); | |
| 238 | ||
| 239 | /** | |
| 240 | * Release a property object | |
| 241 | * | |
| 242 | * @param property The property | |
| 243 | * | |
| 244 | */ | |
| 245 | void nm_release_property(NMProperty * property); | |
| 246 | ||
| 247 | /** | |
| 248 | * Get the tag for the property | |
| 249 | * | |
| 250 | * @param property The property | |
| 251 | * | |
| 252 | * @return The tag of the property (i.e. "Email Address") | |
| 253 | */ | |
| 254 | const char *nm_property_get_tag(NMProperty * property); | |
| 255 | ||
| 256 | /** | |
| 257 | * Get the value for the property | |
| 258 | * | |
| 259 | * @param property The property | |
| 260 | * | |
| 261 | * @return The value of the property (i.e. "nobody@nowhere.com") | |
| 262 | */ | |
| 263 | const char *nm_property_get_value(NMProperty * property); | |
| 264 | ||
| 265 | /** | |
| 266 | * Copy a user record (deep copy). The dest user record must have already been | |
| 267 | * created (nm_create_user_record) | |
| 268 | * | |
| 269 | * @param dest The destination of the copy | |
| 270 | * @param src The source of the copy | |
| 271 | * | |
| 272 | */ | |
| 273 | void nm_user_record_copy(NMUserRecord * dest, NMUserRecord * src); | |
| 274 | ||
| 275 | #endif |