]> err.no Git - sope/blob - sope-mime/NGMime/NGMimeType.h
fixed library version
[sope] / sope-mime / NGMime / NGMimeType.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 __NGMime_NGMimeType_H__
24 #define __NGMime_NGMimeType_H__
25
26 #import <Foundation/NSObject.h>
27 #import <Foundation/NSString.h>
28 #include <NGMime/NGMimeDecls.h>
29
30 @class NSDictionary, NSString, NSEnumerator;
31
32 // type & parameter constants
33
34 NGMime_EXPORT NSString *NGMimeTypeText;
35 NGMime_EXPORT NSString *NGMimeTypeAudio;
36 NGMime_EXPORT NSString *NGMimeTypeVideo;
37 NGMime_EXPORT NSString *NGMimeTypeImage;
38 NGMime_EXPORT NSString *NGMimeTypeApplication;
39 NGMime_EXPORT NSString *NGMimeTypeMultipart;
40 NGMime_EXPORT NSString *NGMimeTypeMessage;
41
42 NGMime_EXPORT NSString *NGMimeParameterTextCharset;
43
44 /*
45   NGMimeType is a class cluster
46 */
47
48 @interface NGMimeType : NSObject < NSCoding, NSCopying >
49 {
50 }
51
52 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType;
53 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType
54   parameters:(NSDictionary *)_parameters;
55
56 + (id)mimeType:(NSString *)_stringValue;
57
58 + (NSStringEncoding)stringEncodingForCharset:(NSString *)_s;
59
60 /* type */
61
62 - (NSString *)type;
63 - (NSString *)subType;
64 - (BOOL)isCompositeType;
65
66 /* comparing types */
67
68 - (BOOL)isEqualToMimeType:(NGMimeType *)_type;
69 - (BOOL)isEqual:(id)_other;
70 - (BOOL)hasSameGeneralType:(NGMimeType *)_other; // only the 'type' must match
71 - (BOOL)hasSameType:(NGMimeType *)_other;        // parameters need not match
72 - (BOOL)doesMatchType:(NGMimeType *)_other;      // interpretes wildcards
73
74 // parameters
75
76 - (NSEnumerator *)parameterNames;
77 - (id)valueOfParameter:(NSString *)_parameterName;
78
79 // representations
80
81 - (NSDictionary *)parametersAsDictionary;
82 - (NSString *)parametersAsString;
83 - (BOOL)valueNeedsQuotes:(NSString *)_parameterValue;
84
85 - (NSString *)stringValue;
86
87 @end
88
89 #endif /* __NGMime_NGMimeType_H__ */