]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/html/helpdata.h
Allow to customize wxGrid column auto-sizing.
[wxWidgets.git] / interface / wx / html / helpdata.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: html/helpdata.h
e54c96f1 3// Purpose: interface of wxHtmlHelpData
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
23324ae1
FM
7/////////////////////////////////////////////////////////////////////////////
8
90f011dc
RD
9/**
10 @class wxHtmlBookRecord
11
12 Helper class for wxHtmlHelpData
13*/
14class wxHtmlBookRecord
15{
16public:
17 wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
18 const wxString& title, const wxString& start);
19
20 wxString GetBookFile() const;
21 wxString GetTitle() const;
22 wxString GetStart() const;
23 wxString GetBasePath() const;
24
25 /* SetContentsRange: store in the bookrecord where in the index/contents lists the
26 * book's records are stored. This to facilitate searching in a specific book.
27 * This code will have to be revised when loading/removing books becomes dynamic.
28 * (as opposed to appending only)
29 * Note that storing index range is pointless, because the index is alphab. sorted. */
30 void SetContentsRange(int start, int end);
31 int GetContentsStart() const;
32 int GetContentsEnd() const;
33
34 void SetTitle(const wxString& title);
35 void SetBasePath(const wxString& path);
36 void SetStart(const wxString& start);
37
38 // returns full filename of page (which is part of the book),
39 // i.e. with book's basePath prepended. If page is already absolute
40 // path, basePath is _not_ prepended.
41 wxString GetFullPath(const wxString &page) const;
42};
43
44
45
46/**
47 @class wxHtmlHelpDataItem
48
49 Helper class for wxHtmlHelpData
50*/
51struct wxHtmlHelpDataItem
52{
53 wxHtmlHelpDataItem();
54
55 int level;
56 wxHtmlHelpDataItem *parent;
57 int id;
58 wxString name;
59 wxString page;
60 wxHtmlBookRecord *book;
61
62 // returns full filename of m_Page, i.e. with book's basePath prepended
63 wxString GetFullPath() const;
64
65 // returns item indented with spaces if it has level>1:
66 wxString GetIndentedName() const;
67};
68
69
70
71
23324ae1
FM
72/**
73 @class wxHtmlHelpData
7c913512 74
c87f263e
FM
75 This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
76 help items.
77
7c913512 78 It is internal class and should not be used directly - except for the case
23324ae1 79 you're writing your own HTML help controller.
7c913512 80
23324ae1 81 @library{wxhtml}
c87f263e 82 @category{help,html}
23324ae1
FM
83*/
84class wxHtmlHelpData : public wxObject
85{
86public:
87 /**
88 Constructor.
89 */
90 wxHtmlHelpData();
91
92 /**
c87f263e
FM
93 Adds new book.
94
95 @a book_url is URL (not filename!) of HTML help project (hhp) or ZIP file
96 that contains arbitrary number of .hhp projects (this zip file can have
97 either .zip or .htb extension, htb stands for "html book").
98
23324ae1
FM
99 Returns success.
100 */
101 bool AddBook(const wxString& book_url);
102
103 /**
104 Returns page's URL based on integer ID stored in project.
105 */
106 wxString FindPageById(int id);
107
108 /**
109 Returns page's URL based on its (file)name.
110 */
111 wxString FindPageByName(const wxString& page);
112
113 /**
114 Returns array with help books info.
115 */
5267aefd 116 const wxHtmlBookRecArray& GetBookRecArray() const;
23324ae1
FM
117
118 /**
119 Returns reference to array with contents entries.
120 */
5267aefd 121 const wxHtmlHelpDataItems& GetContentsArray() const;
23324ae1
FM
122
123 /**
124 Returns reference to array with index entries.
125 */
5267aefd 126 const wxHtmlHelpDataItems& GetIndexArray() const;
23324ae1
FM
127
128 /**
c87f263e 129 Sets the temporary directory where binary cached versions of MS HTML Workshop
23324ae1
FM
130 files will be stored. (This is turned off by default and you can enable
131 this feature by setting non-empty temp dir.)
132 */
133 void SetTempDir(const wxString& path);
134};
e54c96f1 135