1 /****************************************************************************
3 * wxWindows HTML Applet Package
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
8 * ======================================================================
9 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
11 * |This copyrighted computer code is a proprietary trade secret of |
12 * |SciTech Software, Inc., located at 505 Wall Street, Chico, CA 95928 |
13 * |USA (www.scitechsoft.com). ANY UNAUTHORIZED POSSESSION, USE, |
14 * |VIEWING, COPYING, MODIFICATION OR DISSEMINATION OF THIS CODE IS |
15 * |STRICTLY PROHIBITED BY LAW. Unless you have current, express |
16 * |written authorization from SciTech to possess or use this code, you |
17 * |may be subject to civil and/or criminal penalties. |
19 * |If you received this code in error or you would like to report |
20 * |improper use, please immediately contact SciTech Software, Inc. at |
23 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
24 * ======================================================================
29 * Description: Header file for the wxHtmlAppletWindow class
31 ****************************************************************************/
33 #ifndef __WX_APPLET_WINDOW_H
34 #define __WX_APPLET_WINDOW_H
36 #include "wx/html/htmlwin.h"
37 #include "wx/process.h"
41 class wxLoadPageEvent
;
42 class wxPageLoadedEvent
;
45 // Declare a linked list of wxApplet pointers
46 WX_DECLARE_LIST(wxApplet
, wxAppletList
);
48 /*--------------------------- Class Definitions ---------------------------*/
50 /****************************************************************************
52 Defines the class for virtual-link data types
53 ****************************************************************************/
54 class VirtualData
: public wxObject
{
68 wxString
GetName(){ return m_name
;};
69 wxString
GetGroup(){ return m_group
;};
70 wxString
GetHref(){ return m_href
;};
73 void SetName (wxString
& s
){ m_name
= s
; };
74 void SetGroup(wxString
& s
){ m_group
= s
; };
75 void SetHref (wxString
& s
){ m_href
= s
; };
78 /****************************************************************************
80 Defines the class for wxAppletWindow. This class is derived from the
81 wxHtmlWindow class and extends it with functionality to handle embedded
82 wxApplet's on the HTML pages.
83 ****************************************************************************/
84 class wxHtmlAppletWindow
: public wxHtmlWindow
{
86 DECLARE_CLASS(wxHtmlAppletWindow
);
87 DECLARE_EVENT_TABLE();
90 wxIncludePrep
*incPreprocessor
; // deleted by list it is added too in constructor
92 wxAppletList m_AppletList
;
93 static wxHashTable m_Cookies
;
94 wxToolBarBase
*m_NavBar
;
103 wxToolBarBase
*navBar
= NULL
,
105 int navForwardId
= -1,
106 const wxPoint
& pos
= wxDefaultPosition
,
107 const wxSize
& size
= wxDefaultSize
,
108 long style
= wxHW_SCROLLBAR_AUTO
,
109 const wxString
& name
= "htmlAppletWindow",
110 const wxString
& docroot
= "" );
113 ~wxHtmlAppletWindow();
115 // Create an instance of an applet based on it's class name
116 wxApplet
*CreateApplet(
117 const wxString
& classId
,
118 const wxString
& iName
,
119 const wxHtmlTag
¶ms
,
122 // Find an instance of an applet based on it's class name
123 wxApplet
*FindApplet(const wxString
& className
);
125 // Remove an applet from the window. Called during applet destruction
126 bool RemoveApplet(const wxApplet
*applet
);
128 // Load a new URL page
129 virtual bool LoadPage(const wxString
& location
);
131 // Called when users clicked on hypertext link.
132 virtual void OnLinkClicked(const wxHtmlLinkInfo
& link
);
134 // Handles forward navigation within the HTML stack
135 bool HistoryForward();
137 // Handles backwards navigation within the HTML stack
140 // Broadcast a message to all applets on the page
141 void SendMessage(wxEvent
& msg
);
143 // Register a cookie of data in the applet manager
144 static bool RegisterCookie(const wxString
& name
,wxObject
*cookie
);
146 // UnRegister a cookie of data in the applet manager
147 static bool UnRegisterCookie(const wxString
& name
);
149 // Find a cookie of data given it's public name
150 static wxObject
*FindCookie(const wxString
& name
);
152 // Event handlers to load a new page
153 void OnLoadPage(wxLoadPageEvent
&event
);
155 // Event handlers to load a new page
156 void OnPageLoaded(wxPageLoadedEvent
&event
);
158 // LoadPage mutex locks
159 void Lock(){ m_mutexLock
= true;};
160 void UnLock(){ m_mutexLock
= false;};
162 // Returns TRUE if the mutex is locked, FALSE otherwise.
163 bool IsLocked(){ return m_mutexLock
;};
165 // Tries to lock the mutex. If it can't, returns immediately with false.
170 /****************************************************************************
172 Defines the class for AppetProcess
173 ***************************************************************************/
174 class AppletProcess
: public wxProcess
{
182 // instead of overriding this virtual function we might as well process the
183 // event from it in the frame class - this might be more convenient in some
185 virtual void OnTerminate(int pid
, int status
);
190 #endif // __WX_APPLET_WINDOW_H