2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: html/helpdata.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxHtmlHelpData
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-11-01 18:56:13 -04:00
|
|
|
/**
|
|
|
|
@class wxHtmlBookRecord
|
|
|
|
|
|
|
|
Helper class for wxHtmlHelpData
|
|
|
|
*/
|
|
|
|
class wxHtmlBookRecord
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
|
|
|
|
const wxString& title, const wxString& start);
|
|
|
|
|
|
|
|
wxString GetBookFile() const;
|
|
|
|
wxString GetTitle() const;
|
|
|
|
wxString GetStart() const;
|
|
|
|
wxString GetBasePath() const;
|
|
|
|
|
|
|
|
/* SetContentsRange: store in the bookrecord where in the index/contents lists the
|
|
|
|
* book's records are stored. This to facilitate searching in a specific book.
|
|
|
|
* This code will have to be revised when loading/removing books becomes dynamic.
|
|
|
|
* (as opposed to appending only)
|
|
|
|
* Note that storing index range is pointless, because the index is alphab. sorted. */
|
|
|
|
void SetContentsRange(int start, int end);
|
|
|
|
int GetContentsStart() const;
|
|
|
|
int GetContentsEnd() const;
|
|
|
|
|
|
|
|
void SetTitle(const wxString& title);
|
|
|
|
void SetBasePath(const wxString& path);
|
|
|
|
void SetStart(const wxString& start);
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxHtmlHelpDataItem
|
|
|
|
|
|
|
|
Helper class for wxHtmlHelpData
|
|
|
|
*/
|
|
|
|
struct wxHtmlHelpDataItem
|
|
|
|
{
|
|
|
|
wxHtmlHelpDataItem();
|
|
|
|
|
|
|
|
int level;
|
|
|
|
wxHtmlHelpDataItem *parent;
|
|
|
|
int id;
|
|
|
|
wxString name;
|
|
|
|
wxString page;
|
|
|
|
wxHtmlBookRecord *book;
|
|
|
|
|
|
|
|
// returns full filename of m_Page, i.e. with book's basePath prepended
|
|
|
|
wxString GetFullPath() const;
|
|
|
|
|
|
|
|
// returns item indented with spaces if it has level>1:
|
|
|
|
wxString GetIndentedName() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlHelpData
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-23 09:55:07 -04:00
|
|
|
This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
|
|
|
|
help items.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
It is internal class and should not be used directly - except for the case
|
2008-03-08 08:52:38 -05:00
|
|
|
you're writing your own HTML help controller.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-23 09:55:07 -04:00
|
|
|
@category{help,html}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlHelpData : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxHtmlHelpData();
|
|
|
|
|
|
|
|
/**
|
2008-10-23 09:55:07 -04:00
|
|
|
Adds new book.
|
|
|
|
|
|
|
|
@a book_url is URL (not filename!) of HTML help project (hhp) or ZIP file
|
|
|
|
that contains arbitrary number of .hhp projects (this zip file can have
|
|
|
|
either .zip or .htb extension, htb stands for "html book").
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Returns success.
|
|
|
|
*/
|
|
|
|
bool AddBook(const wxString& book_url);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns page's URL based on integer ID stored in project.
|
|
|
|
*/
|
|
|
|
wxString FindPageById(int id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns page's URL based on its (file)name.
|
|
|
|
*/
|
|
|
|
wxString FindPageByName(const wxString& page);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns array with help books info.
|
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
const wxHtmlBookRecArray& GetBookRecArray() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns reference to array with contents entries.
|
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
const wxHtmlHelpDataItems& GetContentsArray() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns reference to array with index entries.
|
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
const wxHtmlHelpDataItems& GetIndexArray() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-23 09:55:07 -04:00
|
|
|
Sets the temporary directory where binary cached versions of MS HTML Workshop
|
2008-03-08 08:52:38 -05:00
|
|
|
files will be stored. (This is turned off by default and you can enable
|
|
|
|
this feature by setting non-empty temp dir.)
|
|
|
|
*/
|
|
|
|
void SetTempDir(const wxString& path);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|