// Purpose: wxHtmlHelpData
// Notes: Based on htmlhelp.cpp, implementing a monolithic
// HTML Help controller class, by Vaclav Slavik
// Author: Harm van der Heijden and Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) Harm van der Heijden and Vaclav Slavik
// Purpose: wxHtmlHelpData
// Notes: Based on htmlhelp.cpp, implementing a monolithic
// HTML Help controller class, by Vaclav Slavik
// Author: Harm van der Heijden and Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) Harm van der Heijden and Vaclav Slavik
//--------------------------------------------------------------------------------
// helper classes & structs
//--------------------------------------------------------------------------------
// helper classes & structs
void SetBasePath(const wxString& path) { m_BasePath = path; }
void SetStart(const wxString& start) { m_Start = start; }
void SetBasePath(const wxString& path) { m_BasePath = path; }
void SetStart(const wxString& start) { m_Start = start; }
- // returns full filename of page (which is part of the book),
- // i.e. with book's basePath prepended. If page is already absolute
+ // 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;
// path, basePath is _not_ prepended.
wxString GetFullPath(const wxString &page) const;
- short int m_Level;
- int m_ID;
- wxChar* m_Name;
- wxChar* m_Page;
- wxHtmlBookRecord *m_Book;
-
+ wxHtmlHelpDataItem() : level(0), parent(NULL), id(wxID_ANY), book(NULL) {}
+
+ int level;
+ wxHtmlHelpDataItem *parent;
+ int id;
+ wxString name;
+ wxString page;
+ wxHtmlBookRecord *book;
+
- wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); }
+ wxString GetFullPath() const { return book->GetFullPath(page); }
+
+ // returns item indented with spaces if it has level>1:
+ wxString GetIndentedName() const;
// of keyword(s)
//------------------------------------------------------------------------------
class WXDLLIMPEXP_HTML wxHtmlSearchEngine : public wxObject
{
public:
// of keyword(s)
//------------------------------------------------------------------------------
class WXDLLIMPEXP_HTML wxHtmlSearchEngine : public wxObject
{
public:
// Sets the keyword we will be searching for
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword.
// Sets the keyword we will be searching for
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword.
-// State information of a search action. I'd have prefered to make this a nested
-// class inside wxHtmlHelpData, but that's against coding standards :-(
+// State information of a search action. I'd have preferred to make this a
+// nested class inside wxHtmlHelpData, but that's against coding standards :-(
// Never construct this class yourself, obtain a copy from
// wxHtmlHelpData::PrepareKeywordSearch(const wxString& key)
class WXDLLIMPEXP_HTML wxHtmlSearchStatus
// Never construct this class yourself, obtain a copy from
// wxHtmlHelpData::PrepareKeywordSearch(const wxString& key)
class WXDLLIMPEXP_HTML wxHtmlSearchStatus
int GetCurIndex() { return m_CurIndex; }
int GetMaxIndex() { return m_MaxIndex; }
const wxString& GetName() { return m_Name; }
int GetCurIndex() { return m_CurIndex; }
int GetMaxIndex() { return m_MaxIndex; }
const wxString& GetName() { return m_Name; }
private:
wxHtmlHelpData* m_Data;
wxHtmlSearchEngine m_Engine;
wxString m_Keyword, m_Name;
private:
wxHtmlHelpData* m_Data;
wxHtmlSearchEngine m_Engine;
wxString m_Keyword, m_Name;
bool m_Active; // search is not finished
int m_CurIndex; // where we are now
int m_MaxIndex; // number of files we search
// For progress bar: 100*curindex/maxindex = % complete
bool m_Active; // search is not finished
int m_CurIndex; // where we are now
int m_MaxIndex; // number of files we search
// For progress bar: 100*curindex/maxindex = % complete
// Sets directory where temporary files are stored.
// These temp files are index & contents file in binary (much faster to read)
// Sets directory where temporary files are stored.
// These temp files are index & contents file in binary (much faster to read)
- const wxHtmlBookRecArray& GetBookRecArray() { return m_BookRecords; }
- wxHtmlContentsItem* GetContents() { return m_Contents; }
- int GetContentsCnt() { return m_ContentsCnt; }
- wxHtmlContentsItem* GetIndex() { return m_Index; }
- int GetIndexCnt() { return m_IndexCnt; }
+ const wxHtmlBookRecArray& GetBookRecArray() const { return m_bookRecords; }
+
+ const wxHtmlHelpDataItems& GetContentsArray() const { return m_contents; }
+ const wxHtmlHelpDataItems& GetIndexArray() const { return m_index; }
- wxHtmlContentsItem* m_Contents;
- int m_ContentsCnt;
- wxHtmlContentsItem* m_Index; // list of all available books and pages.
- int m_IndexCnt; // list of index items
+ wxHtmlBookRecArray m_bookRecords;
+
+ wxHtmlHelpDataItems m_contents; // list of all available books and pages
+ wxHtmlHelpDataItems m_index; // list of index itesm