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