1999-09-12 13:45:34 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: helpctrl.h
|
|
|
|
// Purpose: wxHtmlHelpController
|
1999-09-13 01:27:36 -04:00
|
|
|
// Notes: Based on htmlhelp.cpp, implementing a monolithic
|
1999-09-12 13:45:34 -04:00
|
|
|
// HTML Help controller class, by Vaclav Slavik
|
|
|
|
// Author: Harm van der Heijden and Vaclav Slavik
|
1999-10-02 14:19:46 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-09-12 13:45:34 -04:00
|
|
|
// Copyright: (c) Harm van der Heijden and Vaclav Slavik
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-09-12 13:45:34 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_HELPCTRL_H_
|
|
|
|
#define _WX_HELPCTRL_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-04-29 13:57:59 -04:00
|
|
|
#pragma interface "helpctrl.h"
|
1999-09-12 13:45:34 -04:00
|
|
|
#endif
|
|
|
|
|
2001-07-04 21:27:19 -04:00
|
|
|
#if wxUSE_WXHTML_HELP
|
1999-09-12 13:45:34 -04:00
|
|
|
|
2000-03-09 15:05:52 -05:00
|
|
|
#include "wx/helpbase.h"
|
2003-09-09 13:29:11 -04:00
|
|
|
#include "wx/html/helpfrm.h"
|
1999-09-12 13:45:34 -04:00
|
|
|
|
2001-05-05 14:05:57 -04:00
|
|
|
#define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1)
|
|
|
|
|
2003-07-04 09:04:05 -04:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler
|
1999-09-12 13:45:34 -04:00
|
|
|
{
|
2001-04-29 13:57:59 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlHelpController)
|
|
|
|
|
|
|
|
public:
|
2001-05-05 14:05:57 -04:00
|
|
|
wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE);
|
2001-04-29 13:57:59 -04:00
|
|
|
virtual ~wxHtmlHelpController();
|
|
|
|
|
|
|
|
void SetTitleFormat(const wxString& format);
|
|
|
|
void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); }
|
2004-09-27 15:06:39 -04:00
|
|
|
bool AddBook(const wxString& book_url, bool show_wait_msg = false);
|
|
|
|
bool AddBook(const wxFileName& book_file, bool show_wait_msg = false);
|
2002-06-18 17:46:42 -04:00
|
|
|
|
|
|
|
bool Display(const wxString& x);
|
|
|
|
bool Display(int id);
|
|
|
|
bool DisplayContents();
|
|
|
|
bool DisplayIndex();
|
2003-09-09 13:29:11 -04:00
|
|
|
bool KeywordSearch(const wxString& keyword,
|
|
|
|
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
|
2002-06-18 17:46:42 -04:00
|
|
|
|
2001-04-29 13:57:59 -04:00
|
|
|
wxHtmlHelpFrame* GetFrame() { return m_helpFrame; }
|
|
|
|
void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
|
|
|
|
|
|
|
|
// Assigns config object to the Ctrl. This config is then
|
|
|
|
// used in subsequent calls to Read/WriteCustomization of both help
|
|
|
|
// Ctrl and it's wxHtmlWindow
|
|
|
|
virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
|
|
|
|
virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
|
|
|
|
|
|
|
|
//// Backward compatibility with wxHelpController API
|
|
|
|
|
|
|
|
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); }
|
|
|
|
virtual bool Initialize(const wxString& file);
|
|
|
|
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
|
2002-12-04 09:11:26 -05:00
|
|
|
virtual bool LoadFile(const wxString& file = wxT(""));
|
2001-04-29 13:57:59 -04:00
|
|
|
virtual bool DisplaySection(int sectionNo);
|
|
|
|
virtual bool DisplaySection(const wxString& section) { return Display(section); }
|
|
|
|
virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }
|
|
|
|
virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
|
|
|
|
|
|
|
|
virtual void SetFrameParameters(const wxString& title,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2004-09-27 15:06:39 -04:00
|
|
|
bool newFrameEachTime = false);
|
2001-04-29 13:57:59 -04:00
|
|
|
/// 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);
|
|
|
|
|
2001-05-04 19:52:46 -04:00
|
|
|
// Get direct access to help data:
|
|
|
|
wxHtmlHelpData *GetHelpData() { return &m_helpData; }
|
2001-04-29 13:57:59 -04:00
|
|
|
|
|
|
|
virtual bool Quit() ;
|
2004-10-13 10:04:19 -04:00
|
|
|
virtual void OnQuit() {}
|
2001-04-29 13:57:59 -04:00
|
|
|
|
|
|
|
void OnCloseFrame(wxCloseEvent& evt);
|
|
|
|
|
2002-06-18 17:46:42 -04:00
|
|
|
// Make the help controller's frame 'modal' if
|
|
|
|
// needed
|
|
|
|
void AddGrabIfNeeded();
|
|
|
|
|
2001-04-29 13:57:59 -04:00
|
|
|
protected:
|
|
|
|
virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data);
|
|
|
|
|
|
|
|
virtual void CreateHelpWindow();
|
|
|
|
virtual void DestroyHelpWindow();
|
|
|
|
|
|
|
|
wxHtmlHelpData m_helpData;
|
|
|
|
wxHtmlHelpFrame* m_helpFrame;
|
|
|
|
wxConfigBase * m_Config;
|
|
|
|
wxString m_ConfigRoot;
|
|
|
|
wxString m_titleFormat;
|
|
|
|
int m_FrameStyle;
|
|
|
|
// DECLARE_EVENT_TABLE()
|
2003-01-02 18:38:11 -05:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxHtmlHelpController)
|
1999-09-12 13:45:34 -04:00
|
|
|
};
|
|
|
|
|
2001-07-04 21:27:19 -04:00
|
|
|
#endif // wxUSE_WXHTML_HELP
|
1999-09-12 13:45:34 -04:00
|
|
|
|
|
|
|
#endif // _WX_HELPCTRL_H_
|