1/*
2 * Copyright (C) 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/WKFoundation.h>
27
28#if WK_API_ENABLED
29
30#import <Foundation/Foundation.h>
31
32@class WKPreferences;
33@class WKProcessPool;
34@class WKUserContentController;
35
36#if TARGET_OS_IPHONE
37/*! @enum WKSelectionGranularity
38 @abstract The granularity with which a selection can be created and modified interactively.
39 @constant WKSelectionGranularityDynamic    Selection granularity varies automatically based on the selection.
40 @constant WKSelectionGranularityCharacter  Selection endpoints can be placed at any character boundary.
41 @discussion An example of how granularity may vary when WKSelectionGranularityDynamic is used is
42 that when the selection is within a single block, the granularity may be single character, and when
43 the selection is not confined to a single block, the selection granularity may be single block.
44 */
45typedef NS_ENUM(NSInteger, WKSelectionGranularity) {
46    WKSelectionGranularityDynamic,
47    WKSelectionGranularityCharacter,
48} WK_ENUM_AVAILABLE_IOS(8_0);
49#endif
50
51/*! A WKWebViewConfiguration object is a collection of properties with
52 which to initialize a web view.
53 @helps Contains properties used to configure a @link WKWebView @/link.
54 */
55WK_CLASS_AVAILABLE(10_10, 8_0)
56@interface WKWebViewConfiguration : NSObject <NSCopying>
57
58/*! @abstract The process pool from which to obtain the view's web content
59 process.
60 @discussion When a web view is initialized, a new web content process
61 will be created for it from the specified pool, or an existing process in
62 that pool will be used.
63*/
64@property (nonatomic, strong) WKProcessPool *processPool;
65
66/*! @abstract The preference settings to be used by the web view.
67*/
68@property (nonatomic, strong) WKPreferences *preferences;
69
70/*! @abstract The user content controller to associate with the web view.
71*/
72@property (nonatomic, strong) WKUserContentController *userContentController;
73
74/*! @abstract A Boolean value indicating whether the web view suppresses
75 content rendering until it is fully loaded into memory.
76 @discussion The default value is NO.
77 */
78@property (nonatomic) BOOL suppressesIncrementalRendering;
79
80#if TARGET_OS_IPHONE
81/*! @abstract A Boolean value indicating whether HTML5 videos play inline
82 (YES) or use the native full-screen controller (NO).
83 @discussion The default value is NO.
84 */
85@property (nonatomic) BOOL allowsInlineMediaPlayback;
86
87/*! @abstract A Boolean value indicating whether HTML5 videos require the
88 user to start playing them (YES) or can play automatically (NO).
89 @discussion The default value is YES.
90 */
91@property (nonatomic) BOOL mediaPlaybackRequiresUserAction;
92
93/*! @abstract A Boolean value indicating whether AirPlay is allowed.
94 @discussion The default value is YES.
95 */
96@property (nonatomic) BOOL mediaPlaybackAllowsAirPlay;
97
98/*! @abstract The level of granularity with which the user can interactively
99 select content in the web view.
100 @discussion Possible values are described in WKSelectionGranularity.
101 The default value is WKSelectionGranularityDynamic.
102 */
103@property (nonatomic) WKSelectionGranularity selectionGranularity;
104
105#endif
106
107@end
108
109#endif
110