• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
  • svg
  • graphics
SVGImageEmptyClients.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef SVGImageEmptyClients_h
27 #define SVGImageEmptyClients_h
28 
29 #if ENABLE(SVG)
30 
31 #include "ChromeClient.h"
32 #include "ContextMenuClient.h"
33 #include "DragClient.h"
34 #include "EditorClient.h"
35 #include "FocusDirection.h"
36 #include "FrameLoaderClient.h"
37 #include "InspectorClient.h"
38 #include "SharedBuffer.h"
39 
40 /*
41  This file holds empty Client stubs for use by SVGImage.
42  SVGImage needs to create a dummy Page->Frame->FrameView tree for use in parsing an SVGDocument.
43  This tree depends heavily on Clients (usually provided by WebKit classes).
44 
45  SVGImage has no way to access the current Page (nor should it, since Images are not tied to a page).
46  See http://bugs.webkit.org/show_bug.cgi?id=5971 for more discussion on this issue.
47 
48  Ideally, whenever you change a Client class, you should add a stub here.
49  Brittle, yes. Unfortunate, yes. Hopefully temporary.
50 */
51 
52 namespace WebCore {
53 
54 class SVGEmptyChromeClient : public ChromeClient {
55 public:
56  virtual ~SVGEmptyChromeClient() { }
57  virtual void chromeDestroyed() { }
58 
59  virtual void setWindowRect(const FloatRect&) { }
60  virtual FloatRect windowRect() { return FloatRect(); }
61 
62  virtual FloatRect pageRect() { return FloatRect(); }
63 
64  virtual float scaleFactor() { return 1.f; }
65 
66  virtual void focus() { }
67  virtual void unfocus() { }
68 
69  virtual bool canTakeFocus(FocusDirection) { return false; }
70  virtual void takeFocus(FocusDirection) { }
71 
72  virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) { return 0; }
73  virtual void show() { }
74 
75  virtual bool canRunModal() { return false; }
76  virtual void runModal() { }
77 
78  virtual void setToolbarsVisible(bool) { }
79  virtual bool toolbarsVisible() { return false; }
80 
81  virtual void setStatusbarVisible(bool) { }
82  virtual bool statusbarVisible() { return false; }
83 
84  virtual void setScrollbarsVisible(bool) { }
85  virtual bool scrollbarsVisible() { return false; }
86 
87  virtual void setMenubarVisible(bool) { }
88  virtual bool menubarVisible() { return false; }
89 
90  virtual void setResizable(bool) { }
91 
92  virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) { }
93 
94  virtual bool canRunBeforeUnloadConfirmPanel() { return false; }
95  virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame) { return true; }
96 
97  virtual void closeWindowSoon() { }
98 
99  virtual void runJavaScriptAlert(Frame*, const String&) { }
100  virtual bool runJavaScriptConfirm(Frame*, const String&) { return false; }
101  virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) { return false; }
102  virtual bool shouldInterruptJavaScript() { return false; }
103 
104  virtual void setStatusbarText(const String&) { }
105 
106  virtual bool tabsToLinks() const { return false; }
107 
108  virtual IntRect windowResizerRect() const { return IntRect(); }
109  virtual void addToDirtyRegion(const IntRect&) { }
110  virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect) { }
111  virtual void updateBackingStore() { }
112 
113  virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) { }
114 
115  virtual void setToolTip(const String&) { }
116 
117  virtual void print(Frame*) { }
118 
119  virtual void exceededDatabaseQuota(Frame*, const String&) { }
120 };
121 
122 class SVGEmptyFrameLoaderClient : public FrameLoaderClient {
123 public:
124  virtual ~SVGEmptyFrameLoaderClient() { }
125  virtual void frameLoaderDestroyed() { }
126 
127  virtual bool hasWebView() const { return true; } // mainly for assertions
128  virtual bool hasFrameView() const { return true; } // ditto
129 
130  virtual void makeRepresentation(DocumentLoader*) { }
131  virtual void forceLayout() { }
132  virtual void forceLayoutForNonHTML() { }
133 
134  virtual void updateHistoryForCommit() { }
135 
136  virtual void updateHistoryForBackForwardNavigation() { }
137  virtual void updateHistoryForReload() { }
138  virtual void updateHistoryForStandardLoad() { }
139  virtual void updateHistoryForInternalLoad() { }
140 
141  virtual void updateHistoryAfterClientRedirect() { }
142 
143  virtual void setCopiesOnScroll() { }
144 
145  virtual void detachedFromParent2() { }
146  virtual void detachedFromParent3() { }
147  virtual void detachedFromParent4() { }
148 
149  virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) { }
150 
151  virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) { }
152  virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse) { }
153  virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&) { }
154  virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&) { }
155  virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&) { }
156  virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived) { }
157  virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) { }
158  virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&) { }
159  virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length) { return false; }
160 
161  virtual void dispatchDidHandleOnloadEvents() { }
162  virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() { }
163  virtual void dispatchDidCancelClientRedirect() { }
164  virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate) { }
165  virtual void dispatchDidChangeLocationWithinPage() { }
166  virtual void dispatchWillClose() { }
167  virtual void dispatchDidReceiveIcon() { }
168  virtual void dispatchDidStartProvisionalLoad() { }
169  virtual void dispatchDidReceiveTitle(const String& title) { }
170  virtual void dispatchDidCommitLoad() { }
171  virtual void dispatchDidFailProvisionalLoad(const ResourceError&) { }
172  virtual void dispatchDidFailLoad(const ResourceError&) { }
173  virtual void dispatchDidFinishDocumentLoad() { }
174  virtual void dispatchDidFinishLoad() { }
175  virtual void dispatchDidFirstLayout() { }
176 
177  virtual Frame* dispatchCreatePage() { return 0; }
178  virtual void dispatchShow() { }
179 
180  virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&) { }
181  virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, const String& frameName) { }
182  virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&) { }
183  virtual void cancelPolicyCheck() { }
184 
185  virtual void dispatchUnableToImplementPolicy(const ResourceError&) { }
186 
187  virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>) { }
188 
189  virtual void dispatchDidLoadMainResource(DocumentLoader*) { }
190  virtual void revertToProvisionalState(DocumentLoader*) { }
191  virtual void setMainDocumentError(DocumentLoader*, const ResourceError&) { }
192 
193  virtual void willChangeEstimatedProgress() { }
194  virtual void didChangeEstimatedProgress() { }
195  virtual void postProgressStartedNotification() { }
196  virtual void postProgressEstimateChangedNotification() { }
197  virtual void postProgressFinishedNotification() { }
198 
199  virtual void setMainFrameDocumentReady(bool) { }
200 
201  virtual void startDownload(const ResourceRequest&) { }
202 
203  virtual void willChangeTitle(DocumentLoader*) { }
204  virtual void didChangeTitle(DocumentLoader*) { }
205 
206  virtual void committedLoad(DocumentLoader*, const char*, int) { }
207  virtual void finishedLoading(DocumentLoader*) { }
208 
209  virtual ResourceError cancelledError(const ResourceRequest&) { return ResourceError(); }
210  virtual ResourceError blockedError(const ResourceRequest&) { return ResourceError(); }
211  virtual ResourceError cannotShowURLError(const ResourceRequest&) { return ResourceError(); }
212  virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&) { return ResourceError(); }
213 
214  virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&) { return ResourceError(); }
215  virtual ResourceError fileDoesNotExistError(const ResourceResponse&) { return ResourceError(); }
216 
217  virtual bool shouldFallBack(const ResourceError&) { return false; }
218 
219  virtual bool canHandleRequest(const ResourceRequest&) const { return false; }
220  virtual bool canShowMIMEType(const String& MIMEType) const { return false; }
221  virtual bool representationExistsForURLScheme(const String& URLScheme) const { return false; }
222  virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const { return ""; }
223 
224  virtual void frameLoadCompleted() { }
225  virtual void restoreViewState() { }
226  virtual void provisionalLoadStarted() { }
227  virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const { return false; }
228  virtual void addHistoryItemForFragmentScroll() { }
229  virtual void didFinishLoad() { }
230  virtual void prepareForDataSourceReplacement() { }
231 
232  virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return new DocumentLoader(request, substituteData); }
233  virtual void setTitle(const String& title, const KURL&) { }
234 
235  virtual String userAgent(const KURL&) { return ""; }
236 
237  virtual void savePlatformDataToCachedPage(CachedPage*) { }
238  virtual void transitionToCommittedFromCachedPage(CachedPage*) { }
239  virtual void transitionToCommittedForNewPage() { }
240 
241  virtual void updateGlobalHistory(const KURL&) { }
242  virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; }
243  virtual void saveViewStateToItem(HistoryItem*) { }
244  virtual bool canCachePage() const { return false; }
245 
246  virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
247  const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) { return 0; }
248  virtual Widget* createPlugin(const IntSize&,Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
249  virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
250 
251  virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) { return ObjectContentType(); }
252  virtual String overrideMediaType() const { return String(); }
253 
254  virtual void redirectDataToPlugin(Widget*) {}
255  virtual void windowObjectCleared() {}
256  virtual void didPerformFirstNavigation() const {}
257 
258  virtual void registerForIconNotification(bool listen) {}
259 
260 #if PLATFORM(MAC)
261  virtual NSCachedURLResponse* willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse* response) const { return response; }
262 #endif
263 
264 };
265 
266 class SVGEmptyEditorClient : public EditorClient {
267 public:
268  virtual ~SVGEmptyEditorClient() { }
269  virtual void pageDestroyed() { }
270 
271  virtual bool shouldDeleteRange(Range*) { return false; }
272  virtual bool shouldShowDeleteInterface(HTMLElement*) { return false; }
273  virtual bool smartInsertDeleteEnabled() { return false; }
274  virtual bool isContinuousSpellCheckingEnabled() { return false; }
275  virtual void toggleContinuousSpellChecking() { }
276  virtual bool isGrammarCheckingEnabled() { return false; }
277  virtual void toggleGrammarChecking() { }
278  virtual int spellCheckerDocumentTag() { return -1; }
279 
280  virtual bool selectWordBeforeMenuEvent() { return false; }
281  virtual bool isEditable() { return false; }
282 
283  virtual bool shouldBeginEditing(Range*) { return false; }
284  virtual bool shouldEndEditing(Range*) { return false; }
285  virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction) { return false; }
286  // virtual bool shouldInsertNode(Node*, Range* replacingRange, WebViewInsertAction) { return false; }
287  virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) { return false; }
288  virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) { return false; }
289 
290  virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*) { return false; }
291  virtual bool shouldMoveRangeAfterDelete(Range*, Range*) { return false; }
292  // virtual bool shouldChangeTypingStyle(CSSStyleDeclaration* fromStyle, CSSStyleDeclaration* toStyle) { return false; }
293  // virtual bool doCommandBySelector(SEL selector) { return false; }
294  //
295  virtual void didBeginEditing() { }
296  virtual void respondToChangedContents() { }
297  virtual void respondToChangedSelection() { }
298  virtual void didEndEditing() { }
299  virtual void didWriteSelectionToPasteboard() { }
300  virtual void didSetSelectionTypesForPasteboard() { }
301  // virtual void webViewDidChangeTypingStyle:(NSNotification *)notification { }
302  // virtual void webViewDidChangeSelection:(NSNotification *)notification { }
303  // virtual NSUndoManager* undoManagerForWebView:(WebView *)webView { return 0; }
304 
305  virtual void registerCommandForUndo(PassRefPtr<EditCommand>) { }
306  virtual void registerCommandForRedo(PassRefPtr<EditCommand>) { }
307  virtual void clearUndoRedoOperations() { }
308 
309  virtual bool canUndo() const { return false; }
310  virtual bool canRedo() const { return false; }
311 
312  virtual void undo() { }
313  virtual void redo() { }
314 
315  virtual void handleKeyboardEvent(KeyboardEvent*) { }
316  virtual void handleInputMethodKeydown(KeyboardEvent*) { }
317 
318  virtual void textFieldDidBeginEditing(Element*) { }
319  virtual void textFieldDidEndEditing(Element*) { }
320  virtual void textDidChangeInTextField(Element*) { }
321  virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*) { return false; }
322  virtual void textWillBeDeletedInTextField(Element*) { }
323  virtual void textDidChangeInTextArea(Element*) { }
324 
325 #if PLATFORM(MAC)
326  virtual void markedTextAbandoned(Frame*) { }
327 
328  virtual NSString* userVisibleString(NSURL*) { return 0; }
329 #ifdef BUILDING_ON_TIGER
330  virtual NSArray* pasteboardTypesForSelection(Frame*) { return 0; }
331 #endif
332 #endif
333  virtual void ignoreWordInSpellDocument(const String&) { }
334  virtual void learnWord(const String&) { }
335  virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength) { }
336  virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) { }
337  virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { }
338  virtual void updateSpellingUIWithMisspelledWord(const String&) { }
339  virtual void showSpellingUI(bool show) { }
340  virtual bool spellingUIIsShowing() { return false; }
341  virtual void getGuessesForWord(const String&, Vector<String>& guesses) { }
342  virtual void setInputMethodState(bool enabled) { }
343 
344 
345 };
346 
347 class SVGEmptyContextMenuClient : public ContextMenuClient {
348 public:
349  virtual ~SVGEmptyContextMenuClient() { }
350  virtual void contextMenuDestroyed() { }
351 
352  virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*) { return 0; }
353  virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) { }
354 
355  virtual void downloadURL(const KURL& url) { }
356  virtual void copyImageToClipboard(const HitTestResult&) { }
357  virtual void searchWithGoogle(const Frame*) { }
358  virtual void lookUpInDictionary(Frame*) { }
359  virtual void speak(const String&) { }
360  virtual void stopSpeaking() { }
361 
362 #if PLATFORM(MAC)
363  virtual void searchWithSpotlight() { }
364 #endif
365 };
366 
367 class SVGEmptyDragClient : public DragClient {
368 public:
369  virtual ~SVGEmptyDragClient() {}
370  virtual void willPerformDragDestinationAction(DragDestinationAction, DragData*) { }
371  virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) { }
372  virtual DragDestinationAction actionMaskForDrag(DragData*) { return DragDestinationActionNone; }
373  virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&) { return DragSourceActionNone; }
374  virtual void startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) { }
375  virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*) { return 0; }
376  virtual void dragControllerDestroyed() { }
377 };
378 
379 class SVGEmptyInspectorClient : public InspectorClient {
380 public:
381  virtual ~SVGEmptyInspectorClient() {}
382 
383  virtual void inspectorDestroyed() {};
384 
385  virtual Page* createPage() { return 0; };
386 
387  virtual String localizedStringsURL() { return String(); };
388 
389  virtual void showWindow() {};
390  virtual void closeWindow() {};
391 
392  virtual void attachWindow() {};
393  virtual void detachWindow() {};
394 
395  virtual void highlight(Node*) {};
396  virtual void hideHighlight() {};
397  virtual void inspectedURLChanged(const String& newURL) {};
398 };
399 
400 }
401 
402 #endif // ENABLE(SVG)
403 
404 #endif // SVGImageEmptyClients_h
405 
print
KAction * print(const QObject *recvr, const char *slot, QObject *parent)
closeWindow
KGuiItem closeWindow()
undo
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
WebCore::Frame
KHTMLView Frame
Definition: Frame.h:9
redo
KAction * redo(const QObject *recvr, const char *slot, QObject *parent)
WebCore::String
DOM::DOMString String
Definition: PlatformString.h:8
DOM::enabled
static bool enabled(KHTMLPart *)
Definition: jsediting.cpp:383
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal