2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #import <WebKit/WebHTMLView.h>
31 @class DOMDocumentFragment;
34 @class WebFrameBridge;
37 @class WebPluginController;
39 @protocol WebHTMLHighlighter
40 - (NSRect)highlightRectForLine:(NSRect)lineRect;
41 - (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line;
44 @interface WebHTMLView (WebPrivate)
46 + (NSArray *)supportedMIMETypes;
47 + (NSArray *)supportedImageMIMETypes;
48 + (NSArray *)supportedNonImageMIMETypes;
49 + (NSArray *)unsupportedTextMIMETypes;
53 // Modifier (flagsChanged) tracking SPI
54 + (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent;
55 - (void)_updateMouseoverWithFakeEvent;
57 - (void)_setAsideSubviews;
58 - (void)_restoreSubviews;
60 - (BOOL)_insideAnotherHTMLView;
61 - (void)_clearLastHitViewIfSelf;
62 - (void)_updateMouseoverWithEvent:(NSEvent *)event;
64 + (NSArray *)_insertablePasteboardTypes;
65 + (NSArray *)_selectionPasteboardTypes;
66 - (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard;
68 - (void)_frameOrBoundsChanged;
70 - (NSImage *)_dragImageForLinkElement:(NSDictionary *)element;
71 - (BOOL)_startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
72 - (void)_handleAutoscrollForMouseDragged:(NSEvent *)event;
73 - (BOOL)_mayStartDragAtEventLocation:(NSPoint)location;
75 - (WebPluginController *)_pluginController;
77 // FIXME: _selectionRect is deprecated in favor of selectionRect, which is in protocol WebDocumentSelection.
78 // We can't remove this yet because it's still in use by Mail.
79 - (NSRect)_selectionRect;
81 - (void)_startAutoscrollTimer:(NSEvent *)event;
82 - (void)_stopAutoscrollTimer;
89 - (BOOL)_canEditRichly;
90 - (BOOL)_canAlterCurrentSelection;
91 - (BOOL)_hasSelection;
92 - (BOOL)_hasSelectionOrInsertionPoint;
95 - (BOOL)_isSelectionInPasswordField;
96 - (BOOL)_isSelectionMisspelled;
97 - (NSArray *)_guessesForMisspelledSelection;
99 - (BOOL)_transparentBackground;
100 - (void)_setTransparentBackground:(BOOL)f;
103 - (NSImage *)_selectionDraggingImage;
104 - (NSRect)_selectionDraggingRect;
105 - (BOOL)_canIncreaseSelectionListLevel;
106 - (BOOL)_canDecreaseSelectionListLevel;
107 - (DOMNode *)_increaseSelectionListLevel;
108 - (DOMNode *)_increaseSelectionListLevelOrdered;
109 - (DOMNode *)_increaseSelectionListLevelUnordered;
110 - (void)_decreaseSelectionListLevel;
111 - (void)_setHighlighter:(id<WebHTMLHighlighter>)highlighter ofType:(NSString*)type;
112 - (void)_removeHighlighterOfType:(NSString*)type;
114 // SPI for DumpRenderTree
115 - (void)_updateActiveState;
117 // Support for displaying multiple text matches.
118 // These methods might end up moving into a protocol, so different document types can specify
119 // whether or not they implement the protocol.
120 // These methods are still in flux; don't rely on them yet.
121 - (unsigned)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag;
122 - (void)unmarkAllTextMatches;
123 - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue;
124 - (BOOL)markedTextMatchesAreHighlighted;
125 - (NSArray *)rectsForTextMatches;