1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/mimetype.h
3 // Purpose: classes and functions to manage MIME types
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license (part of wxExtra library)
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _MIMETYPE_IMPL_H
13 #define _MIMETYPE_IMPL_H
17 #include "wx/mimetype.h"
21 class wxMimeTypesManagerImpl
24 wxMimeTypesManagerImpl() { }
26 // implement containing class functions
27 wxFileType
*GetFileTypeFromExtension(const wxString
& ext
);
28 wxFileType
*GetFileTypeFromMimeType(const wxString
& mimeType
);
30 size_t EnumAllFileTypes(wxArrayString
& mimetypes
);
32 // this are NOPs under MacOS
33 bool ReadMailcap(const wxString
& filename
, bool fallback
= TRUE
) { return TRUE
; }
34 bool ReadMimeTypes(const wxString
& filename
) { return TRUE
; }
36 void AddFallback(const wxFileTypeInfo
& ft
) { m_fallbacks
.Add(ft
); }
39 wxArrayFileTypeInfo m_fallbacks
;
45 // initialize us with our file type name
46 void SetFileType(const wxString
& strFileType
)
47 { m_strFileType
= strFileType
; }
48 void SetExt(const wxString
& ext
)
51 // implement accessor functions
52 bool GetExtensions(wxArrayString
& extensions
);
53 bool GetMimeType(wxString
*mimeType
) const;
54 bool GetMimeTypes(wxArrayString
& mimeTypes
) const;
55 bool GetIcon(wxIcon
*icon
) const;
56 bool GetDescription(wxString
*desc
) const;
57 bool GetOpenCommand(wxString
*openCmd
,
58 const wxFileType::MessageParameters
&) const
59 { return GetCommand(openCmd
, "open"); }
60 bool GetPrintCommand(wxString
*printCmd
,
61 const wxFileType::MessageParameters
&) const
62 { return GetCommand(printCmd
, "print"); }
66 bool GetCommand(wxString
*command
, const char *verb
) const;
68 wxString m_strFileType
, m_ext
;
76 /* vi: set cin tw=80 ts=4 sw=4: */