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
*GetOrAllocateFileTypeFromExtension(const wxString
& ext
) ;
29 wxFileType
*GetFileTypeFromMimeType(const wxString
& mimeType
);
31 size_t EnumAllFileTypes(wxArrayString
& mimetypes
);
33 // this are NOPs under MacOS
34 bool ReadMailcap(const wxString
& filename
, bool fallback
= TRUE
) { return TRUE
; }
35 bool ReadMimeTypes(const wxString
& filename
) { return TRUE
; }
37 void AddFallback(const wxFileTypeInfo
& ft
) { m_fallbacks
.Add(ft
); }
39 // create a new filetype association
40 wxFileType
*Associate(const wxFileTypeInfo
& ftInfo
);
42 // create a new filetype with the given name and extension
43 wxFileType
*CreateFileType(const wxString
& filetype
, const wxString
& ext
);
46 wxArrayFileTypeInfo m_fallbacks
;
52 // initialize us with our file type name
53 void SetFileType(const wxString
& strFileType
)
54 { m_strFileType
= strFileType
; }
55 void SetExt(const wxString
& ext
)
58 // implement accessor functions
59 bool GetExtensions(wxArrayString
& extensions
);
60 bool GetMimeType(wxString
*mimeType
) const;
61 bool GetMimeTypes(wxArrayString
& mimeTypes
) const;
62 bool GetIcon(wxIcon
*icon
) const;
63 bool GetDescription(wxString
*desc
) const;
64 bool GetOpenCommand(wxString
*openCmd
,
65 const wxFileType::MessageParameters
&) const
66 { return GetCommand(openCmd
, "open"); }
67 bool GetPrintCommand(wxString
*printCmd
,
68 const wxFileType::MessageParameters
&) const
69 { return GetCommand(printCmd
, "print"); }
71 size_t GetAllCommands(wxArrayString
* verbs
, wxArrayString
* commands
,
72 const wxFileType::MessageParameters
& params
) const;
78 bool GetCommand(wxString
*command
, const char *verb
) const;
80 wxString m_strFileType
, m_ext
;
88 /* vi: set cin tw=80 ts=4 sw=4: */