1 /////////////////////////////////////////////////////////////////////////////
2 // Name: html/helpdata.h
3 // Purpose: interface of wxHtmlHelpData
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxHtmlBookRecord
11 Helper class for wxHtmlHelpData
13 class wxHtmlBookRecord
16 wxHtmlBookRecord(const wxString
& bookfile
, const wxString
& basepath
,
17 const wxString
& title
, const wxString
& start
);
19 wxString
GetBookFile() const;
20 wxString
GetTitle() const;
21 wxString
GetStart() const;
22 wxString
GetBasePath() const;
24 /* SetContentsRange: store in the bookrecord where in the index/contents lists the
25 * book's records are stored. This to facilitate searching in a specific book.
26 * This code will have to be revised when loading/removing books becomes dynamic.
27 * (as opposed to appending only)
28 * Note that storing index range is pointless, because the index is alphab. sorted. */
29 void SetContentsRange(int start
, int end
);
30 int GetContentsStart() const;
31 int GetContentsEnd() const;
33 void SetTitle(const wxString
& title
);
34 void SetBasePath(const wxString
& path
);
35 void SetStart(const wxString
& start
);
37 // returns full filename of page (which is part of the book),
38 // i.e. with book's basePath prepended. If page is already absolute
39 // path, basePath is _not_ prepended.
40 wxString
GetFullPath(const wxString
&page
) const;
46 @class wxHtmlHelpDataItem
48 Helper class for wxHtmlHelpData
50 struct wxHtmlHelpDataItem
55 wxHtmlHelpDataItem
*parent
;
59 wxHtmlBookRecord
*book
;
61 // returns full filename of m_Page, i.e. with book's basePath prepended
62 wxString
GetFullPath() const;
64 // returns item indented with spaces if it has level>1:
65 wxString
GetIndentedName() const;
74 This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
77 It is internal class and should not be used directly - except for the case
78 you're writing your own HTML help controller.
83 class wxHtmlHelpData
: public wxObject
94 @a book_url is URL (not filename!) of HTML help project (hhp) or ZIP file
95 that contains arbitrary number of .hhp projects (this zip file can have
96 either .zip or .htb extension, htb stands for "html book").
100 bool AddBook(const wxString
& book_url
);
103 Returns page's URL based on integer ID stored in project.
105 wxString
FindPageById(int id
);
108 Returns page's URL based on its (file)name.
110 wxString
FindPageByName(const wxString
& page
);
113 Returns array with help books info.
115 const wxHtmlBookRecArray
& GetBookRecArray() const;
118 Returns reference to array with contents entries.
120 const wxHtmlHelpDataItems
& GetContentsArray() const;
123 Returns reference to array with index entries.
125 const wxHtmlHelpDataItems
& GetIndexArray() const;
128 Sets the temporary directory where binary cached versions of MS HTML Workshop
129 files will be stored. (This is turned off by default and you can enable
130 this feature by setting non-empty temp dir.)
132 void SetTempDir(const wxString
& path
);