]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/applet/window.h
Merged latest changes from SciTech code base into wxWindows CVS Tree.
[wxWidgets.git] / contrib / include / wx / applet / window.h
1 /****************************************************************************
2 *
3 * wxWindows HTML Applet Package
4 *
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
6 * All rights reserved.
7 *
8 * ======================================================================
9 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
10 * | |
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. |
18 * | |
19 * |If you received this code in error or you would like to report |
20 * |improper use, please immediately contact SciTech Software, Inc. at |
21 * |530-894-8400. |
22 * | |
23 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
24 * ======================================================================
25 *
26 * Language: ANSI C++
27 * Environment: Any
28 *
29 * Description: Header file for the wxHtmlAppletWindow class
30 *
31 ****************************************************************************/
32
33 #ifndef __WX_APPLET_WINDOW_H
34 #define __WX_APPLET_WINDOW_H
35
36 #include "wx/html/htmlwin.h"
37
38 // Forward declare
39 class wxApplet;
40 class wxLoadPageEvent;
41 class wxPageLoadedEvent;
42 class wxIncludePrep;
43
44 // Declare a linked list of wxApplet pointers
45 WX_DECLARE_LIST(wxApplet, wxAppletList);
46
47 /*--------------------------- Class Definitions ---------------------------*/
48
49 /****************************************************************************
50 REMARKS:
51 Defines the class for virtual-link data types
52 ****************************************************************************/
53 class VirtualData : public wxObject {
54 private:
55 wxString m_name;
56 wxString m_group;
57 wxString m_href;
58
59 public:
60 // Ctors
61 VirtualData(
62 wxString& name,
63 wxString& group,
64 wxString& href );
65
66 // Gets
67 wxString GetName(){ return m_name;};
68 wxString GetGroup(){ return m_group;};
69 wxString GetHref(){ return m_href;};
70
71 // Sets
72 void SetName (wxString& s){ m_name = s; };
73 void SetGroup(wxString& s){ m_group = s; };
74 void SetHref (wxString& s){ m_href = s; };
75 };
76
77 /****************************************************************************
78 REMARKS:
79 Defines the class for wxAppletWindow. This class is derived from the
80 wxHtmlWindow class and extends it with functionality to handle embedded
81 wxApplet's on the HTML pages.
82 ****************************************************************************/
83 class wxHtmlAppletWindow : public wxHtmlWindow {
84 private:
85 DECLARE_CLASS(wxHtmlAppletWindow);
86 DECLARE_EVENT_TABLE();
87
88 wxIncludePrep *incPreprocessor; // deleted by list it is added too in constructor
89 protected:
90 wxAppletList m_AppletList;
91 static wxHashTable m_Cookies;
92 wxToolBarBase *m_NavBar;
93 int m_NavBackId;
94 int m_NavForwardId;
95
96 public:
97 // Constructor
98 wxHtmlAppletWindow(
99 wxWindow *parent,
100 wxWindowID id = -1,
101 wxToolBarBase *navBar = NULL,
102 int navBackId = -1,
103 int navForwardId = -1,
104 const wxPoint& pos = wxDefaultPosition,
105 const wxSize& size = wxDefaultSize,
106 long style = wxHW_SCROLLBAR_AUTO,
107 const wxString& name = "htmlAppletWindow");
108
109 // Destructor
110 ~wxHtmlAppletWindow();
111
112 // Create an instance of an applet based on it's class name
113 wxApplet *CreateApplet(
114 const wxString& classId,
115 const wxString& iName,
116 const wxHtmlTag &params,
117 const wxSize& size);
118
119 // Find an instance of an applet based on it's class name
120 wxApplet *FindApplet(const wxString& className);
121
122 // Remove an applet from the window. Called during applet destruction
123 bool RemoveApplet(const wxApplet *applet);
124
125 // Load a new URL page
126 virtual bool LoadPage(const wxString& location);
127
128 // Called when users clicked on hypertext link.
129 virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
130
131 // Handles forward navigation within the HTML stack
132 bool HistoryForward();
133
134 // Handles backwards navigation within the HTML stack
135 bool HistoryBack();
136
137 // Broadcast a message to all applets on the page
138 void SendMessage(wxEvent& msg);
139
140 // Register a cookie of data in the applet manager
141 bool RegisterCookie(const wxString& name,wxObject *cookie);
142
143 // UnRegister a cookie of data in the applet manager
144 bool UnRegisterCookie(const wxString& name);
145
146 // Find a cookie of data given it's public name
147 wxObject *FindCookie(const wxString& name);
148
149 // Event handlers to load a new page
150 void OnLoadPage(wxLoadPageEvent &event);
151
152 // Event handlers to load a new page
153 void OnPageLoaded(wxPageLoadedEvent &event);
154
155 };
156
157 #endif // __WX_APPLET_WINDOW_H
158