]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/helpxlp.h
fixed mem leak in wxDataObjectComposite
[wxWidgets.git] / include / wx / generic / helpxlp.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: helpxlp.h
3// Purpose: Help system: wxHelp implementation
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart and Markus Holzem
52326d0e 9// Licence: wxWindows license
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
c801d85f
KB
12#ifndef __HELPXLPH__
13#define __HELPXLPH__
14
15#ifdef __GNUG__
16#pragma interface "helpxlp.h"
17#endif
18
04dbb646 19#include "wx/defs.h"
c801d85f 20
47d67540 21#if wxUSE_HELP
c801d85f
KB
22
23#include "wx/helpbase.h"
24
2049ba38 25#ifdef __WXMSW__
52326d0e 26 #include "wx/dde.h"
c801d85f 27#else
52326d0e 28 #include "wx/sckipc.h"
c801d85f
KB
29#endif
30
31class WXDLLEXPORT wxXLPHelpController;
32
33// Connection class for implementing the connection between the
34// wxHelp process and the application
35class WXDLLEXPORT wxXLPHelpConnection: public
36
2049ba38 37#ifdef __WXMSW__
c801d85f
KB
38 wxDDEConnection
39#else
40 wxTCPConnection
41#endif
42
43{
44 friend class wxXLPHelpController;
45
46 DECLARE_DYNAMIC_CLASS(wxXLPHelpConnection)
47
48 public:
49
50 wxXLPHelpConnection(wxXLPHelpController *instance);
51 bool OnDisconnect(void);
52
53 private:
54 wxXLPHelpController *helpInstance;
55};
56
57// Connection class for implementing the client process
58// controlling the wxHelp process
59class WXDLLEXPORT wxXLPHelpClient: public
60
2049ba38 61#ifdef __WXMSW__
c801d85f
KB
62 wxDDEClient
63#else
64 wxTCPClient
65#endif
66
67{
68DECLARE_CLASS(wxXLPHelpClient)
69
70 friend class WXDLLEXPORT wxXLPHelpController;
71public:
72 wxXLPHelpClient(wxXLPHelpController* c) { m_controller = c; }
73
74 wxConnectionBase *OnMakeConnection(void)
75 { return new wxXLPHelpConnection(m_controller);
76 }
77protected:
78 wxXLPHelpController* m_controller;
79};
80
81// An application can have one or more instances of wxHelp,
82// represented by an object of this class.
83// Nothing happens on initial creation; the application
84// must call a member function to display help.
85// If the instance of wxHelp is already active, that instance
86// will be used for subsequent help.
87
88class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
89{
90 friend class WXDLLEXPORT wxXLPHelpConnection;
91 DECLARE_CLASS(wxXLPHelpController)
92
93 public:
94 wxXLPHelpController(void);
95 ~wxXLPHelpController(void);
96
97 // Must call this to set the filename and server name
98 virtual bool Initialize(const wxString& file, int server = -1);
99 // If file is "", reloads file given in Initialize
100 virtual bool LoadFile(const wxString& file = "");
101 virtual bool DisplayContents(void);
102 virtual bool DisplaySection(int sectionNo);
103 virtual bool DisplayBlock(long blockNo);
104 virtual bool KeywordSearch(const wxString& k);
105
f6bcfd97
BP
106 virtual bool DisplaySection(const wxString& section)
107 {
108 return wxHelpControllerBase::DisplaySection(section);
109 }
110
c801d85f
KB
111 virtual bool Quit(void);
112 virtual void OnQuit(void);
113
114 // Private
115 bool Run(void);
116
117 protected:
118 wxString helpFile;
119 wxString helpHost;
120 int helpServer;
121 bool helpRunning;
122 wxXLPHelpConnection* helpConnection;
123 wxXLPHelpClient helpClient;
54da4255
DW
124private:
125 virtual bool Initialize(const wxString& file) { return(wxHelpControllerBase::Initialize(file)); };
c801d85f
KB
126};
127
47d67540 128#endif // wxUSE_HELP
c801d85f
KB
129#endif
130 // __HELPXLPH__