]> err.no Git - scalable-opengroupware.org/blob - SOGo/SoObjects/Mailer/SOGoMailManager.h
e7931c8990136fa26d3bc8be584c3df6051bf011
[scalable-opengroupware.org] / SOGo / SoObjects / Mailer / SOGoMailManager.h
1 /*
2   Copyright (C) 2004-2005 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __Mailer_SOGoMailManager_H__
23 #define __Mailer_SOGoMailManager_H__
24
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSRange.h>
27
28 /*
29   SOGoMailManager
30   
31   Coordinates access to IMAP4 mailboxes, caches folder hierarchies, etc.
32 */
33
34 @class NSString, NSData, NSURL, NSArray, NSMutableDictionary, NSTimer;
35 @class NSException;
36 @class NGImap4Client;
37
38 @interface SOGoMailManager : NSObject
39 {
40   NSMutableDictionary *urlToEntry;
41   NSTimer *gcTimer;
42 }
43
44 + (id)defaultMailManager;
45
46 /* client object */
47
48 - (NGImap4Client *)imap4ClientForURL:(NSURL *)_url password:(NSString *)_pwd;
49 - (void)flushCachesForURL:(NSURL *)_url;
50
51 /* folder hierarchy */
52
53 - (NSString *)imap4Separator;
54 - (NSString *)imap4FolderNameForURL:(NSURL *)_url;
55 - (NSArray *)subfoldersForURL:(NSURL *)_url password:(NSString *)_pwd;
56 - (NSArray *)allFoldersForURL:(NSURL *)_url password:(NSString *)_pwd;
57
58 /* messages */
59
60 - (NSArray *)fetchUIDsInURL:(NSURL *)_url qualifier:(id)_q
61   sortOrdering:(id)_so password:(NSString *)_pwd;
62 - (NSArray *)fetchUIDs:(NSArray *)_uids inURL:(NSURL *)_url
63   parts:(NSArray *)_parts password:(NSString *)_pwd;
64
65 - (NSException *)expungeAtURL:(NSURL *)_url password:(NSString *)_pwd;
66
67 /* individual message */
68
69 - (id)fetchURL:(NSURL *)_url parts:(NSArray *)_parts password:(NSString *)_pwd;
70
71 - (NSData *)fetchContentOfBodyPart:(NSString *)_partId
72   atURL:(NSURL *)_url password:(NSString *)_pwd;
73
74 - (NSException *)addFlags:(id)_f    toURL:(NSURL *)_u password:(NSString *)_p;
75 - (NSException *)removeFlags:(id)_f toURL:(NSURL *)_u password:(NSString *)_p;
76 - (NSException *)markURLDeleted:(NSURL *)_u           password:(NSString *)_p;
77
78 - (NSException *)postData:(NSData *)_data flags:(id)_flags
79   toFolderURL:(NSURL *)_url password:(NSString *)_p;
80
81 - (NSException *)copyMailURL:(NSURL *)_srcurl toFolderURL:(NSURL *)_desturl
82   password:(NSString *)_pwd;
83
84 /* managing folders */
85
86 - (BOOL)doesMailboxExistAtURL:(NSURL *)_url password:(NSString *)_pwd;
87 - (id)infoForMailboxAtURL:(NSURL *)_url     password:(NSString *)_pwd;
88
89 - (NSException *)createMailbox:(NSString *)_mailbox atURL:(NSURL *)_url
90   password:(NSString *)_pwd;
91 - (NSException *)deleteMailboxAtURL:(NSURL *)_url password:(NSString *)_pwd;
92
93 - (NSException *)moveMailboxAtURL:(NSURL *)_srcurl toURL:(NSURL *)_desturl
94   password:(NSString *)_pwd;
95
96 - (id)aclForMailboxAtURL:(NSURL *)_url password:(NSString *)_pwd;
97 - (NSString *)myRightsForMailboxAtURL:(NSURL *)_url password:(NSString *)_pwd;
98
99 - (NSException *)addFlags:(id)_f toAllMessagesInURL:(NSURL *)_u
100   password:(NSString *)_p;
101
102 @end
103
104 #endif /* __Mailer_SOGoMailManager_H__ */