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