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