2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
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
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.
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
22 #ifndef __NGMime_NGMimeType_H__
23 #define __NGMime_NGMimeType_H__
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSString.h>
27 #include <NGMime/NGMimeDecls.h>
29 @class NSDictionary, NSString, NSEnumerator;
31 // type & parameter constants
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;
41 NGMime_EXPORT NSString *NGMimeParameterTextCharset;
44 NGMimeType is a class cluster
47 @interface NGMimeType : NSObject < NSCoding, NSCopying >
51 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType;
52 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType
53 parameters:(NSDictionary *)_parameters;
55 + (id)mimeType:(NSString *)_stringValue;
57 + (NSStringEncoding)stringEncodingForCharset:(NSString *)_s;
62 - (NSString *)subType;
63 - (BOOL)isCompositeType;
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
75 - (NSEnumerator *)parameterNames;
76 - (id)valueOfParameter:(NSString *)_parameterName;
80 - (NSDictionary *)parametersAsDictionary;
81 - (NSString *)parametersAsString;
82 - (BOOL)valueNeedsQuotes:(NSString *)_parameterValue;
84 - (NSString *)stringValue;
88 #endif /* __NGMime_NGMimeType_H__ */