/usr/include/evolution-data-server/mapi/e-mapi-connection.h is in libexchangemapi-1.0-dev 3.10.2-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) version 3.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
*
* Authors:
* Srinivasa Ragavan <sragavan@novell.com>
* Suman Manjunath <msuman@novell.com>
*
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
*/
#ifndef E_MAPI_CONNECTION_H
#define E_MAPI_CONNECTION_H
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <libmapi/libmapi.h>
#include <libmapi/mapi_nameid.h>
#include <libedataserver/libedataserver.h>
/* Standard GObject macros */
#define E_MAPI_TYPE_CONNECTION (e_mapi_connection_get_type ())
#define E_MAPI_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_MAPI_TYPE_CONNECTION, EMapiConnection))
#define E_MAPI_CONNECTION_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), E_MAPI_TYPE_CONNECTION, EMapiConnectionClass))
#define E_MAPI_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_MAPI_TYPE_CONNECTION))
#define E_MAPI_IS_CONNECTION_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), E_MAPI_TYPE_CONNECTION))
#define E_MAPI_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_MAPI_TYPE_CONNECTION, EMapiConnectionClass))
G_BEGIN_DECLS
GQuark e_mapi_error_quark (void);
#define E_MAPI_ERROR e_mapi_error_quark ()
typedef struct _EMapiConnection EMapiConnection;
typedef struct _EMapiConnectionClass EMapiConnectionClass;
typedef struct _EMapiConnectionPrivate EMapiConnectionPrivate;
typedef struct {
uint32_t pidlid_propid; /* PidLid or PidName legacy property named ID to resolve */
uint32_t propid; /* resolved prop ID; equals to MAPI_E_RESERVED when not found or other error */
} EResolveNamedIDsData;
typedef struct {
mapi_id_t mid; /* message ID, from PidTagMid */
const gchar *msg_class; /* PidTagMessageClass */
uint32_t msg_flags; /* MAPI MSGFLAG_* bit OR, from PidTagMessageFlags */
time_t last_modified; /* PidTagLastModificationTime as UTC */
} ListObjectsData;
typedef struct _EMapiStreamedProp {
uint32_t proptag;
uint64_t cb;
const uint8_t *lpb; /* taken from the original mapi prop, no need to copy the memory */
gconstpointer orig_value; /* exact original value, as stored inside mapi prop; the lpb can be converted to utf16 */
} EMapiStreamedProp;
typedef struct _EMapiRecipient EMapiRecipient;
typedef struct _EMapiAttachment EMapiAttachment;
typedef struct _EMapiObject EMapiObject;
struct _EMapiRecipient {
struct mapi_SPropValue_array properties;
EMapiRecipient *next;
};
struct _EMapiAttachment {
struct mapi_SPropValue_array properties;
EMapiStreamedProp *streamed_properties; /* use get/add functions for these */
guint32 streamed_properties_count;
EMapiObject *embedded_object;
EMapiAttachment *next;
};
struct _EMapiObject {
struct mapi_SPropValue_array properties;
EMapiStreamedProp *streamed_properties; /* use get/add functions for these */
guint32 streamed_properties_count;
EMapiRecipient *recipients; /* NULL when none */
EMapiAttachment *attachments; /* NULL when none */
EMapiObject *parent; /* chain up to parent's object, if this is embeded attachment */
};
EMapiRecipient * e_mapi_recipient_new (TALLOC_CTX *mem_ctx);
void e_mapi_recipient_free (EMapiRecipient *recipient);
EMapiAttachment * e_mapi_attachment_new (TALLOC_CTX *mem_ctx);
void e_mapi_attachment_free (EMapiAttachment *attachment);
void e_mapi_attachment_add_streamed (EMapiAttachment *attachment,
uint32_t proptag,
uint64_t cb,
const uint8_t *lpb); /* this might be created inside the attachment TALLOC_CTX */
EMapiStreamedProp * e_mapi_attachment_get_streamed (EMapiAttachment *attachment,
uint32_t proptag);
gboolean e_mapi_attachment_get_bin_prop (EMapiAttachment *attachment,
uint32_t proptag,
uint64_t *cb,
const uint8_t **lpb);
gboolean e_mapi_attachment_contains_prop (EMapiAttachment *attachment,
uint32_t proptag);
EMapiObject * e_mapi_object_new (TALLOC_CTX *mem_ctx);
void e_mapi_object_free (EMapiObject *object);
void e_mapi_object_add_recipient (EMapiObject *object,
EMapiRecipient *recipient);
void e_mapi_object_add_attachment (EMapiObject *object,
EMapiAttachment *attachment);
void e_mapi_object_add_streamed (EMapiObject *object,
uint32_t proptag,
uint64_t cb,
const uint8_t *lpb); /* this might be created inside the attachment TALLOC_CTX */
EMapiStreamedProp * e_mapi_object_get_streamed (EMapiObject *object,
uint32_t proptag);
gboolean e_mapi_object_get_bin_prop (EMapiObject *object,
uint32_t proptag,
uint64_t *cb,
const uint8_t **lpb);
gboolean e_mapi_object_contains_prop (EMapiObject *object,
uint32_t proptag);
#define E_MAPI_PERMISSION_MEMBER_ID_ANONYMOUS_CLIENT (~((uint64_t) 0))
#define E_MAPI_PERMISSION_MEMBER_ID_DEFAULT_USER ((uint64_t) 0)
typedef enum {
E_MAPI_PERMISSION_BIT_FREE_BUSY_DETAILED = 0x00001000,
E_MAPI_PERMISSION_BIT_FREE_BUSY_SIMPLE = 0x00000800,
E_MAPI_PERMISSION_BIT_FOLDER_VISIBLE = 0x00000400,
E_MAPI_PERMISSION_BIT_FOLDER_CONTACT = 0x00000200,
E_MAPI_PERMISSION_BIT_FOLDER_OWNER = 0x00000100,
E_MAPI_PERMISSION_BIT_CREATE_SUBFOLDER = 0x00000080,
E_MAPI_PERMISSION_BIT_DELETE_ANY = 0x00000040,
E_MAPI_PERMISSION_BIT_EDIT_ANY = 0x00000020,
E_MAPI_PERMISSION_BIT_DELETE_OWNED = 0x00000010,
E_MAPI_PERMISSION_BIT_EDIT_OWNED = 0x00000008,
E_MAPI_PERMISSION_BIT_CREATE = 0x00000002,
E_MAPI_PERMISSION_BIT_READ_ANY = 0x00000001
} EMapiPermissionBits;
typedef struct {
gchar *username; /* PidTagMemberName - display name for a user */
struct SBinary_short entry_id; /* PidTagEntryId of the user */
uint64_t member_id; /* PidTagMemberId of the user */
uint32_t member_rights; /* PidTagMemberRights of the user */
} EMapiPermissionEntry;
EMapiPermissionEntry * e_mapi_permission_entry_new (const gchar *username,
const struct SBinary_short *entry_id,
uint64_t member_id,
uint32_t member_rights);
void e_mapi_permission_entry_free (EMapiPermissionEntry *entry);
typedef enum {
E_MAPI_CREATE_FLAG_NONE = 0,
E_MAPI_CREATE_FLAG_SUBMIT = 1 << 0
} EMapiCreateFlags;
/* callbacks return whether to continue in transfer of the next object */
typedef gboolean (*BuildReadPropsCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
struct SPropTagArray *props,
gpointer data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*BuildRestrictionsCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
struct mapi_SRestriction **restrictions,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*ListObjectsCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
const ListObjectsData *object_data,
guint32 obj_index,
guint32 obj_total,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*TransferObjectCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
/* const */ EMapiObject *object,
guint32 obj_index,
guint32 obj_total,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*WriteObjectCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
EMapiObject **pobject, /* out */
gpointer user_data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*GetPropertiesCB) (EMapiConnection *conn,
TALLOC_CTX *mem_ctx,
/* const */ struct mapi_SPropValue_array *properties,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
typedef gboolean (*ProgressNotifyCB) (EMapiConnection *conn,
guint32 item_index,
guint32 items_total,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
struct _EMapiConnection {
GObject parent;
EMapiConnectionPrivate *priv;
};
struct _EMapiConnectionClass {
GObjectClass parent_class;
/* signals */
};
GType e_mapi_connection_get_type (void);
EMapiConnection * e_mapi_connection_new (ESourceRegistry *registry,
const gchar *profile,
const GString *password,
GCancellable *cancellable,
GError **perror);
EMapiConnection * e_mapi_connection_find (const gchar *profile);
gboolean e_mapi_connection_reconnect (EMapiConnection *conn,
const GString *password,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_disconnect (EMapiConnection *conn,
gboolean clean,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_connected (EMapiConnection *conn);
gboolean e_mapi_connection_test_foreign_folder (EMapiConnection *conn,
const gchar *username,
const gchar *folder_name,
mapi_id_t *fid, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_peek_store (EMapiConnection *conn,
gboolean public_store,
const gchar *foreign_username,
mapi_object_t **obj_store, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_store_quotas (EMapiConnection *conn,
mapi_object_t *obj_store, /* can be NULL */
uint64_t *current_size, /* out */
uint64_t *receive_quota, /* out */
uint64_t *send_quota, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_open_default_folder (EMapiConnection *conn,
uint32_t olFolderIdentifier,
mapi_object_t *obj_folder, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_open_personal_folder (EMapiConnection *conn,
mapi_id_t fid,
mapi_object_t *obj_folder, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_open_public_folder (EMapiConnection *conn,
mapi_id_t fid,
mapi_object_t *obj_folder, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_open_foreign_folder (EMapiConnection *conn,
const gchar *username,
mapi_id_t fid,
mapi_object_t *obj_folder, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_close_folder (EMapiConnection *conn,
mapi_object_t *obj_folder,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_folder_properties (EMapiConnection *conn,
mapi_object_t *obj_folder,
BuildReadPropsCB brp_cb,
gpointer brp_cb_user_data,
GetPropertiesCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_permissions (EMapiConnection *conn,
mapi_object_t *obj_folder,
gboolean with_freebusy,
GSList **entries, /* out, EMapiPermissionEntry */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_set_permissions (EMapiConnection *conn,
mapi_object_t *obj_folder,
gboolean with_freebusy,
const GSList *entries, /* EMapiPermissionEntry */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_list_objects (EMapiConnection *conn,
mapi_object_t *obj_folder,
BuildRestrictionsCB build_rs_cb,
gpointer build_rs_cb_data,
ListObjectsCB cb,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_transfer_objects (EMapiConnection *conn,
mapi_object_t *obj_folder,
const GSList *mids,
TransferObjectCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_transfer_object (EMapiConnection *conn,
mapi_object_t *obj_folder,
mapi_id_t message_id,
TransferObjectCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_transfer_summary (EMapiConnection *conn,
mapi_object_t *obj_folder,
const GSList *mids,
TransferObjectCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_create_object (EMapiConnection *conn,
mapi_object_t *obj_folder,
uint32_t flags, /* bit-or of EMapiCreateFlags */
WriteObjectCB write_object_cb,
gpointer woc_data,
mapi_id_t *out_mid,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_modify_object (EMapiConnection *conn,
mapi_object_t *obj_folder,
mapi_id_t mid,
WriteObjectCB write_object_cb,
gpointer woc_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_count_gal_objects (EMapiConnection *conn,
guint32 *obj_total,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_list_gal_objects (EMapiConnection *conn,
BuildRestrictionsCB build_rs_cb,
gpointer build_rs_cb_data,
ListObjectsCB cb,
gpointer user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_transfer_gal_objects (EMapiConnection *conn,
const GSList *mids,
BuildReadPropsCB brp_cb, /* NULL for all supported */
gpointer brp_cb_user_data,
TransferObjectCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_transfer_gal_object (EMapiConnection *conn,
mapi_id_t message_id,
TransferObjectCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_public_folder (EMapiConnection *conn,
mapi_object_t *obj_folder, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_create_folder (EMapiConnection *conn,
mapi_object_t *obj_parent_folder, /* in */
const gchar *name,
const gchar *new_folder_type, /* usually IPF_NOTE and similar */
mapi_id_t *new_fid, /* out */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_remove_folder (EMapiConnection *conn,
mapi_object_t *obj_store, /* in, store, to which folder belongs */
mapi_id_t fid_to_remove,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_empty_folder (EMapiConnection *conn,
mapi_object_t *obj_folder,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_rename_folder (EMapiConnection *conn,
mapi_object_t *obj_folder,
const gchar *new_name,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_move_folder (EMapiConnection *conn,
mapi_object_t *src_obj_folder,
mapi_object_t *src_parent_obj_folder,
mapi_object_t *des_obj_folder,
const gchar *new_name,
GCancellable *cancellable,
GError **perror);
mapi_id_t e_mapi_connection_get_default_folder_id (EMapiConnection *conn,
uint32_t olFolder,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_set_flags (EMapiConnection *conn,
mapi_object_t *obj_folder,
GSList *mid_list,
uint32_t flag,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_remove_items (EMapiConnection *conn,
mapi_object_t *obj_folder,
const GSList *mids, /* data is (mapi_id_t *) */
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_copymove_items (EMapiConnection *conn,
mapi_object_t *src_obj_folder,
mapi_object_t *des_obj_folder,
gboolean do_copy,
GSList *mids,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_folders_list (EMapiConnection *conn,
GSList **mapi_folders,
ProgressNotifyCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_get_pf_folders_list (EMapiConnection *conn,
GSList **mapi_folders,
ProgressNotifyCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
GSList * e_mapi_connection_peek_folders_list (EMapiConnection *conn);
gboolean e_mapi_connection_resolve_named_props (EMapiConnection *conn,
mapi_object_t *obj_folder,
EResolveNamedIDsData *named_ids_list,
guint named_ids_n_elems,
GCancellable *cancellable,
GError **perror);
uint32_t e_mapi_connection_resolve_named_prop (EMapiConnection *conn,
mapi_object_t *obj_folder,
uint32_t pidlid_propid,
GCancellable *cancellable,
GError **perror);
uint32_t e_mapi_connection_unresolve_proptag_to_nameid
(EMapiConnection *conn,
mapi_id_t fid,
uint32_t proptag);
gchar * e_mapi_connection_ex_to_smtp (EMapiConnection *conn,
const gchar *ex_address,
gchar **display_name,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_resolve_username (EMapiConnection *conn,
const gchar *to_resolve,
BuildReadPropsCB brp_cb,
gpointer brp_cb_user_data,
GetPropertiesCB cb,
gpointer cb_user_data,
GCancellable *cancellable,
GError **perror);
/* Push notifications APIs */
gboolean e_mapi_connection_enable_notifications (EMapiConnection *conn,
mapi_object_t *obj_folder,
uint32_t event_mask,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_connection_disable_notifications (EMapiConnection *conn,
mapi_object_t *obj_folder,
GCancellable *cancellable,
GError **perror);
/* profile functions */
typedef struct {
const gchar *username;
GString *password;
const gchar *domain;
const gchar *server;
gboolean use_ssl;
gboolean krb_sso;
const gchar *krb_realm;
} EMapiProfileData;
#define COMPLETE_PROFILEDATA(x) \
((x)->username && *(x)->username && (x)->server && *(x)->server \
&& (((x)->domain && *(x)->domain) \
|| ((x)->krb_sso && (x)->krb_realm && *(x)->krb_realm)))
gboolean e_mapi_create_profile (struct mapi_context *mapi_ctx,
EMapiProfileData *profile,
mapi_profile_callback_t cb,
gconstpointer data,
GCancellable *cancellable,
GError **perror);
gboolean e_mapi_delete_profile (struct mapi_context *mapi_ctx,
const gchar *profile,
GError **perror);
void e_mapi_rename_profile (struct mapi_context *mapi_ctx,
const gchar *old_name,
const gchar *new_name,
GError **perror);
/* utility functions */
void make_mapi_error (GError **perror,
const gchar *context,
enum MAPISTATUS mapi_status);
G_END_DECLS
#endif
|