Evolution Connector for Microsoft Exchange Programmer’s Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
Synopsis
struct E2kContext; E2kContext * e2k_context_new (const gchar *uri
); void e2k_context_set_auth (E2kContext *ctx
,const gchar *username
,const gchar *domain
,const gchar *authmech
,const gchar *password
); E2kHTTPStatus e2k_context_get (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,gchar **content_type
,SoupBuffer **response
); E2kHTTPStatus e2k_context_get_owa (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,gboolean claim_ie
,SoupBuffer **response
); E2kHTTPStatus e2k_context_put (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar *content_type
,const gchar *body
,gint length
,gchar **repl_uid
); E2kHTTPStatus e2k_context_post (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar *content_type
,const gchar *body
,gint length
,gchar **location
,gchar **repl_uid
); E2kHTTPStatus e2k_context_proppatch (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,E2kProperties *props
,gboolean create
,gchar **repl_uid
); E2kResultIter * e2k_context_bproppatch_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
,E2kProperties *props
,gboolean create
); gboolean (*E2kContextTestCallback) (E2kContext *ctx
,const gchar *test_name
,gpointer user_data
); E2kHTTPStatus e2k_context_put_new (E2kContext *ctx
,E2kOperation *op
,const gchar *folder_uri
,const gchar *object_name
,E2kContextTestCallback test_callback
,gpointer user_data
,const gchar *content_type
,const gchar *body
,gint length
,gchar **location
,gchar **repl_uid
); E2kHTTPStatus e2k_context_proppatch_new (E2kContext *ctx
,E2kOperation *op
,const gchar *folder_uri
,const gchar *object_name
,E2kContextTestCallback test_callback
,gpointer user_data
,E2kProperties *props
,gchar **location
,gchar **repl_uid
); E2kHTTPStatus e2k_context_propfind (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **props
,gint nprops
,E2kResult **results
,gint *nresults
); E2kResultIter * e2k_context_bpropfind_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
,const gchar **props
,gint nprops
); E2kResultIter * e2k_context_search_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **props
,gint nprops
,E2kRestriction *rn
,const gchar *orderby
,gboolean ascending
); E2kHTTPStatus e2k_context_delete (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
); E2kResultIter * e2k_context_bdelete_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
); E2kHTTPStatus e2k_context_mkcol (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,E2kProperties *props
,gchar **permanent_url
); E2kResultIter * e2k_context_transfer_start (E2kContext *ctx
,E2kOperation *op
,const gchar *source_folder
,const gchar *dest_folder
,GPtrArray *source_hrefs
,gboolean delete_originals
); E2kHTTPStatus e2k_context_transfer_dir (E2kContext *ctx
,E2kOperation *op
,const gchar *source_href
,const gchar *dest_href
,gboolean delete_original
,gchar **permanent_url
); enum E2kContextChangeType; void (*E2kContextChangeCallback) (E2kContext *ctx
,const gchar *uri
,E2kContextChangeType type
,gpointer user_data
); void e2k_context_subscribe (E2kContext *ctx
,const gchar *uri
,E2kContextChangeType type
,gint min_interval
,E2kContextChangeCallback callback
,gpointer user_data
); void e2k_context_unsubscribe (E2kContext *ctx
,const gchar *uri
);
Details
e2k_context_new ()
E2kContext * e2k_context_new (const gchar *uri
);
Creates a new E2kContext based at uri
|
OWA uri to connect to |
Returns : |
the new context |
e2k_context_set_auth ()
void e2k_context_set_auth (E2kContext *ctx
,const gchar *username
,const gchar *domain
,const gchar *authmech
,const gchar *password
);
Sets the authentication information on ctx
. This will have the
side effect of cancelling any pending requests on ctx
.
|
the context |
|
the Windows username (not including domain) of the user |
|
the NT domain, or NULL to use the default (if using NTLM)
|
|
the HTTP Authorization type to use; either "Basic" or "NTLM" |
|
the user's password |
e2k_context_get ()
E2kHTTPStatus e2k_context_get (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,gchar **content_type
,SoupBuffer **response
);
Performs a GET on ctx
for uri
. If successful (2xx status code),
the Content-Type, and response body will be returned. The body is not
terminated by a '\0'. If the GET is not successful, content_type
and
response
will be untouched (even if the error response
included a body).
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI of the object to GET |
|
if not NULL , will contain the Content-Type of the
response on return.
|
|
if not NULL , will contain the response on return
|
Returns : |
the HTTP status |
e2k_context_get_owa ()
E2kHTTPStatus e2k_context_get_owa (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,gboolean claim_ie
,SoupBuffer **response
);
As with e2k_context_get()
, but used when you need the HTML or XML
data that would be returned to OWA rather than the raw object data.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI of the object to GET |
|
whether or not to claim to be IE |
|
if not NULL , will contain the response on return
|
Returns : |
the HTTP status |
e2k_context_put ()
E2kHTTPStatus e2k_context_put (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar *content_type
,const gchar *body
,gint length
,gchar **repl_uid
);
Performs a PUT operation on ctx
for uri
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI to PUT to |
|
MIME Content-Type of the data |
|
data to PUT |
|
length of body
|
|
if not NULL , will contain the Repl-UID of the PUT
object on return
|
Returns : |
the HTTP status |
e2k_context_post ()
E2kHTTPStatus e2k_context_post (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar *content_type
,const gchar *body
,gint length
,gchar **location
,gchar **repl_uid
);
Performs a POST operation on ctx
for uri
.
Note that POSTed objects will be irrevocably(?) marked as "unsent", If you open a POSTed message in Outlook, it will open in the composer rather than in the message viewer.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI to POST to |
|
MIME Content-Type of the data |
|
data to PUT |
|
length of body
|
|
if not NULL , will contain the Location of the POSTed
object on return
|
|
if not NULL , will contain the Repl-UID of the POSTed
object on return
|
Returns : |
the HTTP status |
e2k_context_proppatch ()
E2kHTTPStatus e2k_context_proppatch (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,E2kProperties *props
,gboolean create
,gchar **repl_uid
);
Performs a PROPPATCH operation on ctx
for uri
.
If create
is FALSE
and uri
does not already exist, the response
code will be E2K_HTTP_PRECONDITION_FAILED
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI to PROPPATCH |
|
the properties to set/remove |
|
whether or not to create uri if it does not exist
|
|
if not NULL , will contain the Repl-UID of the
PROPPATCHed object on return
|
Returns : |
the HTTP status |
e2k_context_bproppatch_start ()
E2kResultIter * e2k_context_bproppatch_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
,E2kProperties *props
,gboolean create
);
Begins a BPROPPATCH (bulk PROPPATCH) of hrefs
based at uri
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the base URI |
|
array of URIs, possibly relative to uri
|
|
length of hrefs
|
|
the properties to set/remove |
|
whether or not to create uri if it does not exist
|
Returns : |
an iterator for getting the results of the BPROPPATCH |
E2kContextTestCallback ()
gboolean (*E2kContextTestCallback) (E2kContext *ctx
,const gchar *test_name
,gpointer user_data
);
|
|
|
|
|
|
Returns : |
e2k_context_put_new ()
E2kHTTPStatus e2k_context_put_new (E2kContext *ctx
,E2kOperation *op
,const gchar *folder_uri
,const gchar *object_name
,E2kContextTestCallback test_callback
,gpointer user_data
,const gchar *content_type
,const gchar *body
,gint length
,gchar **location
,gchar **repl_uid
);
PUTs data into folder_uri
on ctx
with a new name based on
object_name
. If test_callback
is non-NULL
, it will be called
with each URI that is considered for the object so that the caller
can check its summary data to see if that URI is in use
(potentially saving one or more round-trips to the server).
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI of the folder to PUT into |
|
base name of the new object (not URI-encoded) |
|
callback to use to test possible object URIs |
|
data for test_callback
|
|
MIME Content-Type of the data |
|
data to PUT |
|
length of body
|
|
if not NULL , will contain the Location of the PUT
object on return
|
|
if not NULL , will contain the Repl-UID of the PUT
object on return
|
Returns : |
the HTTP status |
e2k_context_proppatch_new ()
E2kHTTPStatus e2k_context_proppatch_new (E2kContext *ctx
,E2kOperation *op
,const gchar *folder_uri
,const gchar *object_name
,E2kContextTestCallback test_callback
,gpointer user_data
,E2kProperties *props
,gchar **location
,gchar **repl_uid
);
PROPPATCHes data into folder_uri
on ctx
with a new name based on
object_name
. If test_callback
is non-NULL
, it will be called
with each URI that is considered for the object so that the caller
can check its summary data to see if that URI is in use
(potentially saving one or more round-trips to the server).
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI of the folder to PROPPATCH a new object in |
|
base name of the new object (not URI-encoded) |
|
callback to use to test possible object URIs |
|
data for test_callback
|
|
the properties to set/remove |
|
if not NULL , will contain the Location of the
PROPPATCHed object on return
|
|
if not NULL , will contain the Repl-UID of the
PROPPATCHed object on return
|
Returns : |
the HTTP status |
e2k_context_propfind ()
E2kHTTPStatus e2k_context_propfind (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **props
,gint nprops
,E2kResult **results
,gint *nresults
);
Performs a PROPFIND operation on ctx
for uri
. If successful, the
results are returned as an array of E2kResult (which you must free
with e2k_results_free()
), but the array will always have either 0
or 1 members.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the URI to PROPFIND on |
|
array of properties to find |
|
length of props
|
|
on return, the results |
|
length of results
|
Returns : |
the HTTP status |
e2k_context_bpropfind_start ()
E2kResultIter * e2k_context_bpropfind_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
,const gchar **props
,gint nprops
);
Begins a BPROPFIND (bulk PROPFIND) operation on ctx
for hrefs
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the base URI |
|
array of URIs, possibly relative to uri
|
|
length of hrefs
|
|
array of properties to find |
|
length of props
|
Returns : |
an iterator for getting the results |
e2k_context_search_start ()
E2kResultIter * e2k_context_search_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **props
,gint nprops
,E2kRestriction *rn
,const gchar *orderby
,gboolean ascending
);
Begins a SEARCH on ctx
at uri
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the folder to search |
|
the properties to search for |
|
size of props array
|
|
the search restriction |
|
if non-NULL , the field to sort the search results by
|
|
TRUE for an ascending search, FALSE for descending.
|
Returns : |
an iterator for returning the search results |
e2k_context_delete ()
E2kHTTPStatus e2k_context_delete (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
);
Attempts to DELETE uri
on ctx
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI to DELETE |
Returns : |
the HTTP status |
e2k_context_bdelete_start ()
E2kResultIter * e2k_context_bdelete_start (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,const gchar **hrefs
,gint nhrefs
);
Begins a BDELETE (bulk DELETE) operation on ctx
for hrefs
.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
the base URI |
|
array of URIs, possibly relative to uri , to delete
|
|
length of hrefs
|
Returns : |
an iterator for returning the results |
e2k_context_mkcol ()
E2kHTTPStatus e2k_context_mkcol (E2kContext *ctx
,E2kOperation *op
,const gchar *uri
,E2kProperties *props
,gchar **permanent_url
);
Performs a MKCOL operation on ctx
to create uri
, with optional
additional properties.
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI of the new folder |
|
properties to set on the new folder, or NULL
|
|
if not NULL , will contain the permanent URL of the
new folder on return
|
Returns : |
the HTTP status |
e2k_context_transfer_start ()
E2kResultIter * e2k_context_transfer_start (E2kContext *ctx
,E2kOperation *op
,const gchar *source_folder
,const gchar *dest_folder
,GPtrArray *source_hrefs
,gboolean delete_originals
);
Starts a BMOVE or BCOPY (depending on delete_originals
) operation
on ctx
for source_folder
. The objects in source_folder
described
by source_hrefs
will be moved or copied to dest_folder
.
e2k_result_iter_next()
can be used to check the success or failure
of each move/copy. (The E2K_PR_DAV_LOCATION property for each
result will show the new location of the object.)
NB: may not work correctly if source_hrefs
contains folders
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI of the source folder |
|
URI of the destination folder |
|
an array of hrefs to move, relative to source_folder
|
|
whether or not to delete the original objects |
Returns : |
the iterator for the results |
e2k_context_transfer_dir ()
E2kHTTPStatus e2k_context_transfer_dir (E2kContext *ctx
,E2kOperation *op
,const gchar *source_href
,const gchar *dest_href
,gboolean delete_original
,gchar **permanent_url
);
Performs a MOVE or COPY (depending on delete_original
) operation
on ctx
for source_href
. The folder itself will be moved, renamed,
or copied to dest_href
(which is the name of the new folder
itself, not its parent).
|
the context |
|
pointer to an E2kOperation to use for cancellation |
|
URI of the source folder |
|
URI of the destination folder |
|
whether or not to delete the original folder |
|
if not NULL , will contain the permanent URL of the
new folder on return
|
Returns : |
the HTTP status |
enum E2kContextChangeType
typedef enum { E2K_CONTEXT_OBJECT_CHANGED, E2K_CONTEXT_OBJECT_ADDED, E2K_CONTEXT_OBJECT_REMOVED, E2K_CONTEXT_OBJECT_MOVED } E2kContextChangeType;
E2kContextChangeCallback ()
void (*E2kContextChangeCallback) (E2kContext *ctx
,const gchar *uri
,E2kContextChangeType type
,gpointer user_data
);
|
|
|
|
|
|
|
e2k_context_subscribe ()
void e2k_context_subscribe (E2kContext *ctx
,const gchar *uri
,E2kContextChangeType type
,gint min_interval
,E2kContextChangeCallback callback
,gpointer user_data
);
This subscribes to change notifications of the given type
on uri
.
callback
will (eventually) be invoked any time the folder changes
in the given way: whenever an object is added to it for
E2K_CONTEXT_OBJECT_ADDED
, whenever an object is deleted (but
not moved) from it (or the folder itself is deleted) for
E2K_CONTEXT_OBJECT_REMOVED
, whenever an object is moved in or
out of the folder for E2K_CONTEXT_OBJECT_MOVED
, and whenever
any of the above happens, or the folder or one of its items is
modified, for E2K_CONTEXT_OBJECT_CHANGED
. (This means that if
you subscribe to both CHANGED and some other notification on the
same folder that multiple callbacks may be invoked every time an
object is added/removed/moved/etc.)
Notifications can be used *only* to discover changes made by other clients! The code cannot assume that it will receive a notification for every change that it makes to the server, for two reasons:
First, if multiple notifications occur within min_interval
seconds
of each other, the later ones will be suppressed, to avoid
excessive traffic between the client and the server as the client
tries to sync. Second, if there is a firewall between the client
and the server, it is possible that all notifications will be lost.
|
the context |
|
the folder URI to subscribe to notifications on |
|
the type of notification to subscribe to |
|
the minimum interval (in seconds) between notifications. |
|
the callback to call when a notification has been received |
|
data to pass to callback .
|
e2k_context_unsubscribe ()
void e2k_context_unsubscribe (E2kContext *ctx
,const gchar *uri
);
Unsubscribes to all notifications on ctx
for uri
.
|
the context |
|
the URI to unsubscribe from |
Signal Details
The "redirect"
signal
void user_function (E2kContext *e2kcontext, gint arg1, gchar *arg2, gchar *arg3, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
|
|
|
|
user data set when the signal handler was connected. |