]> err.no Git - scalable-opengroupware.org/blob - SOGo/SoObjects/Mailer/SOGoMailConnectionEntry.h
0e3fcfc2e6e549cc3d30a8e8b30004dbae4dcd33
[scalable-opengroupware.org] / SOGo / SoObjects / Mailer / SOGoMailConnectionEntry.h
1 /*
2   Copyright (C) 2004 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 __SOGo_SOGoMailConnectionEntry_H__
23 #define __SOGo_SOGoMailConnectionEntry_H__
24
25 #import <Foundation/NSObject.h>
26
27 /* 
28    SOGoMailConnectionEntry
29    
30    A cached connection to an IMAP4 server plus some cached objects.
31
32    It caches:
33    - the folder hierarchy
34    - uid sets?
35    - 'myrights' permissions of mailboxes
36    ?
37 */
38
39 @class NSString, NSDate, NSArray, NSDictionary, NSURL, NSMutableDictionary;
40 @class NGImap4Client;
41
42 @interface SOGoMailConnectionEntry : NSObject
43 {
44 @public
45   NGImap4Client *client;
46   NSString      *password;
47   NSDate        *creationTime;
48
49   /* hierarchy cache */
50   NSDictionary  *subfolders;
51
52   /* permission cache */
53   NSMutableDictionary *urlToRights;
54   
55   /* uids cache */
56   NSArray *cachedUIDs;
57   NSURL   *uidFolderURL;
58   id      uidSortOrdering;
59 }
60
61 - (id)initWithClient:(NGImap4Client *)_client password:(NSString *)_pwd;
62
63 /* accessors */
64
65 - (NGImap4Client *)client;
66 - (BOOL)isValidPassword:(NSString *)_pwd;
67
68 - (NSDate *)creationTime;
69
70 - (void)cacheHierarchyResults:(NSDictionary *)_hierarchy;
71 - (NSDictionary *)cachedHierarchyResults;
72 - (void)flushFolderHierarchyCache;
73
74 - (id)cachedUIDsForURL:(NSURL *)_url qualifier:(id)_q sortOrdering:(id)_so;
75 - (void)cacheUIDs:(NSArray *)_uids forURL:(NSURL *)_url
76   qualifier:(id)_q sortOrdering:(id)_so;
77
78 - (NSString *)cachedMyRightsForURL:(NSURL *)_url;
79 - (void)cacheMyRights:(NSString *)_rights forURL:(NSURL *)_url;
80
81 - (void)flushMailCaches;
82
83 @end
84
85 #endif /* __SOGo_SOGoMailConnectionEntry_H__ */