2012-07-19 23:48:25 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_layers_GeckoContentController_h
|
|
|
|
#define mozilla_layers_GeckoContentController_h
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "FrameMetrics.h" // for FrameMetrics, etc
|
|
|
|
#include "Units.h" // for CSSIntPoint, CSSRect, etc
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
2012-07-30 17:42:26 -07:00
|
|
|
#include "nsISupportsImpl.h"
|
2012-07-19 23:48:25 -07:00
|
|
|
|
2013-02-25 12:50:49 -08:00
|
|
|
class Task;
|
|
|
|
|
2012-07-19 23:48:25 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class GeckoContentController
|
|
|
|
{
|
2012-07-19 23:48:25 -07:00
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GeckoContentController)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Requests a paint of the given FrameMetrics |aFrameMetrics| from Gecko.
|
|
|
|
* Implementations per-platform are responsible for actually handling this.
|
|
|
|
*/
|
|
|
|
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) = 0;
|
2012-07-22 13:37:13 -07:00
|
|
|
|
2012-08-08 21:39:02 -07:00
|
|
|
/**
|
|
|
|
* Requests handling of a double tap. |aPoint| is in CSS pixels, relative to
|
|
|
|
* the current scroll offset. This should eventually round-trip back to
|
|
|
|
* AsyncPanZoomController::ZoomToRect with the dimensions that we want to zoom
|
|
|
|
* to.
|
|
|
|
*/
|
2013-11-25 20:30:26 -08:00
|
|
|
virtual void HandleDoubleTap(const CSSIntPoint& aPoint, int32_t aModifiers) = 0;
|
2012-08-08 21:39:02 -07:00
|
|
|
|
2012-09-14 18:16:32 -07:00
|
|
|
/**
|
|
|
|
* Requests handling a single tap. |aPoint| is in CSS pixels, relative to the
|
|
|
|
* current scroll offset. This should simulate and send to content a mouse
|
|
|
|
* button down, then mouse button up at |aPoint|.
|
|
|
|
*/
|
2013-11-25 20:30:26 -08:00
|
|
|
virtual void HandleSingleTap(const CSSIntPoint& aPoint, int32_t aModifiers) = 0;
|
2012-09-14 18:16:32 -07:00
|
|
|
|
2012-11-08 11:35:02 -08:00
|
|
|
/**
|
|
|
|
* Requests handling a long tap. |aPoint| is in CSS pixels, relative to the
|
|
|
|
* current scroll offset.
|
|
|
|
*/
|
2013-11-25 20:30:26 -08:00
|
|
|
virtual void HandleLongTap(const CSSIntPoint& aPoint, int32_t aModifiers) = 0;
|
2012-11-08 11:35:02 -08:00
|
|
|
|
2013-12-11 16:39:06 -08:00
|
|
|
/**
|
|
|
|
* Requests handling of releasing a long tap. |aPoint| is in CSS pixels,
|
|
|
|
* relative to the current scroll offset. HandleLongTapUp will always be
|
|
|
|
* preceeded by HandleLongTap
|
|
|
|
*/
|
|
|
|
virtual void HandleLongTapUp(const CSSIntPoint& aPoint, int32_t aModifiers) = 0;
|
|
|
|
|
2012-12-24 22:09:34 -08:00
|
|
|
/**
|
|
|
|
* Requests sending a mozbrowserasyncscroll domevent to embedder.
|
|
|
|
* |aContentRect| is in CSS pixels, relative to the current cssPage.
|
|
|
|
* |aScrollableSize| is the current content width/height in CSS pixels.
|
|
|
|
*/
|
2013-11-08 16:07:00 -08:00
|
|
|
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
|
2013-07-30 11:03:42 -07:00
|
|
|
const CSSRect &aContentRect,
|
2013-06-10 06:05:44 -07:00
|
|
|
const CSSSize &aScrollableSize) = 0;
|
2012-12-24 22:09:34 -08:00
|
|
|
|
2013-02-25 12:50:49 -08:00
|
|
|
/**
|
|
|
|
* Schedules a runnable to run on the controller/UI thread at some time
|
|
|
|
* in the future.
|
|
|
|
*/
|
|
|
|
virtual void PostDelayedTask(Task* aTask, int aDelayMs) = 0;
|
|
|
|
|
2013-09-13 07:18:33 -07:00
|
|
|
/**
|
2013-11-14 09:35:41 -08:00
|
|
|
* Retrieves the last known zoom constraints for the root scrollable layer
|
|
|
|
* for this layers tree. This function should return false if there are no
|
|
|
|
* last known zoom constraints.
|
2013-09-13 07:18:33 -07:00
|
|
|
*/
|
2013-11-14 09:35:41 -08:00
|
|
|
virtual bool GetRootZoomConstraints(bool* aOutAllowZoom,
|
|
|
|
CSSToScreenScale* aOutMinZoom,
|
|
|
|
CSSToScreenScale* aOutMaxZoom)
|
2013-09-13 07:18:33 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2013-07-25 10:15:06 -07:00
|
|
|
|
|
|
|
/**
|
2013-11-26 12:14:39 -08:00
|
|
|
* General tranformation notices for consumers. These fire any time
|
|
|
|
* the apzc is modifying the view, including panning, zooming, and
|
|
|
|
* fling.
|
2013-07-25 10:15:06 -07:00
|
|
|
*/
|
2013-12-09 19:14:55 -08:00
|
|
|
virtual void NotifyTransformBegin(const ScrollableLayerGuid& aGuid) {}
|
|
|
|
virtual void NotifyTransformEnd(const ScrollableLayerGuid& aGuid) {}
|
2013-07-25 10:15:06 -07:00
|
|
|
|
2012-07-24 12:12:11 -07:00
|
|
|
GeckoContentController() {}
|
|
|
|
virtual ~GeckoContentController() {}
|
2012-07-19 23:48:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // mozilla_layers_GeckoContentController_h
|