1 /* 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 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 * 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. 16 * 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. 27 */ 28 29 #import "WebTypesInternal.h" 30 #import "WebDelegateImplementationCaching.h" 31 #import <WebCore/PlatformString.h> 32 #import <WebCore/WebCoreKeyboardUIMode.h> 33 #import <wtf/HashMap.h> 34 #import <wtf/RetainPtr.h> 35 36 namespace WebCore { 37 class Page; 38 } 39 40 @class WebInspector; 41 @class WebNodeHighlight; 42 @class WebPluginDatabase; 43 @class WebPreferences; 44 @class WebTextCompletionController; 45 @protocol WebFormDelegate; 46 47 extern BOOL applicationIsTerminating; 48 extern int pluginDatabaseClientCount; 49 50 // FIXME: This should be renamed to WebViewData. 51 @interface WebViewPrivate : NSObject { 52 @public 53 WebCore::Page* page; 54 55 id UIDelegate; 56 id UIDelegateForwarder; 57 id resourceProgressDelegate; 58 id downloadDelegate; 59 id policyDelegate; 60 id policyDelegateForwarder; 61 id frameLoadDelegate; 62 id frameLoadDelegateForwarder; 63 id <WebFormDelegate> formDelegate; 64 id editingDelegate; 65 id editingDelegateForwarder; 66 id scriptDebugDelegate; 67 68 WebInspector *inspector; 69 WebNodeHighlight *currentNodeHighlight; 70 71 BOOL allowsUndo; 72 73 float zoomMultiplier; 74 75 NSString *applicationNameForUserAgent; 76 WebCore::String userAgent; 77 BOOL userAgentOverridden; 78 79 WebPreferences *preferences; 80 BOOL useSiteSpecificSpoofing; 81 82 NSWindow *hostWindow; 83 84 int programmaticFocusCount; 85 86 WebResourceDelegateImplementationCache resourceLoadDelegateImplementations; 87 WebFrameLoadDelegateImplementationCache frameLoadDelegateImplementations; 88 WebScriptDebugDelegateImplementationCache scriptDebugDelegateImplementations; 89 90 void *observationInfo; 91 92 BOOL closed; 93 BOOL shouldCloseWithWindow; 94 BOOL mainFrameDocumentReady; 95 BOOL drawsBackground; 96 BOOL editable; 97 BOOL tabKeyCyclesThroughElementsChanged; 98 BOOL becomingFirstResponder; 99 BOOL becomingFirstResponderFromOutside; 100 BOOL hoverFeedbackSuspended; 101 BOOL usesPageCache; 102 BOOL catchesDelegateExceptions; 103 104 NSColor *backgroundColor; 105 106 NSString *mediaStyle; 107 108 BOOL hasSpellCheckerDocumentTag; 109 NSInteger spellCheckerDocumentTag; 110 111 BOOL smartInsertDeleteEnabled; 112 BOOL selectTrailingWhitespaceEnabled; 113 114 #if ENABLE(DASHBOARD_SUPPORT) 115 BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows; 116 BOOL dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns; 117 BOOL dashboardBehaviorAlwaysAcceptsFirstMouse; 118 BOOL dashboardBehaviorAllowWheelScrolling; 119 #endif 120 121 // WebKit has both a global plug-in database and a separate, per WebView plug-in database. Dashboard uses the per WebView database. 122 WebPluginDatabase *pluginDatabase; 123 124 HashMap<unsigned long, RetainPtr<id> > identifierMap; 125 126 BOOL _keyboardUIModeAccessed; 127 WebCore::KeyboardUIMode _keyboardUIMode; 128 129 BOOL shouldUpdateWhileOffscreen; 130 131 // When this flag is set, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews. 132 BOOL usesDocumentViews; 133 134 #if USE(ACCELERATED_COMPOSITING) 135 // When this flag is set, next time a WebHTMLView draws, it needs to temporarily disable screen updates 136 // so that the NSView drawing is visually synchronized with CALayer updates. 137 BOOL needsOneShotDrawingSynchronization; 138 // Number of WebHTMLViews using accelerated compositing. Used to implement _isUsingAcceleratedCompositing. 139 int acceleratedFramesCount; 140 // Run loop observer used to implement the compositing equivalent of -viewWillDraw 141 CFRunLoopObserverRef layerSyncRunLoopObserver; 142 #endif 143 144 NSPasteboard *insertionPasteboard; 145 146 NSSize lastLayoutSize; 147 148 BOOL ignoringMouseDraggedEvents; 149 150 NSEvent *mouseDownEvent; // Kept after handling the event. 151 BOOL handlingMouseDownEvent; 152 NSEvent *keyDownEvent; // Kept after handling the event. 153 154 WebTextCompletionController *completionController; 155 156 NSTimer *autoscrollTimer; 157 NSEvent *autoscrollTriggerEvent; 158 159 CFRunLoopTimerRef updateMouseoverTimer; 160 } 161 @end 162