_WKElementAction.h [plain text]
#import <WebKit/WKFoundation.h>
#if WK_API_ENABLED
#if TARGET_OS_IPHONE
#import <WebKit/_WKActivatedElementInfo.h>
typedef void (^WKElementActionHandler)(_WKActivatedElementInfo *);
typedef BOOL (^WKElementActionDismissalHandler)(void);
typedef NS_ENUM(NSInteger, _WKElementActionType) {
_WKElementActionTypeCustom,
_WKElementActionTypeOpen,
_WKElementActionTypeCopy,
_WKElementActionTypeSaveImage,
#if !defined(TARGET_OS_IOS) || TARGET_OS_IOS
_WKElementActionTypeAddToReadingList,
_WKElementActionTypeOpenInDefaultBrowser WK_API_AVAILABLE(ios(9_0)),
_WKElementActionTypeOpenInExternalApplication WK_API_AVAILABLE(ios(9_0)),
#endif
_WKElementActionTypeShare WK_API_AVAILABLE(ios(10.0)),
} WK_API_AVAILABLE(macosx(10.10), ios(8.0));
WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
@interface _WKElementAction : NSObject
+ (instancetype)elementActionWithType:(_WKElementActionType)type;
+ (instancetype)elementActionWithType:(_WKElementActionType)type customTitle:(NSString *)title;
+ (instancetype)elementActionWithTitle:(NSString *)title actionHandler:(WKElementActionHandler)handler;
- (void)runActionWithElementInfo:(_WKActivatedElementInfo *)info WK_API_AVAILABLE(ios(9_0));
@property (nonatomic, readonly) _WKElementActionType type;
@property (nonatomic, readonly) NSString* title;
@property (nonatomic, copy) WKElementActionDismissalHandler dismissalHandler;
@end
#endif // TARGET_OS_IPHONE
#endif // WK_API_ENABLED