X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c87f263ea51962916f0a4e392b448497d9c94dbf..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/html/helpdata.h?ds=inline diff --git a/interface/wx/html/helpdata.h b/interface/wx/html/helpdata.h index 70e388de71..36537406b0 100644 --- a/interface/wx/html/helpdata.h +++ b/interface/wx/html/helpdata.h @@ -2,10 +2,72 @@ // Name: html/helpdata.h // Purpose: interface of wxHtmlHelpData // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + @class wxHtmlBookRecord + + Helper class for wxHtmlHelpData +*/ +class wxHtmlBookRecord +{ +public: + wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, + const wxString& title, const wxString& start); + + wxString GetBookFile() const; + wxString GetTitle() const; + wxString GetStart() const; + wxString GetBasePath() const; + + /* SetContentsRange: store in the bookrecord where in the index/contents lists the + * book's records are stored. This to facilitate searching in a specific book. + * This code will have to be revised when loading/removing books becomes dynamic. + * (as opposed to appending only) + * Note that storing index range is pointless, because the index is alphab. sorted. */ + void SetContentsRange(int start, int end); + int GetContentsStart() const; + int GetContentsEnd() const; + + void SetTitle(const wxString& title); + void SetBasePath(const wxString& path); + void SetStart(const wxString& 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; +}; + + + +/** + @class wxHtmlHelpDataItem + + Helper class for wxHtmlHelpData +*/ +struct wxHtmlHelpDataItem +{ + wxHtmlHelpDataItem(); + + int level; + wxHtmlHelpDataItem *parent; + int id; + wxString name; + wxString page; + wxHtmlBookRecord *book; + + // returns full filename of m_Page, i.e. with book's basePath prepended + wxString GetFullPath() const; + + // returns item indented with spaces if it has level>1: + wxString GetIndentedName() const; +}; + + + + /** @class wxHtmlHelpData @@ -50,17 +112,17 @@ public: /** Returns array with help books info. */ - const wxHtmlBookRecArray GetBookRecArray(); + const wxHtmlBookRecArray& GetBookRecArray() const; /** Returns reference to array with contents entries. */ - const wxHtmlHelpDataItems GetContentsArray(); + const wxHtmlHelpDataItems& GetContentsArray() const; /** Returns reference to array with index entries. */ - const wxHtmlHelpDataItems GetIndexArray(); + const wxHtmlHelpDataItems& GetIndexArray() const; /** Sets the temporary directory where binary cached versions of MS HTML Workshop