1///////////////////////////////////////////////////////////////////////////// 2// Name: helpview.h 3// Purpose: HelpView application class 4// Author: Vaclav Slavik, Julian Smart 5// Modified by: 6// Created: 2002-07-09 7// RCS-ID: $Id: helpview.h 44610 2007-03-05 10:46:54Z JS $ 8// Copyright: (c) 2002 Vaclav Slavik, Julian Smart and others 9// Licence: wxWindows licence 10///////////////////////////////////////////////////////////////////////////// 11 12#ifndef _WX_HELPVIEW_H_ 13#define _WX_HELPVIEW_H_ 14 15#define hvVERSION 1.04 16 17#if wxUSE_IPC 18#include <wx/ipc.h> 19class hvServer; 20#endif 21 22/*! 23 * The helpview application class. 24 */ 25 26class hvApp : public wxApp 27{ 28public: 29 hvApp(); 30 31 /// Initialise the application. 32 virtual bool OnInit(); 33 34 /// Clean up the application's data. 35 virtual int OnExit(); 36 37#ifdef __WXMAC__ 38 /// Respond to Apple Event for opening a document 39 virtual void MacOpenFile(const wxString& filename); 40#endif 41 42 /// Prompt the user for a book to open 43 bool OpenBook(wxHtmlHelpController* controller); 44 45 /// Returns the help controller. 46 wxHtmlHelpController* GetHelpController() { return m_helpController; } 47 48#if wxUSE_IPC 49 /// Returns the list of connections. 50 wxList& GetConnections() { return m_connections; } 51#endif 52 53 /// Respond to idle event 54 void OnIdle(wxIdleEvent& event); 55 56private: 57 wxHtmlHelpController* m_helpController; 58 bool m_exitIfNoMainWindow; 59 60#if wxUSE_IPC 61 wxList m_connections; 62 hvServer* m_server; 63#endif 64 65DECLARE_EVENT_TABLE() 66}; 67 68#if wxUSE_IPC 69class hvConnection : public wxConnection 70{ 71public: 72 hvConnection(); 73 virtual ~hvConnection(); 74 75 bool OnExecute(const wxString& topic, wxChar*data, int size, wxIPCFormat format); 76 wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); 77 bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); 78 bool OnStartAdvise(const wxString& topic, const wxString& item); 79 80private: 81}; 82 83class hvServer: public wxServer 84{ 85public: 86 wxConnectionBase *OnAcceptConnection(const wxString& topic); 87}; 88 89 90#endif 91 92#endif 93 // _WX_HELPVIEW_H_ 94 95