DataDetectorsSPI.h [plain text]
#ifndef DataDetectorsSPI_h
#define DataDetectorsSPI_h
#import <wtf/Platform.h>
#import <WebCore/DataDetectorsCoreSPI.h>
#import <WebCore/SoftLinking.h>
#if PLATFORM(MAC)
#if USE(APPLE_INTERNAL_SDK)
#import <DataDetectors/DDActionContext.h>
#import <DataDetectors/DDActionsManager.h>
#import <DataDetectors/DDHighlightDrawing.h>
#else // !USE(APPLE_INTERNAL_SDK)
@interface DDActionContext : NSObject <NSCopying, NSSecureCoding>
@property NSRect highlightFrame;
@property (retain) NSArray *allResults;
@property (retain) __attribute__((NSObject)) DDResultRef mainResult;
@property (assign) BOOL altMode;
@property (assign) BOOL immediate;
@property (copy) NSArray *allowedActionUTIs;
- (DDActionContext *)contextForView:(NSView *)view altMode:(BOOL)altMode interactionStartedHandler:(void (^)(void))interactionStartedHandler interactionChangedHandler:(void (^)(void))interactionChangedHandler interactionStoppedHandler:(void (^)(void))interactionStoppedHandler;
@end
@interface DDActionsManager : NSObject
+ (DDActionsManager *)sharedManager;
- (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
- (NSArray *)menuItemsForTargetURL:(NSString *)targetURL actionContext:(DDActionContext *)context;
- (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
+ (BOOL)shouldUseActionsWithContext:(DDActionContext *)context;
+ (void)didUseActions;
- (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
- (NSArray *)menuItemsForValue:(NSString *)value type:(CFStringRef)type service:(NSString *)service context:(DDActionContext *)context;
@end
enum {
DDHighlightStyleBubbleNone = 0,
DDHighlightStyleBubbleStandard = 1
};
enum {
DDHighlightStyleIconNone = (0 << 16),
DDHighlightStyleStandardIconArrow = (1 << 16)
};
enum {
DDHighlightStyleButtonShowAlways = (1 << 24),
};
#endif // !USE(APPLE_INTERNAL_SDK)
typedef struct __DDHighlight *DDHighlightRef;
typedef NSUInteger DDHighlightStyle;
@interface DDAction : NSObject
@property (readonly) NSString *actionUTI;
@end
SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
SOFT_LINK_CLASS_OPTIONAL(DataDetectors, DDAction)
SOFT_LINK_CLASS_OPTIONAL(DataDetectors, DDActionContext)
SOFT_LINK_CLASS_OPTIONAL(DataDetectors, DDActionsManager)
SOFT_LINK_CONSTANT(DataDetectors, DDBinderPhoneNumberKey, CFStringRef)
SOFT_LINK(DataDetectors, DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection, DDHighlightRef, (CFAllocatorRef allocator, CGRect* rects, CFIndex count, CGRect globalVisibleRect, DDHighlightStyle style, Boolean withArrow, NSWritingDirection writingDirection, Boolean endsWithEOL, Boolean flipped), (allocator, rects, count, globalVisibleRect, style, withArrow, writingDirection, endsWithEOL, flipped))
SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
SOFT_LINK(DataDetectors, DDHighlightPointIsOnHighlight, Boolean, (DDHighlightRef highlight, CGPoint point, Boolean* onButton), (highlight, point, onButton))
#endif
#endif // DataDetectorsSPI_h