1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: helpxlp.h
|
|
|
|
// Purpose: Help system: wxHelp implementation
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart and Markus Holzem
|
1999-07-28 22:28:44 +00:00
|
|
|
// Licence: wxWindows license
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __HELPXLPH__
|
|
|
|
#define __HELPXLPH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "helpxlp.h"
|
|
|
|
#endif
|
|
|
|
|
2001-07-05 18:48:48 +00:00
|
|
|
#include "wx/defs.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_HELP
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#include "wx/helpbase.h"
|
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#ifdef __WXMSW__
|
1999-07-28 22:28:44 +00:00
|
|
|
#include "wx/dde.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#else
|
1999-07-28 22:28:44 +00:00
|
|
|
#include "wx/sckipc.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxXLPHelpController;
|
|
|
|
|
|
|
|
// Connection class for implementing the connection between the
|
|
|
|
// wxHelp process and the application
|
|
|
|
class WXDLLEXPORT wxXLPHelpConnection: public
|
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#ifdef __WXMSW__
|
1998-05-20 14:01:55 +00:00
|
|
|
wxDDEConnection
|
|
|
|
#else
|
|
|
|
wxTCPConnection
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{
|
|
|
|
friend class wxXLPHelpController;
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxXLPHelpConnection)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxXLPHelpConnection(wxXLPHelpController *instance);
|
|
|
|
bool OnDisconnect(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxXLPHelpController *helpInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Connection class for implementing the client process
|
|
|
|
// controlling the wxHelp process
|
|
|
|
class WXDLLEXPORT wxXLPHelpClient: public
|
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#ifdef __WXMSW__
|
1998-05-20 14:01:55 +00:00
|
|
|
wxDDEClient
|
|
|
|
#else
|
|
|
|
wxTCPClient
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxXLPHelpClient)
|
|
|
|
|
|
|
|
friend class WXDLLEXPORT wxXLPHelpController;
|
|
|
|
public:
|
|
|
|
wxXLPHelpClient(wxXLPHelpController* c) { m_controller = c; }
|
|
|
|
|
|
|
|
wxConnectionBase *OnMakeConnection(void)
|
|
|
|
{ return new wxXLPHelpConnection(m_controller);
|
|
|
|
}
|
|
|
|
protected:
|
|
|
|
wxXLPHelpController* m_controller;
|
|
|
|
};
|
|
|
|
|
|
|
|
// An application can have one or more instances of wxHelp,
|
|
|
|
// represented by an object of this class.
|
|
|
|
// Nothing happens on initial creation; the application
|
|
|
|
// must call a member function to display help.
|
|
|
|
// If the instance of wxHelp is already active, that instance
|
|
|
|
// will be used for subsequent help.
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
|
|
|
|
{
|
|
|
|
friend class WXDLLEXPORT wxXLPHelpConnection;
|
|
|
|
DECLARE_CLASS(wxXLPHelpController)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxXLPHelpController(void);
|
|
|
|
~wxXLPHelpController(void);
|
|
|
|
|
|
|
|
// Must call this to set the filename and server name
|
|
|
|
virtual bool Initialize(const wxString& file, int server = -1);
|
|
|
|
// If file is "", reloads file given in Initialize
|
|
|
|
virtual bool LoadFile(const wxString& file = "");
|
|
|
|
virtual bool DisplayContents(void);
|
|
|
|
virtual bool DisplaySection(int sectionNo);
|
|
|
|
virtual bool DisplayBlock(long blockNo);
|
|
|
|
virtual bool KeywordSearch(const wxString& k);
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
virtual bool DisplaySection(const wxString& section)
|
|
|
|
{
|
|
|
|
return wxHelpControllerBase::DisplaySection(section);
|
|
|
|
}
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
virtual bool Quit(void);
|
|
|
|
virtual void OnQuit(void);
|
|
|
|
|
|
|
|
// Private
|
|
|
|
bool Run(void);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxString helpFile;
|
|
|
|
wxString helpHost;
|
|
|
|
int helpServer;
|
|
|
|
bool helpRunning;
|
|
|
|
wxXLPHelpConnection* helpConnection;
|
|
|
|
wxXLPHelpClient helpClient;
|
1999-08-02 04:44:01 +00:00
|
|
|
private:
|
|
|
|
virtual bool Initialize(const wxString& file) { return(wxHelpControllerBase::Initialize(file)); };
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#endif // wxUSE_HELP
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
// __HELPXLPH__
|