]> err.no Git - scalable-opengroupware.org/blob - SoObjects/Mailer/SOGoMailObject.h
initial sync
[scalable-opengroupware.org] / SoObjects / Mailer / SOGoMailObject.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_SOGoMailObject_H__
23 #define __Mailer_SOGoMailObject_H__
24
25 #include <SoObjects/Mailer/SOGoMailBaseObject.h>
26
27 /*
28   SOGoMailObject
29     Parent object: the SOGoMailFolder
30     Child objects: SOGoMailBodyPart's
31   
32   Represents a single mail as retrieved using NGImap4. Since IMAP4 can parse
33   MIME structures on the server side, which we map into child objects of the
34   message.
35   The child objects are accessed using integer IDs, eg:
36     /INBOX/12345/1/2/3
37   would address the MIME part 1.2.3 of the mail 12345 in the folder INBOX.
38 */
39
40 @class NSData, NSString, NSArray, NSCalendarDate, NSException, NSDictionary;
41 @class NGImap4Envelope, NGImap4EnvelopeAddress;
42
43 @interface SOGoMailObject : SOGoMailBaseObject
44 {
45   id coreInfos;
46   id headerPart;
47   NSDictionary *headers;
48 }
49
50 /* message */
51
52 - (id)fetchParts:(NSArray *)_parts; /* Note: 'parts' are fetch keys here */
53
54 /* core infos */
55
56 - (BOOL)doesMailExist;
57 - (id)fetchCoreInfos; // TODO: what does it do?
58
59 - (NGImap4Envelope *)envelope;
60 - (NSString *)subject;
61 - (NSCalendarDate *)date;
62 - (NSArray *)fromEnvelopeAddresses;
63 - (NSArray *)toEnvelopeAddresses;
64 - (NSArray *)ccEnvelopeAddresses;
65
66 - (id)bodyStructure;
67 - (id)lookupInfoForBodyPart:(id)_path;
68
69 /* content */
70
71 - (NSData *)content;
72 - (NSString *)contentAsString;
73
74 /* bulk fetching of plain/text content */
75
76 - (NSArray *)plainTextContentFetchKeys;
77 - (NSDictionary *)fetchPlainTextParts:(NSArray *)_fetchKeys;
78 - (NSDictionary *)fetchPlainTextParts;
79 - (NSDictionary *)fetchPlainTextStrings:(NSArray *)_fetchKeys;
80
81 /* flags */
82
83 - (NSException *)addFlags:(id)_f;
84 - (NSException *)removeFlags:(id)_f;
85
86 /* deletion */
87
88 - (BOOL)isDeletionAllowed;
89 - (NSException *)trashInContext:(id)_ctx;
90 - (NSException *) moveToFolderNamed: (NSString *) folderName
91                           inContext: (id)_ctx;
92
93 @end
94
95 #endif /* __Mailer_SOGoMailObject_H__ */