]> err.no Git - sope/blob - sope-mime/NGMime/NGMimeBodyParser.h
added reply-to parameter support for text mime types
[sope] / sope-mime / NGMime / NGMimeBodyParser.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
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 __NGMime_NGMimeBodyParser_H__
24 #define __NGMime_NGMimeBodyParser_H__
25
26 #import <Foundation/NSObject.h>
27 #include <NGMime/NGPart.h>
28
29 @class NSData;
30
31 @protocol NGMimeBodyParser < NSObject >
32
33 - (id)parseBodyOfPart:(id<NGMimePart>)_part
34   data:(NSData *)_data
35   delegate:(id)_delegate;
36
37 @end
38
39 @interface NGMimeBodyParser : NSObject < NGMimeBodyParser >
40 @end
41
42 @interface NGMimeTextBodyParser : NGMimeBodyParser
43 @end
44
45 @class NGMimePartParser;
46 @class NGMimeMultipartBody;
47
48 /*
49   A multipart body is a part body that contains body-parts separated
50   by boundary lines.
51 */
52 @interface NGMimeMultipartBodyParser : NGMimeBodyParser
53
54 - (BOOL)parseBody:(NGMimeMultipartBody *)_body
55   ofMultipart:(id<NGMimePart>)_part
56   data:(NSData *)_data
57   delegate:(id)_d;
58
59 - (id<NGMimePart>)parseBodyPartWithData:(NSData *)_rawData
60   inMultipart:(id<NGMimePart>)_multipart
61   parser:(NGMimePartParser *)_parser; // usually a NGMimeBodyPartParser
62
63 @end
64
65 @interface NSObject(NGMimeMultipartBodyParserDelegate)
66
67 - (BOOL)multipartBodyParser:(NGMimeMultipartBodyParser *)_parser
68   immediatlyParseBodyOfMultipart:(id<NGMimePart>)_part
69   data:(NSData *)_data;
70
71 - (void)multipartBodyParser:(NGMimeMultipartBodyParser *)_parser
72   foundPrefix:(NSData *)_prefix
73   inMultipart:(id<NGMimePart>)_part;
74
75 - (void)multipartBodyParser:(NGMimeMultipartBodyParser *)_parser
76   foundSuffix:(NSData *)_suffix
77   inMultipart:(id<NGMimePart>)_part;
78
79 - (NGMimePartParser *)multipartBodyParser:(NGMimeMultipartBodyParser *)_parser
80   parserForEntity:(NSData *)_data
81   inMultipart:(id<NGMimePart>)_part;
82
83 @end
84
85 #endif /* __NGMime_NGMimeBodyParser_H__ */