2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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/. */
|
2010-07-31 11:02:52 +04:00
|
|
|
|
2019-01-25 11:16:09 +03:00
|
|
|
#ifndef mozilla_dom_TimeEvent_h
|
|
|
|
#define mozilla_dom_TimeEvent_h
|
2010-07-31 11:02:52 +04:00
|
|
|
|
2019-01-02 16:29:18 +03:00
|
|
|
#include "nsDocShell.h"
|
2014-03-05 04:37:43 +04:00
|
|
|
#include "mozilla/dom/Event.h"
|
2013-05-25 02:55:19 +04:00
|
|
|
#include "mozilla/dom/TimeEventBinding.h"
|
2019-01-02 16:26:56 +03:00
|
|
|
#include "mozilla/dom/Nullable.h"
|
|
|
|
#include "mozilla/dom/WindowProxyHolder.h"
|
2010-07-31 11:02:52 +04:00
|
|
|
|
2017-11-07 01:52:14 +03:00
|
|
|
class nsGlobalWindowInner;
|
2016-01-30 20:05:36 +03:00
|
|
|
|
2014-02-28 18:58:43 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-02-05 05:31:43 +03:00
|
|
|
class TimeEvent final : public Event {
|
2010-07-31 11:02:52 +04:00
|
|
|
public:
|
2014-02-28 18:58:43 +04:00
|
|
|
TimeEvent(EventTarget* aOwner, nsPresContext* aPresContext,
|
2014-07-30 21:16:57 +04:00
|
|
|
InternalSMILTimeEvent* aEvent);
|
2013-05-25 02:55:19 +04:00
|
|
|
|
2010-07-31 11:02:52 +04:00
|
|
|
// nsISupports interface:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-03-05 04:37:43 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, Event)
|
2010-07-31 11:02:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObjectInternal(
|
|
|
|
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
2018-06-26 00:20:54 +03:00
|
|
|
return TimeEvent_Binding::Wrap(aCx, this, aGivenProto);
|
2013-05-25 02:55:19 +04:00
|
|
|
}
|
|
|
|
|
2017-11-07 01:52:14 +03:00
|
|
|
void InitTimeEvent(const nsAString& aType, nsGlobalWindowInner* aView,
|
2016-01-30 20:05:36 +03:00
|
|
|
int32_t aDetail);
|
|
|
|
|
2013-05-25 02:55:19 +04:00
|
|
|
int32_t Detail() const { return mDetail; }
|
2016-01-30 20:05:36 +03:00
|
|
|
|
2019-01-02 16:26:56 +03:00
|
|
|
Nullable<WindowProxyHolder> GetView() const {
|
|
|
|
if (!mView) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2019-01-02 16:27:05 +03:00
|
|
|
return WindowProxyHolder(mView->GetBrowsingContext());
|
2019-01-02 16:26:56 +03:00
|
|
|
}
|
2013-05-25 02:55:19 +04:00
|
|
|
|
2018-02-05 05:31:43 +03:00
|
|
|
TimeEvent* AsTimeEvent() final { return this; }
|
|
|
|
|
2010-07-31 11:02:52 +04:00
|
|
|
private:
|
2014-07-09 01:23:17 +04:00
|
|
|
~TimeEvent() {}
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindowOuter> mView;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mDetail;
|
2010-07-31 11:02:52 +04:00
|
|
|
};
|
|
|
|
|
2014-02-28 18:58:43 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-08-12 14:39:31 +03:00
|
|
|
already_AddRefed<mozilla::dom::TimeEvent> NS_NewDOMTimeEvent(
|
|
|
|
mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
|
|
|
|
mozilla::InternalSMILTimeEvent* aEvent);
|
|
|
|
|
2019-01-25 11:16:09 +03:00
|
|
|
#endif // mozilla_dom_TimeEvent_h
|