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"
42 class wxLoadPageEvent
;
43 class wxPageLoadedEvent
;
46 // Declare a linked list of wxApplet pointers
47 WX_DECLARE_LIST(wxApplet
, wxAppletList
);
49 /*--------------------------- Class Definitions ---------------------------*/
51 /****************************************************************************
53 Defines the class for virtual-link data types
54 ****************************************************************************/
55 class VirtualData
: public wxObject
{
69 wxString
GetName(){ return m_name
;};
70 wxString
GetGroup(){ return m_group
;};
71 wxString
GetHref(){ return m_href
;};
74 void SetName (wxString
& s
){ m_name
= s
; };
75 void SetGroup(wxString
& s
){ m_group
= s
; };
76 void SetHref (wxString
& s
){ m_href
= s
; };
79 /****************************************************************************
81 Defines the class for wxAppletWindow. This class is derived from the
82 wxHtmlWindow class and extends it with functionality to handle embedded
83 wxApplet's on the HTML pages.
84 ****************************************************************************/
85 class wxHtmlAppletWindow
: public wxHtmlWindow
{
87 DECLARE_CLASS(wxHtmlAppletWindow
);
88 DECLARE_EVENT_TABLE();
91 wxIncludePrep
*incPreprocessor
; // deleted by list it is added too in constructor
93 wxAppletList m_AppletList
;
94 static wxHashTable m_Cookies
;
95 wxToolBarBase
*m_NavBar
;
104 wxToolBarBase
*navBar
= NULL
,
106 int navForwardId
= -1,
107 const wxPoint
& pos
= wxDefaultPosition
,
108 const wxSize
& size
= wxDefaultSize
,
109 long style
= wxHW_SCROLLBAR_AUTO
,
110 const wxString
& name
= "htmlAppletWindow",
111 const wxString
& docroot
= "" );
114 ~wxHtmlAppletWindow();
116 // Create an instance of an applet based on it's class name
117 wxApplet
*CreateApplet(
118 const wxString
& classId
,
119 const wxString
& iName
,
120 const wxHtmlTag
¶ms
,
123 // Create an instance of an Qlet based on it's class name
124 bool CreatePlugIn(const wxString
& classId
);
126 // Find an instance of an applet based on it's class name
127 wxApplet
*FindApplet(const wxString
& className
);
129 // Remove an applet from the window. Called during applet destruction
130 bool RemoveApplet(const wxApplet
*applet
);
132 // Load a new URL page
133 virtual bool LoadPage(const wxString
& location
);
135 // Called when users clicked on hypertext link.
136 virtual void OnLinkClicked(const wxHtmlLinkInfo
& link
);
138 // Handles forward navigation within the HTML stack
139 bool HistoryForward();
141 // Handles backwards navigation within the HTML stack
144 // Broadcast a message to all applets on the page
145 void SendMessage(wxEvent
& msg
);
147 // Register a cookie of data in the applet manager
148 static bool RegisterCookie(const wxString
& name
,wxObject
*cookie
);
150 // UnRegister a cookie of data in the applet manager
151 static bool UnRegisterCookie(const wxString
& name
);
153 // Find a cookie of data given it's public name
154 static wxObject
*FindCookie(const wxString
& name
);
156 // Event handlers to load a new page
157 void OnLoadPage(wxLoadPageEvent
&event
);
159 // Event handlers to load a new page
160 void OnPageLoaded(wxPageLoadedEvent
&event
);
162 // LoadPage mutex locks
163 void Lock(){ m_mutexLock
= true;};
164 void UnLock(){ m_mutexLock
= false;};
166 // Returns TRUE if the mutex is locked, FALSE otherwise.
167 bool IsLocked(){ return m_mutexLock
;};
169 // Tries to lock the mutex. If it can't, returns immediately with false.
174 /****************************************************************************
176 Defines the class for AppetProcess
177 ***************************************************************************/
178 class AppletProcess
: public wxProcess
{
186 // instead of overriding this virtual function we might as well process the
187 // event from it in the frame class - this might be more convenient in some
189 virtual void OnTerminate(int pid
, int status
);
193 /****************************************************************************
195 Defines the class for wxHtmlAppletCell
196 ***************************************************************************/
197 class wxHtmlAppletCell
: public wxHtmlCell
200 wxHtmlAppletCell(wxWindow
*wnd
, int w
= 0);
201 ~wxHtmlAppletCell() { m_Wnd
->Destroy(); }
202 virtual void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
);
203 virtual void DrawInvisible(wxDC
& dc
, int x
, int y
);
204 virtual void Layout(int w
);
208 // width float is used in adjustWidth (it is in percents)
212 #endif // __WX_APPLET_WINDOW_H