]> git.saurik.com Git - wxWidgets.git/blame_incremental - interface/wx/html/helpdata.h
Implement setFont on the iOS port of wxStaticText.
[wxWidgets.git] / interface / wx / html / helpdata.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: html/helpdata.h
3// Purpose: interface of wxHtmlHelpData
4// Author: wxWidgets team
5// Licence: wxWindows licence
6/////////////////////////////////////////////////////////////////////////////
7
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
71/**
72 @class wxHtmlHelpData
73
74 This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
75 help items.
76
77 It is internal class and should not be used directly - except for the case
78 you're writing your own HTML help controller.
79
80 @library{wxhtml}
81 @category{help,html}
82*/
83class wxHtmlHelpData : public wxObject
84{
85public:
86 /**
87 Constructor.
88 */
89 wxHtmlHelpData();
90
91 /**
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
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 */
115 const wxHtmlBookRecArray& GetBookRecArray() const;
116
117 /**
118 Returns reference to array with contents entries.
119 */
120 const wxHtmlHelpDataItems& GetContentsArray() const;
121
122 /**
123 Returns reference to array with index entries.
124 */
125 const wxHtmlHelpDataItems& GetIndexArray() const;
126
127 /**
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.)
131 */
132 void SetTempDir(const wxString& path);
133};
134