2005-05-24 Not Zed <NotZed@Ximian.com> * Lots more work. Now implements a full listener interface. Filled out api. svn path=/trunk/; revision=29406
178 lines
4.1 KiB
Plaintext
178 lines
4.1 KiB
Plaintext
/* Evolution Mail Interface
|
|
*
|
|
* Copyright (C) 2005 Novell, Inc.
|
|
*
|
|
* Authors: Michael Zucchi <notzed@novell.com>
|
|
*/
|
|
|
|
#ifndef _EVOLUTION_DATASERVER_MAIL_IDL_
|
|
#define _EVOLUTION_DATASERVER_MAIL_IDL_
|
|
|
|
#include <Bonobo.idl>
|
|
|
|
module GNOME {
|
|
module Evolution {
|
|
module Mail {
|
|
exception NOT_SUPPORTED {
|
|
// string why;
|
|
};
|
|
|
|
exception FAILED {
|
|
string why;
|
|
};
|
|
|
|
interface Folder;
|
|
typedef sequence<Folder> Folders;
|
|
|
|
struct FolderInfo {
|
|
string name;
|
|
string full_name;
|
|
Folder folder;
|
|
};
|
|
typedef sequence <FolderInfo> FolderInfos;
|
|
|
|
interface Store;
|
|
typedef sequence<Store> Stores;
|
|
|
|
struct StoreInfo {
|
|
string name;
|
|
string uid;
|
|
Store store;
|
|
};
|
|
typedef sequence <StoreInfo> StoreInfos;
|
|
|
|
interface Session;
|
|
|
|
// **********************************************************************
|
|
// MessageInfo wrappers
|
|
typedef string UserFlag;
|
|
typedef sequence <UserFlag> UserFlags;
|
|
|
|
struct UserTag {
|
|
string name;
|
|
string value; // value == "" == unset
|
|
};
|
|
typedef sequence <UserTag> UserTags;
|
|
|
|
struct MessageInfo {
|
|
string uid;
|
|
string subject;
|
|
string to;
|
|
string from;
|
|
long flags; // CamelMessageInfo flag bits
|
|
UserFlags userFlags;
|
|
UserTags userTags;
|
|
};
|
|
typedef sequence <MessageInfo> MessageInfos;
|
|
|
|
// Used to pass to altering functions
|
|
struct MessageInfoSet {
|
|
string uid;
|
|
long flagSet; // values bits to set in the flags
|
|
long flagMask; // mask of bits to change in the flags
|
|
UserFlags userFlagSet;
|
|
UserFlags userFlagUnset;
|
|
UserTags userTags;
|
|
};
|
|
typedef sequence <MessageInfoSet> MessageInfoSets;
|
|
|
|
/* ********************************************************************** */
|
|
// NB: tiny subset of omg properties service
|
|
typedef string PropertyName;
|
|
typedef sequence <PropertyName> PropertyNames;
|
|
struct Property {
|
|
PropertyName name;
|
|
any value;
|
|
};
|
|
typedef sequence <Property> Properties;
|
|
|
|
/* ********************************************************************** */
|
|
|
|
enum ChangeType {
|
|
ADDED,
|
|
REMOVED,
|
|
CHANGED
|
|
};
|
|
|
|
// ??
|
|
struct SessionChange {
|
|
ChangeType type;
|
|
StoreInfos stores;
|
|
};
|
|
typedef sequence <SessionChange> SessionChanges;
|
|
|
|
struct StoreChange {
|
|
ChangeType type;
|
|
FolderInfos folders;
|
|
};
|
|
typedef sequence <StoreChange> StoreChanges;
|
|
|
|
struct FolderChange {
|
|
ChangeType type;
|
|
MessageInfos messages;
|
|
};
|
|
typedef sequence <FolderChange> FolderChanges;
|
|
|
|
interface Listener : Bonobo::Unknown {
|
|
oneway void sessionChanged(in Session session, in SessionChanges changes);
|
|
// maybe folder/store should be folderinfo/storeinfo?
|
|
oneway void storeChanged(in Session session, in Store store, in StoreChanges changes);
|
|
oneway void folderChanged(in Session session, in Store store, in Folder folder, in FolderChanges changes);
|
|
|
|
// session is closed/exited?
|
|
//oneway void closed();
|
|
};
|
|
|
|
/* ********************************************************************** */
|
|
|
|
interface Session : Bonobo::Unknown {
|
|
// Flags to pass to addListener
|
|
const long SESSION_ADDED = 1 << 0;
|
|
const long SESSION_CHANGED = 1 << 1;
|
|
const long SESSION_REMOVED = 1 << 2;
|
|
const long STORE_ADDED = 1 << 3;
|
|
const long STORE_CHANGED = 1 << 4;
|
|
const long STORE_REMOVED = 1 << 5;
|
|
const long FOLDER_ADDED = 1 << 6;
|
|
const long FOLDER_CHANGED = 1 << 7;
|
|
const long FOLDER_REMOVED = 1 << 8;
|
|
|
|
boolean getProperties(in PropertyNames names, out Properties props);
|
|
|
|
StoreInfos getStores(in string pattern);
|
|
|
|
/* flags defines what to listen to */
|
|
void addListener(in Listener listener, in long flags);
|
|
void removeListener(in Listener listener);
|
|
};
|
|
|
|
interface Store : Bonobo::Unknown {
|
|
boolean getProperties(in PropertyNames names, out Properties props);
|
|
|
|
FolderInfos getFolders(in string pattern)
|
|
raises (NOT_SUPPORTED, FAILED);
|
|
|
|
void sendMessage(in Bonobo::Stream msg)
|
|
raises (NOT_SUPPORTED, FAILED);
|
|
};
|
|
|
|
interface MessageIterator : Bonobo::Unknown {
|
|
MessageInfos next(in long limit);
|
|
};
|
|
|
|
interface Folder : Bonobo::Unknown {
|
|
boolean getProperties(in PropertyNames names, out Properties props);
|
|
|
|
MessageIterator getMessages(in string pattern);
|
|
|
|
void changeMessages(in MessageInfoSets infos);
|
|
|
|
// Bonobo::Stream getMessage(in string uid);
|
|
// void appendMessage(in MessageInfoSet info, in Bonobo::Stream msg);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#endif
|