2009-12-23 11:10:31 -08:00
|
|
|
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2009-12-23 11:10:31 -08:00
|
|
|
#ifndef nsDOMTransitionEvent_h_
|
|
|
|
#define nsDOMTransitionEvent_h_
|
|
|
|
|
|
|
|
#include "nsDOMEvent.h"
|
|
|
|
#include "nsIDOMTransitionEvent.h"
|
|
|
|
#include "nsString.h"
|
2013-03-14 14:16:13 -07:00
|
|
|
#include "mozilla/dom/TransitionEventBinding.h"
|
2009-12-23 11:10:31 -08:00
|
|
|
|
|
|
|
class nsTransitionEvent;
|
|
|
|
|
|
|
|
class nsDOMTransitionEvent : public nsDOMEvent,
|
|
|
|
public nsIDOMTransitionEvent
|
|
|
|
{
|
|
|
|
public:
|
2013-03-09 03:34:29 -08:00
|
|
|
nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
|
|
|
|
nsPresContext *aPresContext,
|
2009-12-23 11:10:31 -08:00
|
|
|
nsTransitionEvent *aEvent);
|
|
|
|
~nsDOMTransitionEvent();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_FORWARD_TO_NSDOMEVENT
|
|
|
|
NS_DECL_NSIDOMTRANSITIONEVENT
|
|
|
|
|
2013-04-25 09:29:54 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
|
2013-03-14 14:16:13 -07:00
|
|
|
{
|
|
|
|
return mozilla::dom::TransitionEventBinding::Wrap(aCx, aScope, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// xpidl implementation
|
|
|
|
// GetPropertyName(nsAString& aPropertyName)
|
|
|
|
|
|
|
|
float ElapsedTime()
|
|
|
|
{
|
|
|
|
return TransitionEvent()->elapsedTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitTransitionEvent(const nsAString& aType,
|
|
|
|
bool aCanBubble,
|
|
|
|
bool aCancelable,
|
|
|
|
const nsAString& aPropertyName,
|
|
|
|
float aElapsedTime,
|
|
|
|
mozilla::ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = InitTransitionEvent(aType, aCanBubble, aCancelable, aPropertyName,
|
|
|
|
aElapsedTime);
|
|
|
|
}
|
2009-12-23 11:10:31 -08:00
|
|
|
private:
|
|
|
|
nsTransitionEvent* TransitionEvent() {
|
|
|
|
NS_ABORT_IF_FALSE(mEvent->eventStructType == NS_TRANSITION_EVENT,
|
|
|
|
"unexpected struct type");
|
|
|
|
return static_cast<nsTransitionEvent*>(mEvent);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !defined(nsDOMTransitionEvent_h_) */
|