DictionaryLookup.h [plain text]
#ifndef DictionaryLookup_h
#define DictionaryLookup_h
#if PLATFORM(MAC)
#include "DictionaryPopupInfo.h"
#include <functional>
#include <wtf/PassRefPtr.h>
OBJC_CLASS NSString;
OBJC_CLASS NSView;
OBJC_CLASS PDFSelection;
#if defined(__OBJC__)
#include "NSImmediateActionGestureRecognizerSPI.h"
#define PlatformAnimationController id<NSImmediateActionAnimationController>
#else
#define PlatformAnimationController void*
#endif
namespace WebCore {
class HitTestResult;
class Range;
class VisibleSelection;
class DictionaryLookup {
public:
WEBCORE_EXPORT static RefPtr<Range> rangeForSelection(const VisibleSelection&, NSDictionary **options);
WEBCORE_EXPORT static RefPtr<Range> rangeAtHitTestResult(const HitTestResult&, NSDictionary **options);
WEBCORE_EXPORT static NSString *stringForPDFSelection(PDFSelection *, NSDictionary **options);
WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, NSView *, std::function<void(TextIndicator&)> textIndicatorInstallationCallback, std::function<FloatRect(FloatRect)> rootViewToViewConversionCallback = nullptr);
WEBCORE_EXPORT static void hidePopup();
WEBCORE_EXPORT static PlatformAnimationController animationControllerForPopup(const DictionaryPopupInfo&, NSView *, std::function<void(TextIndicator&)> textIndicatorInstallationCallback, std::function<FloatRect(FloatRect)> rootViewToViewConversionCallback = nullptr);
};
}
#endif // PLATFORM(MAC)
#endif // DictionaryLookup_h