Remove long-deprecated unused WKView minimumLayoutWidth properties
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / Cocoa / WKViewPrivate.h
1 /*
2  * Copyright (C) 2011, 2014 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  * 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 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.
24  */
25
26 #import <WebKit/WKActionMenuTypes.h>
27 #import <WebKit/WKBase.h>
28 #import <WebKit/WKImmediateActionTypes.h>
29 #import <WebKit/WKLayoutMode.h>
30 #import <WebKit/WKView.h>
31
32 @interface WKView (Private)
33
34 /* C SPI support. */
35
36 @property (readonly) WKPageRef pageRef;
37
38 #if TARGET_OS_IPHONE
39 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
40 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;
41 #else
42 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
43 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;
44 - (id)initWithFrame:(NSRect)frame configurationRef:(WKPageConfigurationRef)configuration;
45 #endif
46
47 #if TARGET_OS_IPHONE
48
49 @property (nonatomic) CGSize minimumLayoutSizeOverride;
50
51 // Define the inset of the scrollview unusable by the web page.
52 @property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
53
54 @property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
55
56 // This is deprecated and should be removed entirely: <rdar://problem/16294704>.
57 @property (readonly) UIColor *_pageExtendedBackgroundColor;
58
59 - (void)_beginInteractiveObscuredInsetsChange;
60 - (void)_endInteractiveObscuredInsetsChange;
61 - (void)_didRelaunchProcess;
62
63 #else
64
65 - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
66 - (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
67
68 - (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset;
69
70 // Stops updating the size of the page as the WKView frame size updates.
71 // This should always be followed by enableFrameSizeUpdates. Calls can be nested.
72 - (void)disableFrameSizeUpdates;
73 // Immediately updates the size of the page to match WKView's frame size
74 // and allows subsequent updates as the frame size is set. Calls can be nested.
75 - (void)enableFrameSizeUpdates;
76 - (BOOL)frameSizeUpdatesDisabled;
77
78 + (void)hideWordDefinitionWindow;
79
80 @property (readwrite) NSSize minimumSizeForAutoLayout;
81 @property (readwrite) BOOL shouldClipToVisibleRect;
82 @property (readwrite) BOOL shouldExpandToViewHeightForAutoLayout;
83 @property (readonly, getter=isUsingUISideCompositing) BOOL usingUISideCompositing;
84 @property (readwrite) BOOL allowsMagnification;
85 @property (readwrite) double magnification;
86 @property (readwrite, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents;
87 @property (readwrite, setter=_setIgnoresAllEvents:) BOOL _ignoresAllEvents;
88 @property (readwrite) BOOL allowsBackForwardNavigationGestures;
89 @property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
90 @property (nonatomic, setter=_setTotalHeightOfBanners:) CGFloat _totalHeightOfBanners;
91
92 @property (nonatomic, setter=_setLayoutMode:) WKLayoutMode _layoutMode;
93 @property (nonatomic, setter=_setFixedLayoutSize:) CGSize _fixedLayoutSize;
94
95 @property (nonatomic, setter=_setViewScale:) CGFloat _viewScale;
96
97 @property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
98
99 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
100 @property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
101 #endif
102
103 @property (readonly) NSColor *_pageExtendedBackgroundColor;
104 @property (copy, nonatomic) NSColor *underlayColor;
105
106 #if WK_API_ENABLED
107 @property (strong, nonatomic, setter=_setInspectorAttachmentView:) NSView *_inspectorAttachmentView WK_AVAILABLE(WK_MAC_TBA, NA);
108 #endif
109
110 - (NSView*)fullScreenPlaceholderView;
111 - (NSWindow*)createFullScreenWindow;
112
113 - (void)beginDeferringViewInWindowChanges;
114 - (void)endDeferringViewInWindowChanges;
115 - (void)endDeferringViewInWindowChangesSync;
116 - (BOOL)isDeferringViewInWindowChanges;
117 - (void)_prepareForMoveToWindow:(NSWindow *)targetWindow withCompletionHandler:(void(^)(void))completionHandler;
118
119 - (BOOL)windowOcclusionDetectionEnabled;
120 - (void)setWindowOcclusionDetectionEnabled:(BOOL)flag;
121
122 - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size;
123 - (void)waitForAsyncDrawingAreaSizeUpdate;
124
125 - (void)setMagnification:(double)magnification centeredAtPoint:(NSPoint)point;
126
127 - (void)saveBackForwardSnapshotForCurrentItem;
128 - (void)saveBackForwardSnapshotForItem:(WKBackForwardListItemRef)item;
129
130 // 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.
131 - (void)_setCustomSwipeViews:(NSArray *)customSwipeViews;
132 // The top content inset is applied in the window's coordinate space, to the union of the custom swipe view's frames.
133 - (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset;
134 - (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState;
135 // The rect returned is always that of the snapshot, and only if it is the view being manipulated by the swipe. This only works for layer-backed windows.
136 - (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect swipeSnapshotRectInWindowCoordinates))callback;
137
138 - (NSArray *)_actionMenuItemsForHitTestResult:(WKHitTestResultRef)hitTestResult withType:(_WKActionMenuType)type defaultActionMenuItems:(NSArray *)defaultMenuItems;
139 - (NSArray *)_actionMenuItemsForHitTestResult:(WKHitTestResultRef)hitTestResult withType:(_WKActionMenuType)type defaultActionMenuItems:(NSArray *)defaultMenuItems userData:(WKTypeRef)userData;
140
141 // Clients that want to maintain default behavior can return nil. To disable the immediate action entirely, return NSNull. And to
142 // do something custom, return an object that conforms to the NSImmediateActionAnimationController protocol.
143 - (id)_immediateActionAnimationControllerForHitTestResult:(WKHitTestResultRef)hitTestResult withType:(_WKImmediateActionType)type userData:(WKTypeRef)userData;
144
145 - (void)_prepareForImmediateActionAnimation;
146 - (void)_cancelImmediateActionAnimation;
147 - (void)_completeImmediateActionAnimation;
148
149 - (void)_dismissContentRelativeChildWindows;
150 - (void)_dismissContentRelativeChildWindowsWithAnimation:(BOOL)withAnimation;
151
152 - (void)_didChangeContentSize:(NSSize)newSize;
153 #endif
154
155 @end