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
|
/* Evolution Mail Data 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 Evolution {
module Mail {
/* ********************************************************************** */
// NB: tiny subset of omg properties service
typedef string PropertyName;
typedef sequence <PropertyName> PropertyNames;
struct Property {
PropertyName name;
any value;
};
typedef sequence <Property> Properties;
/* ********************************************************************** */
// exceptions
enum ErrorType {
SYSTEM_ERROR,
CAMEL_ERROR,
FAILED,
NOT_SUPPORTED,
NO_PERMISSION
};
exception MailException {
ErrorType id;
string desc;
};
/* ********************************************************************** */
// Main interfaces
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;
/* ********************************************************************** */
/* Messages are passed as full rfc822 encoded messages in a stream */
typedef sequence <octet>Buffer;
interface MessageStream : Bonobo::Unknown {
Buffer next(in long size)
raises (MailException);
void dispose();
};
interface MessageIterator : Bonobo::Unknown {
MessageInfos next(in long limit)
raises (MailException);
void dispose();
};
/* ********************************************************************** */
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;
/* ********************************************************************** */
/* listeners */
interface SessionListener : Bonobo::Unknown {
oneway void changed(in Session session, in SessionChanges changes);
oneway void shutdown(in Session session);
// We need to use gnome-keyring instead of an interface like this?
// Or does gnome-keyring run off this?
//string getPassword(in Session session, string uri, string domain, string item, string prompt, long flags);
};
interface StoreListener : Bonobo::Unknown {
oneway void changed(in Store store, in StoreChanges changes);
};
interface FolderListener : Bonobo::Unknown {
oneway void changed(in Folder folder, in FolderChanges changes);
};
/* ********************************************************************** */
// If this is done, then Session shouldn't have add/removeListener anymore
// interface Factory : Bonobo::Unknown {
// Session getSession(in string base, in SessionListener listener);
// };
interface Session : Bonobo::Unknown {
boolean getProperties(in PropertyNames names, out Properties props);
StoreInfos getStores(in string pattern, in StoreListener listener)
raises (MailException);
void addListener(in SessionListener listener);
void removeListener(in SessionListener listener);
};
interface Store : Bonobo::Unknown {
boolean getProperties(in PropertyNames names, out Properties props);
FolderInfos getFolders(in string pattern, in FolderListener listener)
raises (MailException);
void sendMessage(in MessageStream msg)
raises (MailException);
};
interface Folder : Bonobo::Unknown {
boolean getProperties(in PropertyNames names, out Properties props);
MessageIterator getMessages(in string pattern)
raises (MailException);
void changeMessages(in MessageInfoSets infos)
raises (MailException);
MessageStream getMessage(in string uid)
raises (MailException);
void appendMessage(in MessageInfoSet info, in MessageStream msg)
raises (MailException);
};
};
};
#endif
|