+class wxHtmlHelpFrame : public wxFrame {
+public:
+ %pythonAppend wxHtmlHelpFrame "self._setOORInfo(self)"
+ %pythonAppend wxHtmlHelpFrame() ""
+ %typemap(out) wxHtmlHelpFrame*; // turn off this typemap
+
+ wxHtmlHelpFrame(wxWindow* parent, int wxWindowID,
+ const wxString& title = wxPyEmptyString,
+ int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL);
+ %RenameCtor(PreHtmlHelpFrame, wxHtmlHelpFrame(wxHtmlHelpData* data = NULL));
+
+ // Turn it back on again
+ %typemap(out) wxHtmlHelpFrame* { $result = wxPyMake_wxObject($1, $owner); }
+
+ bool Create(wxWindow* parent, wxWindowID id,
+ const wxString& title = wxPyEmptyString,
+ int style = wxHF_DEFAULT_STYLE);
+
+ wxHtmlHelpData* GetData();
+ void SetTitleFormat(const wxString& format);
+
+ void AddGrabIfNeeded();
+
+ /// Returns the help controller associated with the window.
+ wxHtmlHelpController* GetController() const;
+
+ /// Sets the help controller associated with the window.
+ %disownarg( wxHtmlHelpController* controller );
+ void SetController(wxHtmlHelpController* controller);
+ %cleardisown( wxHtmlHelpController* controller );
+
+ /// Returns the help window.
+ wxHtmlHelpWindow* GetHelpWindow() const;
+
+ %pythoncode {
+ %# For compatibility from before the refactor
+ def Display(self, x):
+ return self.GetHelpWindow().Display(x)
+ def DisplayID(self, x):
+ return self.GetHelpWindow().DisplayID(id)
+ def DisplayContents(self):
+ return self.GetHelpWindow().DisplayContents()
+ def DisplayIndex(self):
+ return self.GetHelpWindow().DisplayIndex()
+
+ def KeywordSearch(self, keyword):
+ return self.GetHelpWindow().KeywordSearch(keyword)
+
+ def UseConfig(self, config, rootpath=""):
+ return self.GetHelpWindow().UseConfig(config, rootpath)
+ def ReadCustomization(self, config, rootpath=""):
+ return self.GetHelpWindow().ReadCustomization(config, rootpath)
+ def WriteCustomization(self, config, rootpath=""):
+ return self.GetHelpWindow().WriteCustomization(config, rootpath)
+ %}
+};
+
+
+
+MustHaveApp(wxHtmlHelpDialog);
+
+class wxHtmlHelpDialog : public wxDialog
+{
+public:
+ %pythonAppend wxHtmlHelpDialog "self._setOORInfo(self)"
+ %pythonAppend wxHtmlHelpDialog() ""
+ %typemap(out) wxHtmlHelpDialog*; // turn off this typemap
+
+ wxHtmlHelpDialog(wxWindow* parent, wxWindowID wxWindowID,
+ const wxString& title = wxPyEmptyString,
+ int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL);
+ %RenameCtor(PreHtmlHelpDialog, wxHtmlHelpDialog(wxHtmlHelpData* data = NULL));
+
+ // Turn it back on again
+ %typemap(out) wxHtmlHelpDialog* { $result = wxPyMake_wxObject($1, $owner); }
+
+ bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxPyEmptyString,
+ int style = wxHF_DEFAULT_STYLE);
+
+ /// Returns the data associated with this dialog.
+ wxHtmlHelpData* GetData();
+
+ /// Returns the controller that created this dialog.
+ wxHtmlHelpController* GetController() const;
+
+ /// Sets the controller associated with this dialog.
+ %disownarg( wxHtmlHelpController* controller );
+ void SetController(wxHtmlHelpController* controller);
+ %cleardisown( wxHtmlHelpController* controller );
+
+ /// Returns the help window.
+ wxHtmlHelpWindow* GetHelpWindow() const;
+
+ // Sets format of title of the frame. Must contain exactly one "%s"
+ // (for title of displayed HTML page)
+ void SetTitleFormat(const wxString& format);
+
+ // Override to add custom buttons to the toolbar
+// virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {};
+
+};
+
+
+//---------------------------------------------------------------------------
+
+
+// TODO: Make virtual methods of this class overridable in Python.
+
+MustHaveApp(wxHelpControllerBase);
+
+class wxHelpControllerBase: public wxObject
+{
+public:
+// wxHelpControllerBase(wxWindow* parentWindow = NULL);
+// ~wxHelpControllerBase();
+
+ %nokwargs Initialize;
+ virtual bool Initialize(const wxString& file, int server );
+ virtual bool Initialize(const wxString& file);
+
+ virtual void SetViewer(const wxString& viewer, long flags = 0);
+
+ // If file is "", reloads file given in Initialize
+ virtual bool LoadFile(const wxString& file = wxEmptyString) /* = 0 */;
+
+ // Displays the contents
+ virtual bool DisplayContents(void) /* = 0 */;
+
+ %nokwargs DisplaySection;
+
+ // Display the given section
+ virtual bool DisplaySection(int sectionNo) /* = 0 */;
+
+ // Display the section using a context id
+ virtual bool DisplayContextPopup(int contextId);
+
+ // Display the text in a popup, if possible
+ virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
+
+ // By default, uses KeywordSection to display a topic. Implementations
+ // may override this for more specific behaviour.
+ virtual bool DisplaySection(const wxString& section);
+
+ virtual bool DisplayBlock(long blockNo) /* = 0 */;
+ virtual bool KeywordSearch(const wxString& k,
+ wxHelpSearchMode mode = wxHELP_SEARCH_ALL) /* = 0 */;
+
+ /// Allows one to override the default settings for the help frame.
+ virtual void SetFrameParameters(const wxString& title,
+ const wxSize& size,
+ const wxPoint& pos = wxDefaultPosition,
+ bool newFrameEachTime = false);
+
+ /// Obtains the latest settings used by the help frame and the help
+ /// frame.
+ virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
+ wxPoint *pos = NULL,
+ bool *newFrameEachTime = NULL);
+
+ virtual bool Quit() /* = 0 */;
+
+ virtual void OnQuit();
+
+ /// Set the window that can optionally be used for the help window's parent.
+ virtual void SetParentWindow(wxWindow* win);
+
+ /// Get the window that can optionally be used for the help window's parent.
+ virtual wxWindow* GetParentWindow() const;
+
+};
+
+
+
+
+MustHaveApp(wxHtmlHelpController);
+
+class wxHtmlHelpController : public wxHelpControllerBase
+{
+public:
+// %pythonAppend wxHtmlHelpController "self._setOORInfo(self)"
+
+ wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL);
+ ~wxHtmlHelpController();
+
+ wxHtmlHelpWindow* GetHelpWindow();
+ void SetHelpWindow(wxHtmlHelpWindow* helpWindow);
+
+ wxHtmlHelpFrame* GetFrame();
+ wxHtmlHelpDialog* GetDialog();
+
+ void SetTitleFormat(const wxString& format);
+ void SetTempDir(const wxString& path);
+ bool AddBook(const wxString& book, int show_wait_msg = false);
+ void Display(const wxString& x);
+ %Rename(DisplayID, void, Display(int id));
+ void DisplayContents();
+ void DisplayIndex();
+ bool KeywordSearch(const wxString& keyword);
+ void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString);
+ void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
+ void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
+
+ void MakeModalIfNeeded();
+ wxWindow* FindTopLevelWindow();
+};
+
+
+/*
+ * wxHtmlModalHelp
+ * A convenience class particularly for use on wxMac,
+ * where you can only show modal dialogs from a modal
+ * dialog.
+ *
+ * Use like this:
+ *
+ * wxHtmlModalHelp help(parent, filename, topic);
+ *
+ * If topic is empty, the help contents is displayed.
+ */
+
+class wxHtmlModalHelp
+{
+public:
+ wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile,
+ const wxString& topic = wxEmptyString,
+ int style = wxHF_DEFAULT_STYLE | wxHF_DIALOG | wxHF_MODAL);
+};
+
+
+//---------------------------------------------------------------------------
+%init %{
+ wxPyPtrTypeMap_Add("wxHtmlTagHandler", "wxPyHtmlTagHandler");