/* 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;
struct Message {
string uid;
string subject;
string to;
string from;
};
typedef sequence <Message> Messages;
/* ********************************************************************** */
// 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;
Folders folders;
};
typedef sequence <StoreChange> StoreChanges;
struct FolderChange {
ChangeType type;
Messages messages;
};
typedef sequence <FolderChange> FolderChanges;
interface Listener : Bonobo::Unknown {
oneway void sessionChanged(in Session session, in SessionChange change);
oneway void storeChanged(in Session session, in Store store, in StoreChanges change);
oneway void folderChanged(in Session session, in Store store, in Folder folder, in FolderChanges changes);
};
/* ********************************************************************** */
interface Session : Bonobo::Unknown {
boolean getProperties(in PropertyNames names, out Properties props);
StoreInfos getStores(in string pattern);
void addListener(in Listener listener);
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, in string from, in string recipients)
raises (NOT_SUPPORTED, FAILED);
};
interface MessageIterator : Bonobo::Unknown {
Messages next(in long limit);
};
interface Folder : Bonobo::Unknown {
boolean getProperties(in PropertyNames names, out Properties props);
MessageIterator getMessages(in string pattern);
Bonobo::Stream getMessage(in string uid);
// void appendMessage(in MessageInfo info, in Bonobo::Stream msg);
};
};
};
};
#endif