2 * Copyright (C) 2011, 2014 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
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.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 #import <WebKit/WKBase.h>
27 #import <WebKit/WKView.h>
29 @interface WKView (Private)
33 @property (readonly) WKPageRef pageRef;
36 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
37 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;
39 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
40 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;
45 @property (nonatomic) CGSize minimumLayoutSizeOverride;
47 // Define the inset of the scrollview unusable by the web page.
48 @property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
50 @property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
52 // This is deprecated and should be removed entirely: <rdar://problem/16294704>.
53 @property (readonly) UIColor *_pageExtendedBackgroundColor;
55 - (void)_beginInteractiveObscuredInsetsChange;
56 - (void)_endInteractiveObscuredInsetsChange;
60 - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
61 - (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
63 - (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset;
65 // Stops updating the size of the page as the WKView frame size updates.
66 // This should always be followed by enableFrameSizeUpdates. Calls can be nested.
67 - (void)disableFrameSizeUpdates;
68 // Immediately updates the size of the page to match WKView's frame size
69 // and allows subsequent updates as the frame size is set. Calls can be nested.
70 - (void)enableFrameSizeUpdates;
71 - (BOOL)frameSizeUpdatesDisabled;
73 + (void)hideWordDefinitionWindow;
75 @property (readwrite) CGFloat minimumLayoutWidth;
76 @property (readwrite) CGFloat minimumWidthForAutoLayout;
77 @property (readwrite) NSSize minimumSizeForAutoLayout;
78 @property (readwrite) BOOL shouldClipToVisibleRect;
79 @property (readwrite) BOOL shouldExpandToViewHeightForAutoLayout;
80 @property (readonly, getter=isUsingUISideCompositing) BOOL usingUISideCompositing;
81 @property (readwrite) BOOL allowsMagnification;
82 @property (readwrite) double magnification;
83 @property (readwrite) BOOL allowsBackForwardNavigationGestures;
84 @property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
86 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
87 @property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
90 @property (readonly) NSColor *_pageExtendedBackgroundColor;
91 @property(copy, nonatomic) NSColor *underlayColor;
93 - (NSView*)fullScreenPlaceholderView;
94 - (NSWindow*)createFullScreenWindow;
96 - (void)beginDeferringViewInWindowChanges;
97 - (void)endDeferringViewInWindowChanges;
98 - (void)endDeferringViewInWindowChangesSync;
99 - (BOOL)isDeferringViewInWindowChanges;
101 - (BOOL)windowOcclusionDetectionEnabled;
102 - (void)setWindowOcclusionDetectionEnabled:(BOOL)flag;
104 - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size;
105 - (void)waitForAsyncDrawingAreaSizeUpdate;
107 - (void)setMagnification:(double)magnification centeredAtPoint:(NSPoint)point;
109 - (void)saveBackForwardSnapshotForCurrentItem;
111 // Views must be layer-backed, have no transform applied, be in back-to-front z-order, and the whole set must be a contiguous opaque rectangle.
112 - (void)_setCustomSwipeViews:(NSArray *)customSwipeViews;
113 // The top content inset is applied in the window's coordinate space, to the union of the custom swipe view's frames.
114 - (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset;
115 - (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState;