dom/events/Touch.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/Touch.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,95 @@
     1.4 +/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef mozilla_dom_Touch_h_
    1.10 +#define mozilla_dom_Touch_h_
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "mozilla/EventForwards.h"
    1.14 +#include "mozilla/MouseEvents.h"
    1.15 +#include "nsWrapperCache.h"
    1.16 +#include "nsAutoPtr.h"
    1.17 +#include "Units.h"
    1.18 +
    1.19 +class nsPresContext;
    1.20 +
    1.21 +namespace mozilla {
    1.22 +namespace dom {
    1.23 +
    1.24 +class EventTarget;
    1.25 +
    1.26 +class Touch MOZ_FINAL : public nsISupports
    1.27 +                      , public nsWrapperCache
    1.28 +                      , public WidgetPointerHelper
    1.29 +{
    1.30 +public:
    1.31 +  static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal);
    1.32 +
    1.33 +  Touch(EventTarget* aTarget,
    1.34 +        int32_t aIdentifier,
    1.35 +        int32_t aPageX,
    1.36 +        int32_t aPageY,
    1.37 +        int32_t aScreenX,
    1.38 +        int32_t aScreenY,
    1.39 +        int32_t aClientX,
    1.40 +        int32_t aClientY,
    1.41 +        int32_t aRadiusX,
    1.42 +        int32_t aRadiusY,
    1.43 +        float aRotationAngle,
    1.44 +        float aForce);
    1.45 +  Touch(int32_t aIdentifier,
    1.46 +        nsIntPoint aPoint,
    1.47 +        nsIntPoint aRadius,
    1.48 +        float aRotationAngle,
    1.49 +        float aForce);
    1.50 +
    1.51 +  ~Touch();
    1.52 +
    1.53 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.54 +  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
    1.55 +
    1.56 +  void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
    1.57 +
    1.58 +  void SetTarget(EventTarget* aTarget);
    1.59 +
    1.60 +  bool Equals(Touch* aTouch);
    1.61 +
    1.62 +  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    1.63 +
    1.64 +  EventTarget* GetParentObject();
    1.65 +
    1.66 +  // WebIDL
    1.67 +  int32_t Identifier() const { return mIdentifier; }
    1.68 +  EventTarget* Target() const;
    1.69 +  int32_t ScreenX() const { return mScreenPoint.x; }
    1.70 +  int32_t ScreenY() const { return mScreenPoint.y; }
    1.71 +  int32_t ClientX() const { return mClientPoint.x; }
    1.72 +  int32_t ClientY() const { return mClientPoint.y; }
    1.73 +  int32_t PageX() const { return mPagePoint.x; }
    1.74 +  int32_t PageY() const { return mPagePoint.y; }
    1.75 +  int32_t RadiusX() const { return mRadius.x; }
    1.76 +  int32_t RadiusY() const { return mRadius.y; }
    1.77 +  float RotationAngle() const { return mRotationAngle; }
    1.78 +  float Force() const { return mForce; }
    1.79 +
    1.80 +  nsCOMPtr<EventTarget> mTarget;
    1.81 +  nsIntPoint mRefPoint;
    1.82 +  bool mChanged;
    1.83 +  uint32_t mMessage;
    1.84 +  int32_t mIdentifier;
    1.85 +  CSSIntPoint mPagePoint;
    1.86 +  CSSIntPoint mClientPoint;
    1.87 +  nsIntPoint mScreenPoint;
    1.88 +  nsIntPoint mRadius;
    1.89 +  float mRotationAngle;
    1.90 +  float mForce;
    1.91 +protected:
    1.92 +  bool mPointsInitialized;
    1.93 +};
    1.94 +
    1.95 +} // namespace dom
    1.96 +} // namespace mozilla
    1.97 +
    1.98 +#endif // mozilla_dom_Touch_h_

mercurial