]> err.no Git - scalable-opengroupware.org/blob - SOGo/SoObjects/Mailer/SOGoDraftObject.h
added ability to process custom headers in draft object
[scalable-opengroupware.org] / SOGo / SoObjects / Mailer / SOGoDraftObject.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_SOGoDraftObject_H__
23 #define __Mailer_SOGoDraftObject_H__
24
25 #include <Mailer/SOGoMailBaseObject.h>
26
27 /*
28   SOGoDraftsFolder
29     Parent object: SOGoDraftsFolder
30     Child objects: draft attachments?
31   
32   The SOGoDraftObject is used for composing new messages. It is necessary
33   because we can't cache objects in a session. So the contents of the drafts
34   folder are some kind of "mail creation transaction".
35
36   TODO: store-info should be an own object, not NSDictionary.
37 */
38
39 @class NSString, NSArray, NSDictionary, NSData, NSException;
40 @class NGMimeMessage, NGImap4Envelope;
41
42 @interface SOGoDraftObject : SOGoMailBaseObject
43 {
44   NSString        *path;
45   NSDictionary    *info; /* stores the envelope information */
46   NGImap4Envelope *envelope;
47 }
48
49 /* contents */
50
51 - (NSDictionary *)fetchInfo;
52 - (NSException *)storeInfo:(NSDictionary *)_info;
53
54 /* attachments */
55
56 - (NSArray *)fetchAttachmentNames;
57 - (BOOL)isValidAttachmentName:(NSString *)_name;
58 - (NSException *)saveAttachment:(NSData *)_attach withName:(NSString *)_name;
59 - (NSException *)deleteAttachmentWithName:(NSString *)_name;
60
61 /* NGMime representations */
62
63 - (NGMimeMessage *)mimeMessage;
64
65 - (NSString *)saveMimeMessageToTemporaryFile;
66 - (NSString *)saveMimeMessageToTemporaryFileWithHeaders:(NSDictionary *)_addh;
67 - (NSException *)sendMimeMessageAtPath:(NSString *)_path;
68
69 - (NSException *)sendMail;
70
71 /* operations */
72
73 - (NSException *)delete;
74
75 /* fake being a SOGoMailObject */
76
77 - (id)fetchParts:(NSArray *)_parts;
78
79 @end
80
81 #endif /* __Mailer_SOGoDraftObject_H__ */