2006-06-15 21:34:10 +02:00
|
|
|
/*
|
2020-07-23 18:56:35 +02:00
|
|
|
Copyright (C) 2007-2020 Inverse inc.
|
2006-06-15 21:34:10 +02:00
|
|
|
Copyright (C) 2004-2005 SKYRIX Software AG
|
|
|
|
|
2014-05-30 19:53:20 +02:00
|
|
|
This file is part of SOGo.
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2014-05-30 19:53:20 +02:00
|
|
|
SOGo is free software; you can redistribute it and/or modify it under
|
2006-06-15 21:34:10 +02:00
|
|
|
the terms of the GNU Lesser General Public License as published by the
|
|
|
|
Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
later version.
|
|
|
|
|
2014-05-30 19:53:20 +02:00
|
|
|
SOGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
2006-06-15 21:34:10 +02:00
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2014-05-30 19:53:20 +02:00
|
|
|
License along with SOGo; see the file COPYING. If not, write to the
|
2006-06-15 21:34:10 +02:00
|
|
|
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __Mailer_SOGoDraftObject_H__
|
|
|
|
#define __Mailer_SOGoDraftObject_H__
|
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
#import "SOGoMailBaseObject.h"
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
SOGoDraftsFolder
|
|
|
|
Parent object: SOGoDraftsFolder
|
|
|
|
Child objects: draft attachments?
|
|
|
|
|
|
|
|
The SOGoDraftObject is used for composing new messages. It is necessary
|
|
|
|
because we can't cache objects in a session. So the contents of the drafts
|
|
|
|
folder are some kind of "mail creation transaction".
|
|
|
|
|
|
|
|
TODO: store-info should be an own object, not NSDictionary.
|
|
|
|
*/
|
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
@class NSArray;
|
|
|
|
@class NSData;
|
|
|
|
@class NSDictionary;
|
|
|
|
@class NSException;
|
|
|
|
@class NSMutableDictionary;
|
|
|
|
@class NSString;
|
2013-12-18 20:12:29 +01:00
|
|
|
@class NGImap4Envelope;
|
|
|
|
@class NGMimeBodyPart;
|
|
|
|
@class NGMimeMessage;
|
2007-08-17 04:11:34 +02:00
|
|
|
|
|
|
|
@class SOGoMailObject;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
@interface SOGoDraftObject : SOGoMailBaseObject
|
|
|
|
{
|
2007-08-17 04:11:34 +02:00
|
|
|
NSString *path;
|
|
|
|
int IMAP4ID;
|
2014-07-09 17:17:36 +02:00
|
|
|
int sourceIMAP4ID;
|
2007-08-17 04:11:34 +02:00
|
|
|
NSMutableDictionary *headers;
|
2007-08-28 23:43:06 +02:00
|
|
|
NSString *inReplyTo;
|
2007-08-17 04:11:34 +02:00
|
|
|
NSString *text;
|
|
|
|
NSString *sourceURL;
|
|
|
|
NSString *sourceFlag;
|
2010-06-25 21:58:30 +02:00
|
|
|
NSString *sourceFolder;
|
2010-11-23 14:53:54 +01:00
|
|
|
BOOL isHTML;
|
2017-12-23 13:15:47 +01:00
|
|
|
BOOL sign;
|
|
|
|
BOOL encrypt;
|
|
|
|
|
|
|
|
// Used during S/MIME encryption
|
|
|
|
NSMutableDictionary *certificates;
|
2006-06-15 21:34:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* contents */
|
2007-08-17 04:11:34 +02:00
|
|
|
- (void) fetchInfo;
|
|
|
|
- (NSException *) storeInfo;
|
|
|
|
|
|
|
|
- (void) fetchMailForEditing: (SOGoMailObject *) sourceMail;
|
|
|
|
- (void) fetchMailForReplying: (SOGoMailObject *) sourceMail
|
|
|
|
toAll: (BOOL) toAll;
|
|
|
|
- (void) fetchMailForForwarding: (SOGoMailObject *) sourceMail;
|
|
|
|
|
|
|
|
- (void) setHeaders: (NSDictionary *) newHeaders;
|
|
|
|
- (NSDictionary *) headers;
|
|
|
|
- (void) setText: (NSString *) newText;
|
|
|
|
- (NSString *) text;
|
2010-11-23 14:53:54 +01:00
|
|
|
- (void) setIsHTML: (BOOL) aBool;
|
|
|
|
- (BOOL) isHTML;
|
2007-08-17 04:11:34 +02:00
|
|
|
|
2017-12-23 13:15:47 +01:00
|
|
|
- (void) setSign: (BOOL) aBool;
|
|
|
|
- (BOOL) sign;
|
|
|
|
|
|
|
|
- (void) setEncrypt: (BOOL) aBool;
|
|
|
|
- (BOOL) encrypt;
|
|
|
|
|
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
/* for replies and forwards */
|
2014-05-30 19:53:20 +02:00
|
|
|
- (NSString *) inReplyTo;
|
|
|
|
- (void) setInReplyTo: (NSString *) newInReplyTo;
|
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
- (void) setSourceURL: (NSString *) newSurceURL;
|
|
|
|
- (void) setSourceFlag: (NSString *) newSourceFlag;
|
2010-06-25 21:58:30 +02:00
|
|
|
- (void) setSourceFolder: (NSString *) newSourceFolder;
|
|
|
|
- (NSString *) sourceFolder;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2014-07-09 17:17:36 +02:00
|
|
|
- (void) setSourceIMAP4ID: (int) newSourceIMAPID;
|
|
|
|
- (int) sourceIMAP4ID;
|
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
- (void) setIMAP4ID: (int) newIMAPID;
|
|
|
|
- (int) IMAP4ID;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* attachments */
|
|
|
|
|
2013-12-18 20:12:29 +01:00
|
|
|
- (NSArray *) fetchAttachmentAttrs;
|
|
|
|
- (NGMimeBodyPart *) bodyPartForAttachmentWithName: (NSString *) _name;
|
|
|
|
- (NSString *) pathToAttachmentWithName: (NSString *) _name;
|
2007-08-09 22:58:17 +02:00
|
|
|
- (NSException *) saveAttachment: (NSData *) _attach
|
2020-07-23 18:56:35 +02:00
|
|
|
withMetadata: (NSMutableDictionary *) metadata;
|
2007-08-09 22:58:17 +02:00
|
|
|
- (NSException *) deleteAttachmentWithName: (NSString *) _name;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* NGMime representations */
|
|
|
|
|
2017-12-23 13:15:47 +01:00
|
|
|
- (NSData *) mimeMessageForRecipient: (NSString *) theRecipient;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
/* operations */
|
2014-03-24 18:41:57 +01:00
|
|
|
- (NSArray *) allRecipients;
|
|
|
|
- (NSArray *) allBareRecipients;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-08-18 22:33:23 +02:00
|
|
|
- (NSException *) delete;
|
2016-08-12 17:38:05 +02:00
|
|
|
- (NSException *) sendMail;
|
2011-09-26 17:49:11 +02:00
|
|
|
- (NSException *) sendMailAndCopyToSent: (BOOL) copyToSent; /* default: YES */
|
2007-08-17 04:11:34 +02:00
|
|
|
- (NSException *) save;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
// /* fake being a SOGoMailObject */
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2007-08-17 04:11:34 +02:00
|
|
|
// - (id) fetchParts: (NSArray *) _parts;
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* __Mailer_SOGoDraftObject_H__ */
|