2 * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "wx/wxprec.h"
36 #include "WebKitDefines.h"
41 #include "WebDOMSelection.h"
45 class WebFramePrivate;
46 class WebViewFrameData;
52 class FrameLoaderClientWx;
56 class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo
59 wxWebViewDOMElementInfo();
60 wxWebViewDOMElementInfo(const wxWebViewDOMElementInfo& other);
62 ~wxWebViewDOMElementInfo();
64 wxString GetTagName() const { return m_tagName; }
65 void SetTagName(const wxString& name) { m_tagName = name; }
67 bool IsSelected() const { return m_isSelected; }
68 void SetSelected(bool sel) { m_isSelected = sel; }
70 wxString GetText() const { return m_text; }
71 void SetText(const wxString& text) { m_text = text; }
73 wxString GetImageSrc() const { return m_imageSrc; }
74 void SetImageSrc(const wxString& src) { m_imageSrc = src; }
76 wxString GetLink() const { return m_link; }
77 void SetLink(const wxString& link) { m_link = link; }
79 WebDOMNode* GetInnerNode() { return m_innerNode; }
80 void SetInnerNode(WebDOMNode* node) { m_innerNode = node; }
82 WebDOMElement* GetURLElement() { return m_urlElement; }
83 void SetURLElement(WebDOMElement* url) { m_urlElement = url; }
86 WebDOMNode* m_innerNode;
87 WebDOMElement* m_urlElement;
95 // based on enums in WebCore/dom/Document.h
96 enum wxWebKitCompatibilityMode { QuirksMode, LimitedQuirksMode, NoQuirksMode };
98 class WXDLLIMPEXP_WEBKIT wxWebFrame
101 // ChromeClientWx needs to get the Page* stored by the wxWebView
102 // for the createWindow function.
103 friend class WebCore::ChromeClientWx;
104 friend class WebCore::FrameLoaderClientWx;
105 friend class WebCore::EditorClientWx;
106 friend class wxWebView;
109 wxWebFrame(wxWebView* container, wxWebFrame* parent = NULL, WebViewFrameData* data = NULL);
113 void LoadURL(const wxString& url);
118 void Print(bool showDialog = true);
139 wxString GetPageSource();
140 void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString, const wxString& mimetype = wxT("text/html"));
142 wxString GetInnerText();
143 wxString GetAsMarkup();
144 wxString GetExternalRepresentation();
146 wxWebKitSelection GetSelection();
147 wxString GetSelectionAsHTML();
148 wxString GetSelectionAsText();
150 wxString RunScript(const wxString& javascript);
151 bool ExecuteEditCommand(const wxString& command, const wxString& parameter = wxEmptyString);
152 EditState GetEditCommandState(const wxString& command) const;
153 wxString GetEditCommandValue(const wxString& command) const;
155 bool FindString(const wxString& string, bool forward = true,
156 bool caseSensitive = false, bool wrapSelection = true,
157 bool startInSelection = true);
159 bool CanIncreaseTextSize() const;
160 void IncreaseTextSize();
161 bool CanDecreaseTextSize() const;
162 void DecreaseTextSize();
163 void ResetTextSize();
164 void MakeEditable(bool enable);
165 bool IsEditable() const;
167 WebCore::Frame* GetFrame();
169 wxWebViewDOMElementInfo HitTest(const wxPoint& post) const;
171 bool ShouldClose() const;
173 wxWebKitCompatibilityMode GetCompatibilityMode() const;
175 void GrantUniversalAccess();
178 float m_textMagnifier;
179 bool m_isInitialized;
180 bool m_beingDestroyed;
181 WebFramePrivate* m_impl;
186 wxWebFrame* kit(WebCore::Frame*);
189 #endif // ifndef WXWEBFRAME_H