]> err.no Git - sope/blob - sope-mime/NGImap4/NGImap4Message.h
bumped versions in Xcode, added files in sope-mime
[sope] / sope-mime / NGImap4 / NGImap4Message.h
1 /*
2   Copyright (C) 2000-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 __Database_NGImap4_NGImap4Message_H__
23 #define __Database_NGImap4_NGImap4Message_H__
24
25 #import <Foundation/NSObject.h>
26 #include <NGMime/NGPart.h>
27 #include <NGImap4/NGImap4Support.h>
28
29 @class NSArray, NSMutableDictionary;
30 @class EOGlobalID;
31 @class NGHashMap;
32 @class NGImap4Context, NGImap4Folder, NGImap4FolderMailRegistry;
33
34 @interface NGImap4Message : NSObject
35 {
36 @protected
37   NGHashMap      *headers;
38   unsigned       uid;
39   int            size;
40   NSArray        *flags;
41
42   id<NGMimePart> message;
43   id<NGMimePart> bodyStructure;
44   NSData         *rawData;
45
46   NGImap4Context *context;
47   NGImap4Folder  *folder; // not retained
48   NGImap4FolderMailRegistry *mailRegistry;
49   
50   NSURL          *url;
51   EOGlobalID     *globalID;
52
53   NSMutableDictionary *bodyStructureContent;
54
55   NSString *removeFlagNotificationName;
56   NSString *addFlagNotificationName;
57   
58   int isRead;
59 }
60
61 - (id)initWithUid:(unsigned)_uid folder:(NGImap4Folder *)_folder
62   context:(NGImap4Context *)_ctx;
63
64 - (id)initWithUid:(unsigned)_uid headers:(NGHashMap *)_header
65   size:(unsigned)_size flags:(NSArray *)_flags folder:(NGImap4Folder *)_folder
66   context:(NGImap4Context *)_ctx;
67
68 /* accessors */
69
70 - (NSException *)lastException;
71 - (void)resetLastException;
72 - (NGHashMap *)headers;
73 - (int)size;
74 - (unsigned)uid;
75 - (NSArray *)flags;
76
77 - (NSData *)contentsOfPart:(NSString *)_part;
78 - (id<NGMimePart>)bodyStructure;
79 - (id<NGMimePart>)message;
80 - (NSData *)rawData;
81
82 - (NGImap4Folder *)folder;
83 - (NGImap4Context *)context;
84
85 - (NSURL *)url;
86 - (EOGlobalID *)globalID;
87
88 /* flag processing */
89
90 - (void)addFlag:(NSString *)_flag;
91 - (void)removeFlag:(NSString *)_flag;
92
93 - (BOOL)isRead;
94 - (void)markRead;
95 - (void)markUnread;
96
97 - (BOOL)isFlagged;
98 - (void)markFlagged;
99 - (void)markUnFlagged;
100
101 - (BOOL)isAnswered;
102 - (void)markAnswered;
103 - (void)markNotAnswered;
104
105 /* equality */
106
107 - (BOOL)isEqual:(id)_obj;
108 - (BOOL)isEqualToNGImap4Message:(NGImap4Message *)_messages;
109
110 @end
111
112 #endif /* __Database_NGImap4_NGImap4Message_H__ */