[b9b36e]: content / events / src / nsDOMDeviceMotionEvent.h  Maximize  Restore  History

Download this file

106 lines (81 with data), 2.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
/* 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 nsDOMDeviceMotionEvent_h__
#define nsDOMDeviceMotionEvent_h__
#include "nsIDOMDeviceMotionEvent.h"
#include "nsDOMEvent.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/DeviceMotionEventBinding.h"
class nsDOMDeviceRotationRate MOZ_FINAL : public nsIDOMDeviceRotationRate
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMDEVICEROTATIONRATE
nsDOMDeviceRotationRate(double aAlpha, double aBeta, double aGamma);
private:
~nsDOMDeviceRotationRate();
protected:
double mAlpha, mBeta, mGamma;
};
class nsDOMDeviceAcceleration MOZ_FINAL : public nsIDOMDeviceAcceleration
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMDEVICEACCELERATION
nsDOMDeviceAcceleration(double aX, double aY, double aZ);
private:
~nsDOMDeviceAcceleration();
protected:
double mX, mY, mZ;
};
class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent,
public nsIDOMDeviceMotionEvent
{
public:
nsDOMDeviceMotionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
}
NS_DECL_ISUPPORTS_INHERITED
// Forward to nsDOMEvent
NS_FORWARD_TO_NSDOMEVENT
// nsIDOMDeviceMotionEvent Interface
NS_DECL_NSIDOMDEVICEMOTIONEVENT
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::DeviceMotionEventBinding::Wrap(aCx, aScope, this);
}
nsIDOMDeviceAcceleration* GetAcceleration()
{
return mAcceleration;
}
nsIDOMDeviceAcceleration* GetAccelerationIncludingGravity()
{
return mAccelerationIncludingGravity;
}
nsIDOMDeviceRotationRate* GetRotationRate()
{
return mRotationRate;
}
double Interval() const
{
return mInterval;
}
void InitDeviceMotionEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
nsIDOMDeviceAcceleration* aAcceleration,
nsIDOMDeviceAcceleration* aAccelerationIncludingGravity,
nsIDOMDeviceRotationRate* aRotationRate,
double aInterval,
mozilla::ErrorResult& aRv);
nsCOMPtr<nsIDOMDeviceAcceleration> mAcceleration;
nsCOMPtr<nsIDOMDeviceAcceleration> mAccelerationIncludingGravity;
nsCOMPtr<nsIDOMDeviceRotationRate> mRotationRate;
double mInterval;
};
#endif

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks