home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2240.zip / wxWindows-2.4.0 / include / wx / helpbase.h < prev    next >
C/C++ Source or Header  |  2002-11-04  |  3KB  |  95 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        helpbase.h
  3. // Purpose:     Help system base classes
  4. // Author:      Julian Smart
  5. // Modified by:
  6. // Created:     04/01/98
  7. // RCS-ID:      $Id: helpbase.h,v 1.22.2.1 2002/10/29 21:47:16 RR Exp $
  8. // Copyright:   (c) Julian Smart and Markus Holzem
  9. // Licence:       wxWindows license
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef _WX_HELPBASEH__
  13. #define _WX_HELPBASEH__
  14.  
  15. #if defined(__GNUG__) && !defined(__APPLE__)
  16. #pragma interface "helpbase.h"
  17. #endif
  18.  
  19. #include "wx/defs.h"
  20.  
  21. #if wxUSE_HELP
  22.  
  23. #include "wx/object.h"
  24. #include "wx/string.h"
  25. #include "wx/gdicmn.h"
  26. #include "wx/frame.h"
  27.  
  28. // Flags for SetViewer
  29. #define wxHELP_NETSCAPE     1
  30.  
  31. // Defines the API for help controllers
  32. class WXDLLEXPORT wxHelpControllerBase: public wxObject
  33. {
  34. public:
  35.     inline wxHelpControllerBase() {}
  36.     inline ~wxHelpControllerBase() {}
  37.  
  38.     // Must call this to set the filename and server name.
  39.     // server is only required when implementing TCP/IP-based
  40.     // help controllers.
  41.     virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; }
  42.     virtual bool Initialize(const wxString& WXUNUSED(file)) { return FALSE; }
  43.  
  44.     // Set viewer: only relevant to some kinds of controller
  45.     virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
  46.  
  47.     // If file is "", reloads file given  in Initialize
  48.     virtual bool LoadFile(const wxString& file = wxT("")) = 0;
  49.  
  50.     // Displays the contents
  51.     virtual bool DisplayContents(void) = 0;
  52.  
  53.     // Display the given section
  54.     virtual bool DisplaySection(int sectionNo) = 0;
  55.  
  56.     // Display the section using a context id
  57.     virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return FALSE; };
  58.  
  59.     // Display the text in a popup, if possible
  60.     virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; }
  61.  
  62.     // By default, uses KeywordSection to display a topic. Implementations
  63.     // may override this for more specific behaviour.
  64.     virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
  65.     virtual bool DisplayBlock(long blockNo) = 0;
  66.     virtual bool KeywordSearch(const wxString& k) = 0;
  67.     /// Allows one to override the default settings for the help frame.
  68.     virtual void SetFrameParameters(const wxString& WXUNUSED(title),
  69.         const wxSize& WXUNUSED(size),
  70.         const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
  71.         bool WXUNUSED(newFrameEachTime) = FALSE)
  72.     {
  73.         // does nothing by default
  74.     }
  75.     /// Obtains the latest settings used by the help frame and the help
  76.     /// frame.
  77.     virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
  78.         wxPoint *WXUNUSED(pos) = NULL,
  79.         bool *WXUNUSED(newFrameEachTime) = NULL)
  80.     {
  81.         return (wxFrame*) NULL; // does nothing by default
  82.     }
  83.  
  84.     virtual bool Quit() = 0;
  85.     virtual void OnQuit() {}
  86.     
  87. private:
  88.     DECLARE_CLASS(wxHelpControllerBase)
  89. };
  90.  
  91. #endif // wxUSE_HELP
  92.  
  93. #endif
  94. // _WX_HELPBASEH__
  95.