]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/html/helpdata.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / interface / wx / html / helpdata.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: html/helpdata.h
e54c96f1 3// Purpose: interface of wxHtmlHelpData
23324ae1 4// Author: wxWidgets team
526954c5 5// Licence: wxWindows licence
23324ae1
FM
6/////////////////////////////////////////////////////////////////////////////
7
90f011dc
RD
8/**
9 @class wxHtmlBookRecord
10
11 Helper class for wxHtmlHelpData
12*/
13class wxHtmlBookRecord
14{
15public:
16 wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
17 const wxString& title, const wxString& start);
18
19 wxString GetBookFile() const;
20 wxString GetTitle() const;
21 wxString GetStart() const;
22 wxString GetBasePath() const;
23
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;
32
33 void SetTitle(const wxString& title);
34 void SetBasePath(const wxString& path);
35 void SetStart(const wxString& start);
36
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;
41};
42
43
44
45/**
46 @class wxHtmlHelpDataItem
47
48 Helper class for wxHtmlHelpData
49*/
50struct wxHtmlHelpDataItem
51{
52 wxHtmlHelpDataItem();
53
54 int level;
55 wxHtmlHelpDataItem *parent;
56 int id;
57 wxString name;
58 wxString page;
59 wxHtmlBookRecord *book;
60
61 // returns full filename of m_Page, i.e. with book's basePath prepended
62 wxString GetFullPath() const;
63
64 // returns item indented with spaces if it has level>1:
65 wxString GetIndentedName() const;
66};
67
68
69
70
23324ae1
FM
71/**
72 @class wxHtmlHelpData
7c913512 73
c87f263e
FM
74 This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
75 help items.
76
7c913512 77 It is internal class and should not be used directly - except for the case
23324ae1 78 you're writing your own HTML help controller.
7c913512 79
23324ae1 80 @library{wxhtml}
c87f263e 81 @category{help,html}
23324ae1
FM
82*/
83class wxHtmlHelpData : public wxObject
84{
85public:
86 /**
87 Constructor.
88 */
89 wxHtmlHelpData();
90
91 /**
c87f263e
FM
92 Adds new book.
93
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").
97
23324ae1
FM
98 Returns success.
99 */
100 bool AddBook(const wxString& book_url);
101
102 /**
103 Returns page's URL based on integer ID stored in project.
104 */
105 wxString FindPageById(int id);
106
107 /**
108 Returns page's URL based on its (file)name.
109 */
110 wxString FindPageByName(const wxString& page);
111
112 /**
113 Returns array with help books info.
114 */
5267aefd 115 const wxHtmlBookRecArray& GetBookRecArray() const;
23324ae1
FM
116
117 /**
118 Returns reference to array with contents entries.
119 */
5267aefd 120 const wxHtmlHelpDataItems& GetContentsArray() const;
23324ae1
FM
121
122 /**
123 Returns reference to array with index entries.
124 */
5267aefd 125 const wxHtmlHelpDataItems& GetIndexArray() const;
23324ae1
FM
126
127 /**
c87f263e 128 Sets the temporary directory where binary cached versions of MS HTML Workshop
23324ae1
FM
129 files will be stored. (This is turned off by default and you can enable
130 this feature by setting non-empty temp dir.)
131 */
132 void SetTempDir(const wxString& path);
133};
e54c96f1 134