dom/events/Touch.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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
    26 {
    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   ~Touch();
    50   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    51   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
    53   void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
    55   void SetTarget(EventTarget* aTarget);
    57   bool Equals(Touch* aTouch);
    59   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    61   EventTarget* GetParentObject();
    63   // WebIDL
    64   int32_t Identifier() const { return mIdentifier; }
    65   EventTarget* Target() const;
    66   int32_t ScreenX() const { return mScreenPoint.x; }
    67   int32_t ScreenY() const { return mScreenPoint.y; }
    68   int32_t ClientX() const { return mClientPoint.x; }
    69   int32_t ClientY() const { return mClientPoint.y; }
    70   int32_t PageX() const { return mPagePoint.x; }
    71   int32_t PageY() const { return mPagePoint.y; }
    72   int32_t RadiusX() const { return mRadius.x; }
    73   int32_t RadiusY() const { return mRadius.y; }
    74   float RotationAngle() const { return mRotationAngle; }
    75   float Force() const { return mForce; }
    77   nsCOMPtr<EventTarget> mTarget;
    78   nsIntPoint mRefPoint;
    79   bool mChanged;
    80   uint32_t mMessage;
    81   int32_t mIdentifier;
    82   CSSIntPoint mPagePoint;
    83   CSSIntPoint mClientPoint;
    84   nsIntPoint mScreenPoint;
    85   nsIntPoint mRadius;
    86   float mRotationAngle;
    87   float mForce;
    88 protected:
    89   bool mPointsInitialized;
    90 };
    92 } // namespace dom
    93 } // namespace mozilla
    95 #endif // mozilla_dom_Touch_h_

mercurial