X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7dc3cc31af71522b8fc55b7f97bcba7f5ef9eac5..399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 7d09acec8b..e78a77cac0 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/mimetype.cpp +// Name: msw/mimetype.cpp // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: @@ -20,11 +20,8 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - -#if (wxUSE_FILE && wxUSE_TEXTFILE) || defined(__WXMSW__) +// Doesn't compile in WIN16 mode +#ifndef __WIN16__ #ifndef WX_PRECOMP #include "wx/string.h" @@ -33,9 +30,6 @@ #endif #endif //WX_PRECOMP -// Doesn't compile in WIN16 mode -#ifndef __WIN16__ - #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" @@ -45,12 +39,6 @@ #ifdef __WXMSW__ #include "wx/msw/registry.h" #include "windows.h" -#elif defined(__UNIX__) || defined(__WXPM__) - #include "wx/ffile.h" - #include "wx/textfile.h" - #include "wx/dir.h" - #include "wx/utils.h" - #include "wx/tokenzr.h" #endif // OS #include "wx/msw/mimetype.h" @@ -61,7 +49,6 @@ // in case we're compiling in non-GUI mode class WXDLLEXPORT wxIcon; - // These classes use Windows registry to retrieve the required information. // // Keys used (not all of them are documented, so it might actually stop working @@ -86,9 +73,6 @@ class WXDLLEXPORT wxIcon; // location, uses it, so it isn't likely to change static const wxChar *MIME_DATABASE_KEY = wxT("MIME\\Database\\Content Type\\"); - - - wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const { // suppress possible error messages @@ -133,6 +117,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const } } +#if wxUSE_DDE // look whether we must issue some DDE requests to the application // (and not just launch it) strKey += _T("\\DDEExec"); @@ -155,7 +140,9 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const << _T('#') << ddeTopic << _T('#') << ddeCommand; } - else if ( !foundFilename ) { + else +#endif // wxUSE_DDE + if ( !foundFilename ) { // we didn't find any '%1' - the application doesn't know which // file to open (note that we only do it if there is no DDEExec // subkey) @@ -248,6 +235,22 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const } } + +bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const +{ + wxString s; + + if (GetMimeType(&s)) + { + mimeTypes.Clear(); + mimeTypes.Add(s); + return TRUE; + } + else + return FALSE; +} + + bool wxFileTypeImpl::GetIcon(wxIcon *icon) const { #if wxUSE_GUI @@ -444,8 +447,5 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) } -#endif - // wxUSE_FILE && wxUSE_TEXTFILE - #endif // __WIN16__