]> err.no Git - sope/blob - sope-appserver/NGObjWeb/NGHttp/NGHttpMessage.h
increased element nesting depth
[sope] / sope-appserver / NGObjWeb / NGHttp / NGHttpMessage.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 __NGHttp_NGHttpMessage_H__
23 #define __NGHttp_NGHttpMessage_H__
24
25 #import <Foundation/NSObject.h>
26 #import <NGMime/NGPart.h>
27
28 @class NSString, NSArray;
29 @class NGHashMap;
30 @class NGMimeType;
31 @class NGHttpCookie;
32
33 // used in 'Accept-Encoding' and 'Content-Encoding'
34 extern NSString *NGHttpContentCoding_gzip;     // 'gzip'
35 extern NSString *NGHttpContentCoding_compress; // 'compress'
36 extern NSString *NGHttpContentCoding_deflate;  // 'deflate'
37 extern NSString *NGHttpContentCoding_identity; // 'identity'
38
39 // used in 'Transfer-Encoding'
40 extern NSString *NGHttpTransferCoding_chunked;  // 'chunked'
41 extern NSString *NGHttpTransferCoding_identity; // 'identity'
42 extern NSString *NGHttpTransferCoding_gzip;     // 'gzip'
43 extern NSString *NGHttpTransferCoding_compress; // 'compress'
44 extern NSString *NGHttpTransferCoding_deflate;  // 'deflate'
45
46 @interface NGHttpMessage : NSObject < NGPart, NGMimePart >
47 {
48 @protected
49   NGHashMap *header;
50   id        body;
51
52   // http enhancements
53   char      majorVersion;
54   char      minorVersion;
55 }
56
57 // accessors
58
59 - (NSString *)httpVersion;
60 - (char)majorVersion;
61 - (char)minorVersion;
62
63 // Cookies
64
65 - (NSArray *)cookies; // 'cookie' header
66 - (id)valueOfCookieWithName:(NSString *)_name;
67
68 - (void)addClientCookie:(NGHttpCookie *)_cookie; // 'Set-Cookie' header
69 - (NSArray *)clientCookies;
70
71 // headers
72
73 - (id)valueOfHeaderFieldWithName:(NSString *)_name;
74
75 // NGPart
76
77 - (NSEnumerator *)valuesOfHeaderFieldWithName:(NSString *)_name;
78 - (NSEnumerator *)headerFieldNames;
79
80 - (void)setBody:(id)_body;
81 - (id)body;
82
83 // NGMimePart
84
85 - (NGMimeType *)contentType;
86 - (NSString *)contentId;
87 - (NSArray *)contentLanguage;
88 - (NSString *)contentMd5;
89 - (NSString *)encoding;
90 - (NSString *)contentDescription;
91
92 // headers
93
94 - (void)setValue:(id)_value ofHeaderFieldWithName:(NSString *)_name;
95 - (void)addValue:(id)_value toHeaderFieldWithName:(NSString *)_name;
96 - (void)removeValue:(id)_value fromHeaderFieldWithName:(NSString *)_name;
97   
98 - (void)setContentType:(NGMimeType *)_type;
99 - (void)setContentLength:(unsigned)_length;
100 - (unsigned)contentLength;
101
102 @end
103
104 #endif /* __NGHttp_NGHttpMessage_H__ */