#ifndef _WX_HELPVIEW_H_
#define _WX_HELPVIEW_H_
-#if defined(__GNUG__) && !defined(__APPLE__)
-#pragma interface "help.cpp"
+#define hvVERSION 1.04
+
+#if wxUSE_IPC
+#include <wx/ipc.h>
+class hvServer;
#endif
-// Define a new application type, each program should derive a class from wxApp
+/*!
+ * The helpview application class.
+ */
+
class hvApp : public wxApp
{
- public:
- // override base class virtuals
- // ----------------------------
+public:
+ hvApp();
+
+ /// Initialise the application.
+ virtual bool OnInit();
- // this one is called on application startup and is a good place for the app
- // initialization (doing it here and not in the ctor allows to have an error
- // return: if OnInit() returns false, the application terminates)
+ /// Clean up the application's data.
+ virtual int OnExit();
- virtual bool OnInit();
- virtual int OnExit();
+#ifdef __WXMAC__
+ /// Respond to Apple Event for opening a document
+ virtual void MacOpenFile(const wxString& filename);
+#endif
+
+ /// Prompt the user for a book to open
+ bool OpenBook(wxHtmlHelpController* controller);
- // Prompt the user for a book to open
- bool OpenBook(wxHtmlHelpController* controller);
+ /// Returns the help controller.
+ wxHtmlHelpController* GetHelpController() { return m_helpController; }
+
+#if wxUSE_IPC
+ /// Returns the list of connections.
+ wxList& GetConnections() { return m_connections; }
+#endif
+
+private:
+ wxHtmlHelpController* m_helpController;
+
+#if wxUSE_IPC
+ wxList m_connections;
+ hvServer* m_server;
+#endif
- private:
- wxHtmlHelpController *help;
};
+#if wxUSE_IPC
+class hvConnection : public wxConnection
+{
+public:
+ hvConnection();
+ virtual ~hvConnection();
+
+ bool OnExec(const wxString& topic, const wxString& data);
+ bool OnPoke(const wxString& topic, const wxString& item,
+ const void *data, size_t size, wxIPCFormat format);
+
+private:
+};
+
+class hvServer: public wxServer
+{
+public:
+ wxConnectionBase *OnAcceptConnection(const wxString& topic);
+};
+
+
+#endif
+
#endif
// _WX_HELPVIEW_H_