1 /****************************************************************************
3 * wxWindows HTML Applet Package
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
8 * ========================================================================
10 * The contents of this file are subject to the wxWindows License
11 * Version 3.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.wxwindows.org/licence3.txt
15 * Software distributed under the License is distributed on an
16 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
20 * ========================================================================
25 * Description: Header file for the wxHtmlAppletWindow class
27 ****************************************************************************/
29 #ifndef __WX_APPLET_WINDOW_H
30 #define __WX_APPLET_WINDOW_H
32 #include "wx/html/htmlwin.h"
36 class wxLoadPageEvent
;
37 class wxPageLoadedEvent
;
40 // Declare a linked list of wxApplet pointers
41 WX_DECLARE_LIST(wxApplet
, wxAppletList
);
43 /*--------------------------- Class Definitions ---------------------------*/
45 /****************************************************************************
47 Defines the class for virtual-link data types
48 ****************************************************************************/
49 class VirtualData
: public wxObject
{
63 wxString
GetName(){ return m_name
;};
64 wxString
GetGroup(){ return m_group
;};
65 wxString
GetHref(){ return m_href
;};
68 void SetName (wxString
& s
){ m_name
= s
; };
69 void SetGroup(wxString
& s
){ m_group
= s
; };
70 void SetHref (wxString
& s
){ m_href
= s
; };
73 /****************************************************************************
75 Defines the class for wxAppletWindow. This class is derived from the
76 wxHtmlWindow class and extends it with functionality to handle embedded
77 wxApplet's on the HTML pages.
78 ****************************************************************************/
79 class wxHtmlAppletWindow
: public wxHtmlWindow
{
81 DECLARE_CLASS(wxHtmlAppletWindow
);
82 DECLARE_EVENT_TABLE();
85 wxIncludePrep
*incPreprocessor
; // deleted by list it is added too in constructor
87 wxAppletList m_AppletList
;
88 static wxHashTable m_Cookies
;
89 wxToolBarBase
*m_NavBar
;
98 wxToolBarBase
*navBar
= NULL
,
100 int navForwardId
= -1,
101 const wxPoint
& pos
= wxDefaultPosition
,
102 const wxSize
& size
= wxDefaultSize
,
103 long style
= wxHW_SCROLLBAR_AUTO
,
104 const wxString
& name
= "htmlAppletWindow");
107 ~wxHtmlAppletWindow();
109 // Create an instance of an applet based on it's class name
110 wxApplet
*CreateApplet(
111 const wxString
& classId
,
112 const wxString
& iName
,
113 const wxHtmlTag
¶ms
,
116 // Find an instance of an applet based on it's class name
117 wxApplet
*FindApplet(const wxString
& className
);
119 // Remove an applet from the window. Called during applet destruction
120 bool RemoveApplet(const wxApplet
*applet
);
122 // Load a new URL page
123 virtual bool LoadPage(const wxString
& location
);
125 // Called when users clicked on hypertext link.
126 virtual void OnLinkClicked(const wxHtmlLinkInfo
& link
);
128 // Handles forward navigation within the HTML stack
129 bool HistoryForward();
131 // Handles backwards navigation within the HTML stack
134 // Broadcast a message to all applets on the page
135 void SendMessage(wxEvent
& msg
);
137 // Register a cookie of data in the applet manager
138 bool RegisterCookie(const wxString
& name
,wxObject
*cookie
);
140 // UnRegister a cookie of data in the applet manager
141 bool UnRegisterCookie(const wxString
& name
);
143 // Find a cookie of data given it's public name
144 wxObject
*FindCookie(const wxString
& name
);
146 // Event handlers to load a new page
147 void OnLoadPage(wxLoadPageEvent
&event
);
149 // Event handlers to load a new page
150 void OnPageLoaded(wxPageLoadedEvent
&event
);
152 // LoadPage mutex locks
153 void Lock() { m_mutexLock
= true;};
154 void UnLock() { m_mutexLock
= false;};
156 // Returns TRUE if the mutex is locked, FALSE otherwise.
157 bool IsLocked() { return m_mutexLock
;};
159 // Tries to lock the mutex. If it can't, returns immediately with false.
164 #endif // __WX_APPLET_WINDOW_H