X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9749497156909657d17ef972857caaca4bd09da2..ef094fa075bc56bcbc33b12159c395ea28afda3b:/include/wx/html/helpdata.h diff --git a/include/wx/html/helpdata.h b/include/wx/html/helpdata.h index dd7135f7d2..0c110f0a20 100644 --- a/include/wx/html/helpdata.h +++ b/include/wx/html/helpdata.h @@ -12,7 +12,7 @@ #ifndef _WX_HELPDATA_H_ #define _WX_HELPDATA_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "helpdata.h" #endif @@ -32,18 +32,20 @@ class WXDLLEXPORT wxHtmlHelpData; // helper classes & structs //-------------------------------------------------------------------------------- -class WXDLLEXPORT wxHtmlBookRecord : public wxObject +class WXDLLEXPORT wxHtmlBookRecord { public: - wxHtmlBookRecord(const wxString& basepath, const wxString& title, - const wxString& start) + wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, + const wxString& title, const wxString& start) { + m_BookFile = bookfile; m_BasePath = basepath; m_Title = title; m_Start = start; // for debugging, give the contents index obvious default values m_ContentsStart = m_ContentsEnd = -1; } + wxString GetBookFile() const { return m_BookFile; } wxString GetTitle() const { return m_Title; } wxString GetStart() const { return m_Start; } wxString GetBasePath() const { return m_BasePath; } @@ -60,7 +62,13 @@ public: void SetBasePath(const wxString& path) { m_BasePath = path; } void SetStart(const wxString& start) { m_Start = start; } + // returns full filename of page (which is part of the book), + // i.e. with book's basePath prepended. If page is already absolute + // path, basePath is _not_ prepended. + wxString GetFullPath(const wxString &page) const; + protected: + wxString m_BookFile; wxString m_BasePath; wxString m_Title; wxString m_Start; @@ -79,31 +87,36 @@ struct wxHtmlContentsItem wxChar* m_Name; wxChar* m_Page; wxHtmlBookRecord *m_Book; + + // returns full filename of m_Page, i.e. with book's basePath prepended + wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); } }; //------------------------------------------------------------------------------ -// wxSearchEngine +// wxHtmlSearchEngine // This class takes input streams and scans them for occurence // of keyword(s) //------------------------------------------------------------------------------ -class WXDLLEXPORT wxSearchEngine : public wxObject +class WXDLLEXPORT wxHtmlSearchEngine : public wxObject { public: - wxSearchEngine() : wxObject() {m_Keyword = NULL; } - ~wxSearchEngine() {if (m_Keyword) delete[] m_Keyword; } + wxHtmlSearchEngine() : wxObject() {m_Keyword = NULL; } + ~wxHtmlSearchEngine() {if (m_Keyword) delete[] m_Keyword; } // Sets the keyword we will be searching for virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only); // Scans the stream for the keyword. // Returns TRUE if the stream contains keyword, fALSE otherwise - virtual bool Scan(wxInputStream *stream); + virtual bool Scan(const wxFSFile& file); private: wxChar *m_Keyword; bool m_CaseSensitive; bool m_WholeWords; + + DECLARE_NO_COPY_CLASS(wxHtmlSearchEngine) }; @@ -128,7 +141,7 @@ public: private: wxHtmlHelpData* m_Data; - wxSearchEngine m_Engine; + wxHtmlSearchEngine m_Engine; wxString m_Keyword, m_Name; wxChar *m_LastPage; wxHtmlContentsItem* m_ContentsItem; @@ -136,6 +149,8 @@ private: int m_CurIndex; // where we are now int m_MaxIndex; // number of files we search // For progress bar: 100*curindex/maxindex = % complete + + DECLARE_NO_COPY_CLASS(wxHtmlSearchStatus) }; class WXDLLEXPORT wxHtmlHelpData : public wxObject @@ -194,10 +209,9 @@ protected: bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f); // Writes binary book bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f); -}; -// Utility function -wxString wxAddBasePath(const wxString& basePath, const wxString& path) ; + DECLARE_NO_COPY_CLASS(wxHtmlHelpData) +}; #endif