DictionaryLookup.h [plain text]
#pragma once
#if PLATFORM(COCOA)
#include "DictionaryPopupInfo.h"
#include <wtf/Function.h>
#if PLATFORM(MAC)
#import <pal/spi/mac/NSImmediateActionGestureRecognizerSPI.h>
#endif
@class NSView;
@class PDFSelection;
@class UIView;
#if PLATFORM(MAC)
using WKRevealController = id <NSImmediateActionAnimationController>;
using CocoaView = NSView;
#else
using WKRevealController = id;
using CocoaView = UIView;
#endif
namespace WebCore {
class HitTestResult;
class VisibleSelection;
struct SimpleRange;
class DictionaryLookup {
public:
WEBCORE_EXPORT static Optional<std::tuple<SimpleRange, NSDictionary *>> rangeForSelection(const VisibleSelection&);
WEBCORE_EXPORT static Optional<std::tuple<SimpleRange, NSDictionary *>> rangeAtHitTestResult(const HitTestResult&);
WEBCORE_EXPORT static std::tuple<NSString *, NSDictionary *> stringForPDFSelection(PDFSelection *);
WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, CocoaView *, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback = nullptr, WTF::Function<void()>&& clearTextIndicator = nullptr);
WEBCORE_EXPORT static void hidePopup();
#if PLATFORM(MAC)
WEBCORE_EXPORT static WKRevealController animationControllerForPopup(const DictionaryPopupInfo&, NSView *, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback = nullptr, WTF::Function<void()>&& clearTextIndicator = nullptr);
#endif // PLATFORM(MAC)
};
}
#endif