2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
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.
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
23 #ifndef __NGMime_NGMimeType_H__
24 #define __NGMime_NGMimeType_H__
26 #import <Foundation/NSObject.h>
27 #import <Foundation/NSString.h>
28 #include <NGMime/NGMimeDecls.h>
30 @class NSDictionary, NSString, NSEnumerator;
32 // type & parameter constants
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;
42 NGMime_EXPORT NSString *NGMimeParameterTextCharset;
45 NGMimeType is a class cluster
48 @interface NGMimeType : NSObject < NSCoding, NSCopying >
52 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType;
53 + (id)mimeType:(NSString *)_type subType:(NSString *)_subType
54 parameters:(NSDictionary *)_parameters;
56 + (id)mimeType:(NSString *)_stringValue;
58 + (NSStringEncoding)stringEncodingForCharset:(NSString *)_s;
63 - (NSString *)subType;
64 - (BOOL)isCompositeType;
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
76 - (NSEnumerator *)parameterNames;
77 - (id)valueOfParameter:(NSString *)_parameterName;
81 - (NSDictionary *)parametersAsDictionary;
82 - (NSString *)parametersAsString;
83 - (BOOL)valueNeedsQuotes:(NSString *)_parameterValue;
85 - (NSString *)stringValue;
89 #endif /* __NGMime_NGMimeType_H__ */