1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG definitions of html classes
 
   7 // Created:     25-Nov-1998
 
   9 // Copyright:   (c) 1998 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  18 #include <wx/html/htmlwin.h>
 
  19 #include <wx/html/helpctrl.h>
 
  21 #include <wx/fs_zip.h>
 
  22 #include <wx/fs_inet.h>
 
  23 #include <wx/wfstream.h>
 
  26 //---------------------------------------------------------------------------
 
  28     // Put some wx default wxChar* values into wxStrings.
 
  29     static const wxString wxPyEmptyString(wxT(""));
 
  31 //---------------------------------------------------------------------------
 
  34 %include my_typemaps.i
 
  48 //---------------------------------------------------------------------------
 
  50 class wxHtmlBookRecord {
 
  52     wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
 
  53                      const wxString& title, const wxString& start);
 
  55     wxString GetBookFile();
 
  58     wxString GetBasePath();
 
  60     void SetContentsRange(int start, int end);
 
  61     int GetContentsStart();
 
  64     void SetTitle(const wxString& title);
 
  65     void SetBasePath(const wxString& path);
 
  66     void SetStart(const wxString& start);
 
  68     wxString GetFullPath(const wxString &page) const;
 
  71 //---------------------------------------------------------------------------
 
  73 struct wxHtmlContentsItem
 
  76         int GetLevel() { return self->m_Level; }
 
  77         int GetID() { return self->m_ID; }
 
  78         wxString GetName() { return self->m_Name; }
 
  79         wxString GetPage() { return self->m_Page; }
 
  80         wxHtmlBookRecord* GetBook() { return self->m_Book; }
 
  84 //---------------------------------------------------------------------------
 
  86 class wxHtmlSearchStatus
 
  89     //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword,
 
  90     //                   const wxString& book = wxPyEmptyString);
 
  95     const wxString& GetName();
 
  96     wxHtmlContentsItem* GetContentsItem();
 
  99 //---------------------------------------------------------------------------
 
 101 class wxHtmlHelpData {
 
 106     void SetTempDir(const wxString& path);
 
 107     bool AddBook(const wxString& book);
 
 108 //      bool AddBookParam(const wxString& title, const wxString& contfile,
 
 109 //                    const wxString& indexfile=wxPyEmptyString,
 
 110 //                    const wxString& deftopic=wxPyEmptyString,
 
 111 //                    const wxString& path=wxPyEmptyString);
 
 113     wxString FindPageByName(const wxString& page);
 
 114     wxString FindPageById(int id);
 
 116     // TODO: this one needs fixed...
 
 117     const wxHtmlBookRecArray& GetBookRecArray();
 
 119     wxHtmlContentsItem* GetContents();
 
 120     int GetContentsCnt();
 
 121     wxHtmlContentsItem* GetIndex();
 
 125 //---------------------------------------------------------------------------
 
 127 class wxHtmlHelpFrame : public wxFrame {
 
 129     wxHtmlHelpFrame(wxWindow* parent, int wxWindowID,
 
 130                     const wxString& title = wxPyEmptyString,
 
 131                     int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL);
 
 133     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 135     wxHtmlHelpData* GetData();
 
 136     void SetTitleFormat(const wxString& format);
 
 137     void Display(const wxString& x);
 
 138     %name(DisplayID) void Display(int id);
 
 139     void DisplayContents();
 
 141     bool KeywordSearch(const wxString& keyword);
 
 142     void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString);
 
 143     void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
 
 144     void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
 
 148 //---------------------------------------------------------------------------
 
 164 class wxHtmlHelpController : public wxEvtHandler {
 
 166     wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE);
 
 167     ~wxHtmlHelpController();
 
 169     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 171     void SetTitleFormat(const wxString& format);
 
 172     void SetTempDir(const wxString& path);
 
 173     bool AddBook(const wxString& book, int show_wait_msg = FALSE);
 
 174     void Display(const wxString& x);
 
 175     %name(DisplayID) void Display(int id);
 
 176     void DisplayContents();
 
 178     bool KeywordSearch(const wxString& keyword);
 
 179     void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString);
 
 180     void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
 
 181     void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
 
 182     wxHtmlHelpFrame* GetFrame();
 
 185 //---------------------------------------------------------------------------
 
 186 //---------------------------------------------------------------------------