DictionaryLookup.h [plain text]
#pragma once
#if PLATFORM(COCOA)
#include "DictionaryPopupInfo.h"
#if PLATFORM(MAC)
#import <pal/spi/mac/NSImmediateActionGestureRecognizerSPI.h>
#endif // PLATFORM(MAC)
#include <wtf/Function.h>
OBJC_CLASS NSView;
OBJC_CLASS PDFSelection;
#if PLATFORM(MAC)
typedef id <NSImmediateActionAnimationController> WKRevealController;
#else
typedef id WKRevealController;
#endif // PLATFORM(MAC)
namespace WebCore {
class HitTestResult;
class Range;
class VisibleSelection;
class DictionaryLookup {
public:
WEBCORE_EXPORT static std::tuple<RefPtr<Range>, NSDictionary *> rangeForSelection(const VisibleSelection&);
WEBCORE_EXPORT static std::tuple<RefPtr<Range>, NSDictionary *> rangeAtHitTestResult(const HitTestResult&);
WEBCORE_EXPORT static std::tuple<NSString *, NSDictionary *> stringForPDFSelection(PDFSelection *);
WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, NSView *, 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 // PLATFORM(MAC)