michael@0: /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_Touch_h_ michael@0: #define mozilla_dom_Touch_h_ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "mozilla/EventForwards.h" michael@0: #include "mozilla/MouseEvents.h" michael@0: #include "nsWrapperCache.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "Units.h" michael@0: michael@0: class nsPresContext; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class EventTarget; michael@0: michael@0: class Touch MOZ_FINAL : public nsISupports michael@0: , public nsWrapperCache michael@0: , public WidgetPointerHelper michael@0: { michael@0: public: michael@0: static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal); michael@0: michael@0: Touch(EventTarget* aTarget, michael@0: int32_t aIdentifier, michael@0: int32_t aPageX, michael@0: int32_t aPageY, michael@0: int32_t aScreenX, michael@0: int32_t aScreenY, michael@0: int32_t aClientX, michael@0: int32_t aClientY, michael@0: int32_t aRadiusX, michael@0: int32_t aRadiusY, michael@0: float aRotationAngle, michael@0: float aForce); michael@0: Touch(int32_t aIdentifier, michael@0: nsIntPoint aPoint, michael@0: nsIntPoint aRadius, michael@0: float aRotationAngle, michael@0: float aForce); michael@0: michael@0: ~Touch(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch) michael@0: michael@0: void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent); michael@0: michael@0: void SetTarget(EventTarget* aTarget); michael@0: michael@0: bool Equals(Touch* aTouch); michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; michael@0: michael@0: EventTarget* GetParentObject(); michael@0: michael@0: // WebIDL michael@0: int32_t Identifier() const { return mIdentifier; } michael@0: EventTarget* Target() const; michael@0: int32_t ScreenX() const { return mScreenPoint.x; } michael@0: int32_t ScreenY() const { return mScreenPoint.y; } michael@0: int32_t ClientX() const { return mClientPoint.x; } michael@0: int32_t ClientY() const { return mClientPoint.y; } michael@0: int32_t PageX() const { return mPagePoint.x; } michael@0: int32_t PageY() const { return mPagePoint.y; } michael@0: int32_t RadiusX() const { return mRadius.x; } michael@0: int32_t RadiusY() const { return mRadius.y; } michael@0: float RotationAngle() const { return mRotationAngle; } michael@0: float Force() const { return mForce; } michael@0: michael@0: nsCOMPtr mTarget; michael@0: nsIntPoint mRefPoint; michael@0: bool mChanged; michael@0: uint32_t mMessage; michael@0: int32_t mIdentifier; michael@0: CSSIntPoint mPagePoint; michael@0: CSSIntPoint mClientPoint; michael@0: nsIntPoint mScreenPoint; michael@0: nsIntPoint mRadius; michael@0: float mRotationAngle; michael@0: float mForce; michael@0: protected: michael@0: bool mPointsInitialized; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_Touch_h_