1 | /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * Storage interface for the Evolution shell. |
---|
4 | * |
---|
5 | * Authors: |
---|
6 | * Ettore Perazzoli <ettore@ximian.com> |
---|
7 | * |
---|
8 | * Copyright (C) 2000, 2001 Ximian, Inc. |
---|
9 | */ |
---|
10 | |
---|
11 | #include <Bonobo.h> |
---|
12 | |
---|
13 | module GNOME { |
---|
14 | module Evolution { |
---|
15 | interface Storage; |
---|
16 | interface StorageListener; |
---|
17 | |
---|
18 | interface Storage : Bonobo::Unknown { |
---|
19 | exception AlreadyListening {}; |
---|
20 | exception NotFound {}; |
---|
21 | |
---|
22 | enum Result { |
---|
23 | OK, |
---|
24 | UNSUPPORTED_OPERATION, |
---|
25 | UNSUPPORTED_TYPE, |
---|
26 | INVALID_URI, |
---|
27 | ALREADY_EXISTS, |
---|
28 | DOES_NOT_EXIST, |
---|
29 | PERMISSION_DENIED, |
---|
30 | NO_SPACE, |
---|
31 | NOT_EMPTY, |
---|
32 | NOT_ONLINE, |
---|
33 | GENERIC_ERROR |
---|
34 | }; |
---|
35 | |
---|
36 | struct FolderResult { |
---|
37 | Result result; |
---|
38 | string path; |
---|
39 | }; |
---|
40 | |
---|
41 | /* The name of the storage. */ |
---|
42 | readonly attribute string name; |
---|
43 | |
---|
44 | /* Whether the storage has folders from other user's. */ |
---|
45 | readonly attribute boolean hasSharedFolders; |
---|
46 | |
---|
47 | /* Get information for a folder. NOTE: evolutionUri in the |
---|
48 | returned Folder is going to be an empty string if you use |
---|
49 | this function. */ |
---|
50 | Folder getFolderAtPath (in string path) |
---|
51 | raises (NotFound); |
---|
52 | |
---|
53 | /* Flat list of the folders in the storage. */ |
---|
54 | readonly attribute FolderList folderList; |
---|
55 | |
---|
56 | /* The folder property items (for right-click menu etc.). */ |
---|
57 | |
---|
58 | struct FolderPropertyItem { |
---|
59 | string label; |
---|
60 | string tooltip; |
---|
61 | Icon icon; // Currently unused |
---|
62 | }; |
---|
63 | typedef sequence<FolderPropertyItem> FolderPropertyItemList; |
---|
64 | |
---|
65 | readonly attribute FolderPropertyItemList folderPropertyItems; |
---|
66 | |
---|
67 | /* Folder Operations. */ |
---|
68 | |
---|
69 | void asyncCreateFolder (in string path, |
---|
70 | in string type, |
---|
71 | in string description, |
---|
72 | in string parent_physical_uri, |
---|
73 | in Bonobo::Listener listener); |
---|
74 | |
---|
75 | void asyncRemoveFolder (in string path, |
---|
76 | in string physical_uri, |
---|
77 | in Bonobo::Listener listener); |
---|
78 | |
---|
79 | void asyncXferFolder (in string source_path, |
---|
80 | in string destination_path, |
---|
81 | in boolean remove_source, |
---|
82 | in Bonobo::Listener listener); |
---|
83 | |
---|
84 | /* Open remote nodes. */ |
---|
85 | void asyncOpenFolder (in string path); |
---|
86 | |
---|
87 | /* Set unread count. */ |
---|
88 | void updateFolder (in string path, |
---|
89 | in long unread_count); |
---|
90 | |
---|
91 | /* Shared folders. */ |
---|
92 | void asyncDiscoverSharedFolder (in string user, |
---|
93 | in string folder_name, |
---|
94 | in Bonobo::Listener listener); |
---|
95 | void cancelDiscoverSharedFolder (in string user, |
---|
96 | in string folder_name); |
---|
97 | void asyncRemoveSharedFolder (in string path, |
---|
98 | in Bonobo::Listener listener); |
---|
99 | |
---|
100 | /* Listener handling. */ |
---|
101 | void addListener (in StorageListener listener) |
---|
102 | raises (AlreadyListening); |
---|
103 | void removeListener (in StorageListener listener) |
---|
104 | raises (NotFound); |
---|
105 | |
---|
106 | /* (This should probably be in a separate interface, but |
---|
107 | creating a new interface in Bonobo is so painful that I'll |
---|
108 | just keep it here for now. */ |
---|
109 | void showFolderProperties (in string path, |
---|
110 | in short itemNumber, |
---|
111 | in long parentWindowId); |
---|
112 | }; |
---|
113 | |
---|
114 | interface StorageListener { |
---|
115 | exception Exists {}; |
---|
116 | exception NotFound {}; |
---|
117 | |
---|
118 | void notifyDestroyed (); |
---|
119 | |
---|
120 | /* FIXME exceptions don't make much sense here... */ |
---|
121 | |
---|
122 | void notifyFolderCreated (in string path, |
---|
123 | in Folder folder) |
---|
124 | raises (Exists); |
---|
125 | |
---|
126 | void notifyFolderUpdated (in string path, |
---|
127 | in long unread_count) |
---|
128 | raises (NotFound); |
---|
129 | |
---|
130 | void notifyFolderRemoved (in string path) |
---|
131 | raises (NotFound); |
---|
132 | |
---|
133 | void notifyHasSubfolders (in string path, |
---|
134 | in string message) |
---|
135 | raises (NotFound); |
---|
136 | }; |
---|
137 | |
---|
138 | interface StorageRegistry : Bonobo::Unknown { |
---|
139 | exception Exists {}; |
---|
140 | exception NotFound {}; |
---|
141 | exception AlreadyListening {}; |
---|
142 | |
---|
143 | typedef sequence<Storage> StorageList; |
---|
144 | |
---|
145 | enum MessageType { |
---|
146 | STORAGE_CREATED, |
---|
147 | STORAGE_DESTROYED |
---|
148 | }; |
---|
149 | |
---|
150 | struct NotifyResult { |
---|
151 | MessageType type; |
---|
152 | string name; |
---|
153 | }; |
---|
154 | |
---|
155 | StorageListener addStorage (in Storage storage, |
---|
156 | in string name) |
---|
157 | raises (Exists); |
---|
158 | |
---|
159 | StorageList getStorageList (); |
---|
160 | |
---|
161 | Storage getStorageByName (in string name) |
---|
162 | raises (NotFound); |
---|
163 | |
---|
164 | void removeStorageByName (in string name) |
---|
165 | raises (NotFound); |
---|
166 | |
---|
167 | void addListener (in Bonobo::Listener listener) |
---|
168 | raises (AlreadyListening); |
---|
169 | |
---|
170 | void removeListener (in Bonobo::Listener listener) |
---|
171 | raises (NotFound); |
---|
172 | |
---|
173 | Folder getFolderByUri (in string uri) |
---|
174 | raises (NotFound); |
---|
175 | }; |
---|
176 | }; |
---|
177 | }; |
---|