Unreviewed, rolling out r245401.
[WebKit-https.git] / Source / WebKit / UIProcess / API / Cocoa / WKWebpagePreferencesPrivate.h
1 /*
2  * Copyright (C) 2019 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 #pragma once
27
28 #import <WebKit/WKFoundation.h>
29 #import <WebKit/WKWebpagePreferences.h>
30 #import <WebKit/WKWebsiteDataStore.h>
31
32 typedef NS_ENUM(NSInteger, _WKWebsiteAutoplayPolicy) {
33     _WKWebsiteAutoplayPolicyDefault,
34     _WKWebsiteAutoplayPolicyAllow,
35     _WKWebsiteAutoplayPolicyAllowWithoutSound,
36     _WKWebsiteAutoplayPolicyDeny
37 } WK_API_AVAILABLE(macos(10.13), ios(11.0));
38
39 typedef NS_OPTIONS(NSUInteger, _WKWebsiteAutoplayQuirk) {
40     _WKWebsiteAutoplayQuirkSynthesizedPauseEvents = 1 << 0,
41     _WKWebsiteAutoplayQuirkInheritedUserGestures = 1 << 1,
42     _WKWebsiteAutoplayQuirkArbitraryUserGestures = 1 << 2,
43     _WKWebsiteAutoplayQuirkPerDocumentAutoplayBehavior = 1 << 3,
44 } WK_API_AVAILABLE(macos(10.13), ios(11.0));
45
46 typedef NS_OPTIONS(NSUInteger, _WKWebsitePopUpPolicy) {
47     _WKWebsitePopUpPolicyDefault,
48     _WKWebsitePopUpPolicyAllow,
49     _WKWebsitePopUpPolicyBlock,
50 } WK_API_AVAILABLE(macos(10.14), ios(12.0));
51
52 typedef NS_OPTIONS(NSUInteger, _WKWebsiteDeviceOrientationAndMotionAccessPolicy) {
53     _WKWebsiteDeviceOrientationAndMotionAccessPolicyAsk,
54     _WKWebsiteDeviceOrientationAndMotionAccessPolicyGrant,
55     _WKWebsiteDeviceOrientationAndMotionAccessPolicyDeny,
56 } WK_API_AVAILABLE(macos(10.14), ios(12.0));
57
58 @interface WKWebpagePreferences (WKPrivate)
59
60 @property (nonatomic, setter=_setContentBlockersEnabled:) BOOL _contentBlockersEnabled;
61 @property (nonatomic, setter=_setAllowedAutoplayQuirks:) _WKWebsiteAutoplayQuirk _allowedAutoplayQuirks;
62 @property (nonatomic, setter=_setAutoplayPolicy:) _WKWebsiteAutoplayPolicy _autoplayPolicy;
63 @property (nonatomic, copy, setter=_setCustomHeaderFields:) NSDictionary<NSString *, NSString *> *_customHeaderFields;
64 @property (nonatomic, setter=_setPopUpPolicy:) _WKWebsitePopUpPolicy _popUpPolicy;
65 @property (nonatomic, strong, setter=_setWebsiteDataStore:) WKWebsiteDataStore *_websiteDataStore;
66 @property (nonatomic, copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
67 @property (nonatomic, copy, setter=_setCustomJavaScriptUserAgentAsSiteSpecificQuirks:) NSString *_customJavaScriptUserAgentAsSiteSpecificQuirks;
68 @property (nonatomic, copy, setter=_setCustomNavigatorPlatform:) NSString *_customNavigatorPlatform;
69 @property (nonatomic, setter=_setDeviceOrientationAndMotionAccessPolicy:) _WKWebsiteDeviceOrientationAndMotionAccessPolicy _deviceOrientationAndMotionAccessPolicy;
70 @property (nonatomic, setter=_setAllowSiteSpecificQuirksToOverrideCompatibilityMode:) BOOL _allowSiteSpecificQuirksToOverrideCompatibilityMode;
71
72 @property (nonatomic, copy, setter=_setApplicationNameForUserAgentWithModernCompatibility:) NSString *_applicationNameForUserAgentWithModernCompatibility;
73
74 @end