X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0219e4580a925de871080b703d14504c96ad3d6..5c14ec264057d86fe60b2bacc09965492652cc0f:/include/wx/filehistory.h?ds=sidebyside diff --git a/include/wx/filehistory.h b/include/wx/filehistory.h index 2d86e064fb..ea37948686 100644 --- a/include/wx/filehistory.h +++ b/include/wx/filehistory.h @@ -23,15 +23,16 @@ class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_BASE wxConfigBase; +class WXDLLIMPEXP_FWD_BASE wxFileName; // ---------------------------------------------------------------------------- // File history management // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxFileHistory : public wxObject +class WXDLLIMPEXP_CORE wxFileHistoryBase : public wxObject { public: - wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1); + wxFileHistoryBase(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1); // Operations virtual void AddFileToHistory(const wxString& file); @@ -79,17 +80,35 @@ private: // The ID of the first history menu item (Doesn't have to be wxID_FILE1) wxWindowID m_idBase; - DECLARE_DYNAMIC_CLASS(wxFileHistory) - wxDECLARE_NO_COPY_CLASS(wxFileHistory); + // Normalize a file name to canonical form. We have a special function for + // this to ensure the same normalization is used everywhere. + static wxString NormalizeFileName(const wxFileName& filename); + + wxDECLARE_NO_COPY_CLASS(wxFileHistoryBase); }; #if WXWIN_COMPATIBILITY_2_6 -inline size_t wxFileHistory::GetNoHistoryFiles() const +inline size_t wxFileHistoryBase::GetNoHistoryFiles() const { return m_fileHistory.GetCount(); } #endif // WXWIN_COMPATIBILITY_2_6 + +#if defined(__WXGTK20__) + #include "wx/gtk/filehistory.h" +#else + // no platform-specific implementation of wxFileHistory yet + class WXDLLIMPEXP_CORE wxFileHistory : public wxFileHistoryBase + { + public: + wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1) + : wxFileHistoryBase(maxFiles, idBase) {} + + DECLARE_DYNAMIC_CLASS(wxFileHistory) + }; +#endif + #endif // wxUSE_FILE_HISTORY #endif // _WX_FILEHISTORY_H_