Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
#include "nsISupports.idl"
#include "nsIArray.idl"
#include "nsISupportsPrimitives.idl"
#include "MailNewsTypes2.idl"
interface nsIMsgDBHdr;
interface nsIRequest;
interface nsIStreamListener;
interface nsIMsgIncomingServer;
interface nsIInputStream;
interface nsIMsgCopyServiceListener;
interface IEwsFolderCallbacks;
interface IEwsMessageCallbacks;
interface IEwsMessageDeleteCallbacks;
[uuid(4a117361-653b-48a5-9ddb-588482ef9dbb)]
interface IEwsClient : nsISupports
{
void initialize(in AUTF8String endpoint, in nsIMsgIncomingServer server);
cenum Error : 8 {
EWS_ERR_AUTHENTICATION_FAILED,
EWS_ERR_UNEXPECTED,
};
void syncFolderHierarchy(in IEwsFolderCallbacks callbacks, in AUTF8String syncStateToken);
void syncMessagesForFolder(in IEwsMessageCallbacks callbacks, in AUTF8String folderId, in AUTF8String syncStateToken);
void getMessage(in AUTF8String id, in nsIRequest request, in nsIStreamListener listener);
void changeReadStatus(in Array<AUTF8String> messageIds, in boolean readStatus);
/**
* Create a new message on the server using the data read from the stream.
*
* @param folderId The EWS ID of the folder.
* @param isDraft Whether the message being created is an unsent
* draft.
* @param messageStream The input stream to read the message from.
* @param copyListener A listener to provide updates on copying of
* the message from the stream.
* @param messageCallbacks Callbacks to use to communicate between the EWS
* client and the EWS folder (e.g. to access its
* database).
*/
void saveMessage(in AUTF8String folderId,
in boolean isDraft,
in nsIInputStream messageStream,
in nsIMsgCopyServiceListener copyListener,
in IEwsMessageCallbacks messageCallbacks);
void deleteMessages(in Array<AUTF8String> messageEwsIds, in IEwsMessageDeleteCallbacks callbacks);
};
[uuid(5dacc994-30e0-42f7-94c8-52756638add5)]
interface IEwsFolderCallbacks : nsISupports
{
void recordRootFolder(in AUTF8String id);
void create(in AUTF8String id, in AUTF8String parentId, in AString name, in unsigned long flags);
void update(in AUTF8String id, in AUTF8String name);
void delete(in AUTF8String id);
void updateSyncState(in AUTF8String syncStateToken);
void onError(in IEwsClient_Error err, in AUTF8String desc);
};
[uuid(dec2ddd5-b5a2-4724-bfc7-e5de31840f76)]
interface IEwsMessageCallbacks : nsISupports
{
nsIMsgDBHdr createNewHeaderForItem(in AUTF8String ewsId);
void commitHeader(in nsIMsgDBHdr hdr);
void updateSyncState(in AUTF8String syncStateToken);
void onError(in IEwsClient_Error err, in AUTF8String desc);
};
[uuid(2bd557ee-a1ce-4563-aaf3-653914256452)]
interface IEwsMessageDeleteCallbacks : nsISupports
{
void onRemoteDeleteSuccessful();
void onError(in IEwsClient_Error err, in AUTF8String desc);
};