Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / events / Touch.h
blob9710962c4768c0c845979d1882f13379b498a534
1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_Touch_h_
7 #define mozilla_dom_Touch_h_
9 #include "mozilla/Attributes.h"
10 #include "mozilla/EventForwards.h"
11 #include "mozilla/MouseEvents.h"
12 #include "nsWrapperCache.h"
13 #include "nsAutoPtr.h"
14 #include "Units.h"
16 class nsPresContext;
18 namespace mozilla {
19 namespace dom {
21 class EventTarget;
23 class Touch MOZ_FINAL : public nsISupports
24 , public nsWrapperCache
25 , public WidgetPointerHelper
27 public:
28 static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal);
30 Touch(EventTarget* aTarget,
31 int32_t aIdentifier,
32 int32_t aPageX,
33 int32_t aPageY,
34 int32_t aScreenX,
35 int32_t aScreenY,
36 int32_t aClientX,
37 int32_t aClientY,
38 int32_t aRadiusX,
39 int32_t aRadiusY,
40 float aRotationAngle,
41 float aForce);
42 Touch(int32_t aIdentifier,
43 nsIntPoint aPoint,
44 nsIntPoint aRadius,
45 float aRotationAngle,
46 float aForce);
48 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
49 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
51 void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
53 void SetTarget(EventTarget* aTarget);
55 bool Equals(Touch* aTouch);
57 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
59 EventTarget* GetParentObject();
61 // WebIDL
62 int32_t Identifier() const { return mIdentifier; }
63 EventTarget* GetTarget() const;
64 int32_t ScreenX() const { return mScreenPoint.x; }
65 int32_t ScreenY() const { return mScreenPoint.y; }
66 int32_t ClientX() const { return mClientPoint.x; }
67 int32_t ClientY() const { return mClientPoint.y; }
68 int32_t PageX() const { return mPagePoint.x; }
69 int32_t PageY() const { return mPagePoint.y; }
70 int32_t RadiusX() const { return mRadius.x; }
71 int32_t RadiusY() const { return mRadius.y; }
72 float RotationAngle() const { return mRotationAngle; }
73 float Force() const { return mForce; }
75 nsCOMPtr<EventTarget> mTarget;
76 nsIntPoint mRefPoint;
77 bool mChanged;
78 uint32_t mMessage;
79 int32_t mIdentifier;
80 CSSIntPoint mPagePoint;
81 CSSIntPoint mClientPoint;
82 nsIntPoint mScreenPoint;
83 nsIntPoint mRadius;
84 float mRotationAngle;
85 float mForce;
86 protected:
87 ~Touch();
89 bool mPointsInitialized;
92 } // namespace dom
93 } // namespace mozilla
95 #endif // mozilla_dom_Touch_h_