home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / wxwin140 / include / wx_help.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  2.7 KB  |  90 lines

  1. /*
  2.  * File:     wx_help.h
  3.  * Purpose:  API for invoking wxHelp
  4.  *
  5.  *                       wxWindows 1.40
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                       Date: 18-4-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28.  
  29. #ifndef wx_helph
  30. #define wx_helph
  31.  
  32. #include <stdio.h>
  33. #include <wx.h>
  34. #include "wx_hash.h"
  35.  
  36. class wxHelpInstance;
  37. class wxHelpConnection: public wxConnection
  38. {
  39.  public:
  40.   wxHelpInstance *helpInstance;
  41.   wxHelpConnection(wxHelpInstance *instance) { helpInstance = instance; }
  42.   Bool OnDisconnect(void);
  43. };
  44.  
  45. // An application can have one or more instances of wxHelp,
  46. // represented by an object of this class.
  47. // Nothing happens on initial creation; the application
  48. // must call a member function to display help.
  49. // If the instance of wxHelp is already active, that instance
  50. // will be used for subsequent help.
  51.  
  52. class wxHelpInstance: wxClient
  53. {
  54.  public:
  55.   char *helpFile;
  56.   int  helpServer;
  57.   char *helpHost;
  58.   Bool helpRunning;
  59.   wxHelpConnection *helpConnection;
  60.   wxHelpInstance(void)
  61.     { helpFile = NULL; helpServer = -1; helpHost = NULL;
  62.       helpRunning = FALSE; helpConnection = NULL; }
  63.   ~wxHelpInstance(void)
  64.     { if (helpFile) delete helpFile; 
  65.       if (helpHost) delete helpHost;
  66.     }
  67.  
  68.   // Must call this to set the filename and server name
  69.   Bool Initialize(char *file, int server = -1);
  70.   // If file is NULL, reloads file given  in Initialize
  71.   Bool LoadFile(char *file = NULL);
  72.   Bool DisplayContents(void);
  73.   Bool DisplaySection(int sectionNo);
  74.   Bool DisplayBlock(long blockNo);
  75.   Bool KeywordSearch(char *k);
  76.  
  77.   Bool Quit(void);
  78.   virtual void OnQuit(void);
  79.  
  80.   // Private
  81.   Bool Run(void);
  82.  
  83.   wxConnection *OnMakeConnection(void)
  84.     { return new wxHelpConnection(this); 
  85.     }
  86. };
  87.  
  88.  
  89. #endif // wx_helph
  90.