SmartMagnificationController.h [plain text]
#pragma once
#if PLATFORM(IOS_FAMILY)
#include "MessageReceiver.h"
#include <WebCore/FloatRect.h>
#include <wtf/Noncopyable.h>
OBJC_CLASS WKContentView;
OBJC_CLASS UIScrollView;
namespace WebKit {
class WebPageProxy;
class SmartMagnificationController : private IPC::MessageReceiver {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(SmartMagnificationController);
public:
SmartMagnificationController(WKContentView *);
~SmartMagnificationController();
void handleSmartMagnificationGesture(WebCore::FloatPoint origin);
void handleResetMagnificationGesture(WebCore::FloatPoint origin);
double zoomFactorForTargetRect(WebCore::FloatRect targetRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale);
private:
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void didCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale);
void scrollToRect(WebCore::FloatPoint origin, WebCore::FloatRect targetRect);
std::tuple<WebCore::FloatRect, double, double> smartMagnificationTargetRectAndZoomScales(WebCore::FloatRect targetRect, double minimumScale, double maximumScale, bool addMagnificationPadding);
WebPageProxy& m_webPageProxy;
WKContentView *m_contentView;
};
}
#endif // PLATFORM(IOS_FAMILY)