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
16 #pragma interface "mimetype.h"
20 #include "wx/mimetype.h"
23 class wxMimeTypesManagerImpl
26 wxMimeTypesManagerImpl() { }
28 ~wxMimeTypesManagerImpl() { }
31 // implement containing class functions
32 wxFileType
*GetFileTypeFromExtension(const wxString
& ext
);
33 wxFileType
*GetOrAllocateFileTypeFromExtension(const wxString
& ext
) ;
34 wxFileType
*GetFileTypeFromMimeType(const wxString
& mimeType
);
36 size_t EnumAllFileTypes(wxArrayString
& mimetypes
);
38 // this are NOPs under MacOS
39 bool ReadMailcap(const wxString
& filename
, bool fallback
= TRUE
) { return TRUE
; }
40 bool ReadMimeTypes(const wxString
& filename
) { return TRUE
; }
42 void AddFallback(const wxFileTypeInfo
& ft
) { m_fallbacks
.Add(ft
); }
44 // create a new filetype association
45 wxFileType
*Associate(const wxFileTypeInfo
& ftInfo
);
47 // create a new filetype with the given name and extension
48 wxFileType
*CreateFileType(const wxString
& filetype
, const wxString
& ext
);
51 wxArrayFileTypeInfo m_fallbacks
;
57 // initialize us with our file type name
58 void SetFileType(const wxString
& strFileType
)
59 { m_strFileType
= strFileType
; }
60 void SetExt(const wxString
& ext
)
63 // implement accessor functions
64 bool GetExtensions(wxArrayString
& extensions
);
65 bool GetMimeType(wxString
*mimeType
) const;
66 bool GetMimeTypes(wxArrayString
& mimeTypes
) const;
67 bool GetIcon(wxIcon
*icon
) const;
68 bool GetDescription(wxString
*desc
) const;
69 bool GetOpenCommand(wxString
*openCmd
,
70 const wxFileType::MessageParameters
&) const
71 { return GetCommand(openCmd
, "open"); }
72 bool GetPrintCommand(wxString
*printCmd
,
73 const wxFileType::MessageParameters
&) const
74 { return GetCommand(printCmd
, "print"); }
76 size_t GetAllCommands(wxArrayString
* verbs
, wxArrayString
* commands
,
77 const wxFileType::MessageParameters
& params
) const;
83 bool GetCommand(wxString
*command
, const char *verb
) const;
85 wxString m_strFileType
, m_ext
;
93 /* vi: set cin tw=80 ts=4 sw=4: */