2
* Copyright (C) 2005, 2006, 2007, 2008 Apple 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
#if !defined(ENABLE_NETSCAPE_PLUGIN_API)
32
#define ENABLE_NETSCAPE_PLUGIN_API 1
35
@class DOMDocumentFragment;
38
@class WebPluginController;
40
@protocol WebHTMLHighlighter
41
- (NSRect)highlightRectForLine:(NSRect)lineRect representedNode:(DOMNode *)node;
42
- (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line representedNode:(DOMNode *)node;
45
extern const float _WebHTMLViewPrintingMinimumShrinkFactor;
46
extern const float _WebHTMLViewPrintingMaximumShrinkFactor;
48
@interface WebHTMLView (WebPrivate)
50
+ (NSArray *)supportedMIMETypes;
51
+ (NSArray *)supportedImageMIMETypes;
52
+ (NSArray *)supportedNonImageMIMETypes;
53
+ (NSArray *)unsupportedTextMIMETypes;
57
// Modifier (flagsChanged) tracking SPI
58
+ (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent;
59
- (void)_updateMouseoverWithFakeEvent;
61
- (void)_setAsideSubviews;
62
- (void)_restoreSubviews;
64
- (BOOL)_insideAnotherHTMLView;
65
- (void)_clearLastHitViewIfSelf;
66
- (void)_updateMouseoverWithEvent:(NSEvent *)event;
68
+ (NSArray *)_insertablePasteboardTypes;
69
+ (NSArray *)_selectionPasteboardTypes;
70
- (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard;
72
- (void)_frameOrBoundsChanged;
74
- (void)_handleAutoscrollForMouseDragged:(NSEvent *)event;
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;
85
- (BOOL)_canEditRichly;
86
- (BOOL)_canAlterCurrentSelection;
87
- (BOOL)_hasSelection;
88
- (BOOL)_hasSelectionOrInsertionPoint;
91
- (BOOL)_transparentBackground;
92
- (void)_setTransparentBackground:(BOOL)isBackgroundTransparent;
94
- (void)_setToolTip:(NSString *)string;
97
// FIXME: These should all be moved to WebView; we won't always have a WebHTMLView.
98
- (NSImage *)_selectionDraggingImage;
99
- (NSRect)_selectionDraggingRect;
100
- (DOMNode *)_insertOrderedList;
101
- (DOMNode *)_insertUnorderedList;
102
- (BOOL)_canIncreaseSelectionListLevel;
103
- (BOOL)_canDecreaseSelectionListLevel;
104
- (DOMNode *)_increaseSelectionListLevel;
105
- (DOMNode *)_increaseSelectionListLevelOrdered;
106
- (DOMNode *)_increaseSelectionListLevelUnordered;
107
- (void)_decreaseSelectionListLevel;
108
- (void)_setHighlighter:(id <WebHTMLHighlighter>)highlighter ofType:(NSString *)type;
109
- (void)_removeHighlighterOfType:(NSString *)type;
110
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context subresources:(NSArray **)subresources;
112
#if ENABLE_NETSCAPE_PLUGIN_API
113
- (void)_resumeNullEventsForAllNetscapePlugins;
114
- (void)_pauseNullEventsForAllNetscapePlugins;
117
- (BOOL)_isUsingAcceleratedCompositing;
118
- (NSView *)_compositingLayersHostingView;
120
// SPI for printing (should be converted to API someday). When the WebHTMLView isn't being printed
121
// directly, this method must be called before paginating, or the computed height might be incorrect.
122
// Typically this would be called from inside an override of -[NSView knowsPageRange:].
123
- (void)_layoutForPrinting;
124
- (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit;
125
- (BOOL)_isInPrintMode;
126
- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit;
127
// Lays out to pages of the given minimum width and height or more (increasing both dimensions proportionally)
128
// as needed for the content to fit, but no more than the given maximum width.
129
- (BOOL)_beginPrintModeWithMinimumPageWidth:(CGFloat)minimumPageWidth height:(CGFloat)minimumPageHeight maximumPageWidth:(CGFloat)maximumPageWidth;
130
- (void)_endPrintMode;
132
- (BOOL)_isInScreenPaginationMode;
133
- (BOOL)_beginScreenPaginationModeWithPageSize:(CGSize)pageSize shrinkToFit:(BOOL)shrinkToFit;
134
- (void)_endScreenPaginationMode;
136
- (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard;