helpext.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/helpext.h
  3. // Purpose: an external help controller for wxWidgets
  4. // Author: Karsten Ballueder (Ballueder@usa.net)
  5. // Modified by:
  6. // Copyright: (c) Karsten Ballueder 1998
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef __WX_HELPEXT_H_
  10. #define __WX_HELPEXT_H_
  11. #if wxUSE_HELP
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/helpbase.h"
  16. // ----------------------------------------------------------------------------
  17. // wxExtHelpController
  18. // ----------------------------------------------------------------------------
  19. // This class implements help via an external browser.
  20. class WXDLLIMPEXP_ADV wxExtHelpController : public wxHelpControllerBase
  21. {
  22. public:
  23. wxExtHelpController(wxWindow* parentWindow = NULL);
  24. virtual ~wxExtHelpController();
  25. #if WXWIN_COMPATIBILITY_2_8
  26. wxDEPRECATED(void SetBrowser(const wxString& browsername = wxEmptyString, bool isNetscape = false) );
  27. #endif
  28. // Set viewer: new name for SetBrowser
  29. virtual void SetViewer(const wxString& viewer = wxEmptyString,
  30. long flags = wxHELP_NETSCAPE);
  31. virtual bool Initialize(const wxString& dir, int WXUNUSED(server))
  32. { return Initialize(dir); }
  33. virtual bool Initialize(const wxString& dir);
  34. virtual bool LoadFile(const wxString& file = wxEmptyString);
  35. virtual bool DisplayContents(void);
  36. virtual bool DisplaySection(int sectionNo);
  37. virtual bool DisplaySection(const wxString& section);
  38. virtual bool DisplayBlock(long blockNo);
  39. virtual bool KeywordSearch(const wxString& k,
  40. wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
  41. virtual bool Quit(void);
  42. virtual void OnQuit(void);
  43. virtual bool DisplayHelp(const wxString &) ;
  44. virtual void SetFrameParameters(const wxString& WXUNUSED(title),
  45. const wxSize& WXUNUSED(size),
  46. const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
  47. bool WXUNUSED(newFrameEachTime) = false)
  48. {
  49. // does nothing by default
  50. }
  51. virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
  52. wxPoint *WXUNUSED(pos) = NULL,
  53. bool *WXUNUSED(newFrameEachTime) = NULL)
  54. {
  55. return NULL; // does nothing by default
  56. }
  57. protected:
  58. // Filename of currently active map file.
  59. wxString m_helpDir;
  60. // How many entries do we have in the map file?
  61. int m_NumOfEntries;
  62. // A list containing all id,url,documentation triples.
  63. wxList *m_MapList;
  64. private:
  65. // parse a single line of the map file (called by LoadFile())
  66. //
  67. // return true if the line was valid or false otherwise
  68. bool ParseMapFileLine(const wxString& line);
  69. // Deletes the list and all objects.
  70. void DeleteList(void);
  71. // How to call the html viewer.
  72. wxString m_BrowserName;
  73. // Is the viewer a variant of netscape?
  74. bool m_BrowserIsNetscape;
  75. DECLARE_CLASS(wxExtHelpController)
  76. };
  77. #endif // wxUSE_HELP
  78. #endif // __WX_HELPEXT_H_