_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_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA),
_WKElementActionTypeOpenInExternalApplication WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA),
#endif
} WK_ENUM_AVAILABLE(10_10, 8_0);
WK_CLASS_AVAILABLE(10_10, 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_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
@property (nonatomic, readonly) _WKElementActionType type;
@property (nonatomic, readonly) NSString* title;
@property (nonatomic, copy) WKElementActionDismissalHandler dismissalHandler;
@end
#endif // TARGET_OS_IPHONE
#endif // WK_API_ENABLED