X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b62f00d8e3ec5437ab780cb3d73d299cc61e20c..40f7145ca55ccf1b197e70acf79bbd4aa5d85145:/wxPython/src/htmlhelp.i diff --git a/wxPython/src/htmlhelp.i b/wxPython/src/htmlhelp.i index 1947f066ab..7e8612b8dd 100644 --- a/wxPython/src/htmlhelp.i +++ b/wxPython/src/htmlhelp.i @@ -4,7 +4,7 @@ // // Author: Robin Dunn // -// Created: 25-nov-1998 +// Created: 25-Nov-1998 // RCS-ID: $Id$ // Copyright: (c) 1998 by Total Control Software // Licence: wxWindows license @@ -23,6 +23,11 @@ #include %} +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //--------------------------------------------------------------------------- %include typemaps.i @@ -42,43 +47,12 @@ //--------------------------------------------------------------------------- -enum { - wxID_HTML_PANEL, - wxID_HTML_BACK, - wxID_HTML_FORWARD, - wxID_HTML_TREECTRL, - wxID_HTML_INDEXPAGE, - wxID_HTML_INDEXLIST, - wxID_HTML_NOTEBOOK, - wxID_HTML_SEARCHPAGE, - wxID_HTML_SEARCHTEXT, - wxID_HTML_SEARCHLIST, - wxID_HTML_SEARCHBUTTON, - wxID_HTML_SEARCHCHOICE, - wxID_HTML_HELPFRAME - -}; - -//--------------------------------------------------------------------------- - -class wxHtmlHelpFrameCfg -{ +class wxHtmlBookRecord { public: - wxHtmlHelpFrameCfg(); - - long x, y, w, h; - long sashpos; - bool navig_on; -}; - - -//--------------------------------------------------------------------------- - -class wxHtmlBookRecord { -public: - wxHtmlBookRecord(const wxString& basepath, const wxString& title, - const wxString& start); + wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, + const wxString& title, const wxString& start); + wxString GetBookFile(); wxString GetTitle(); wxString GetStart(); wxString GetBasePath(); @@ -86,18 +60,26 @@ public: void SetContentsRange(int start, int end); int GetContentsStart(); int GetContentsEnd(); + + void SetTitle(const wxString& title); + void SetBasePath(const wxString& path); + void SetStart(const wxString& start); + + wxString GetFullPath(const wxString &page) const; }; //--------------------------------------------------------------------------- -typedef struct +struct wxHtmlContentsItem { - short int m_Level; - int m_ID; - char* m_Name; - char* m_Page; - wxHtmlBookRecord *m_Book; -} wxHtmlContentsItem; + %addmethods { + int GetLevel() { return self->m_Level; } + int GetID() { return self->m_ID; } + wxString GetName() { return self->m_Name; } + wxString GetPage() { return self->m_Page; } + wxHtmlBookRecord* GetBook() { return self->m_Book; } + } +}; //--------------------------------------------------------------------------- @@ -105,7 +87,7 @@ class wxHtmlSearchStatus { public: //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, - // const wxString& book = wxEmptyString); + // const wxString& book = wxPyEmptyString); bool Search(); bool IsActive(); int GetCurIndex(); @@ -124,14 +106,14 @@ public: void SetTempDir(const wxString& path); bool AddBook(const wxString& book); // bool AddBookParam(const wxString& title, const wxString& contfile, -// const wxString& indexfile=wxEmptyString, -// const wxString& deftopic=wxEmptyString, -// const wxString& path=wxEmptyString); +// const wxString& indexfile=wxPyEmptyString, +// const wxString& deftopic=wxPyEmptyString, +// const wxString& path=wxPyEmptyString); wxString FindPageByName(const wxString& page); wxString FindPageById(int id); - // **** this one needs fixed... + // TODO: this one needs fixed... const wxHtmlBookRecArray& GetBookRecArray(); wxHtmlContentsItem* GetContents(); @@ -145,9 +127,11 @@ public: class wxHtmlHelpFrame : public wxFrame { public: wxHtmlHelpFrame(wxWindow* parent, int wxWindowID, - const wxString& title = wxEmptyString, + const wxString& title = wxPyEmptyString, int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL); + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + wxHtmlHelpData* GetData(); void SetTitleFormat(const wxString& format); void Display(const wxString& x); @@ -155,19 +139,35 @@ public: void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); }; //--------------------------------------------------------------------------- + +enum { + wxHF_TOOLBAR, + wxHF_FLATTOOLBAR, + wxHF_CONTENTS, + wxHF_INDEX, + wxHF_SEARCH, + wxHF_BOOKMARKS, + wxHF_OPENFILES, + wxHF_PRINT, + wxHF_DEFAULTSTYLE, +}; + + class wxHtmlHelpController : public wxEvtHandler { public: - wxHtmlHelpController(); + wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE); ~wxHtmlHelpController(); + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + void SetTitleFormat(const wxString& format); void SetTempDir(const wxString& path); bool AddBook(const wxString& book, int show_wait_msg = FALSE); @@ -176,9 +176,9 @@ public: void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); wxHtmlHelpFrame* GetFrame(); };