2013-06-05 05:02:51 -07:00
|
|
|
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
|
|
|
|
/* 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/. */
|
2014-02-27 02:51:13 -08:00
|
|
|
#ifndef mozilla_dom_FocusEvent_h_
|
|
|
|
#define mozilla_dom_FocusEvent_h_
|
2013-06-05 05:02:51 -07:00
|
|
|
|
|
|
|
#include "nsDOMUIEvent.h"
|
|
|
|
#include "nsIDOMFocusEvent.h"
|
2013-09-25 04:21:20 -07:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-06-05 05:02:51 -07:00
|
|
|
#include "mozilla/dom/FocusEventBinding.h"
|
|
|
|
|
2014-02-27 02:51:13 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class FocusEvent : public nsDOMUIEvent,
|
|
|
|
public nsIDOMFocusEvent
|
2013-06-05 05:02:51 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMFOCUSEVENT
|
|
|
|
|
|
|
|
// Forward to base class
|
|
|
|
NS_FORWARD_TO_NSDOMUIEVENT
|
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
|
|
|
|
{
|
2014-02-27 02:51:13 -08:00
|
|
|
return FocusEventBinding::Wrap(aCx, aScope, this);
|
2013-06-05 05:02:51 -07:00
|
|
|
}
|
|
|
|
|
2014-02-27 02:51:13 -08:00
|
|
|
FocusEvent(EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
InternalFocusEvent* aEvent);
|
2013-06-05 05:02:51 -07:00
|
|
|
|
2014-02-27 02:51:13 -08:00
|
|
|
EventTarget* GetRelatedTarget();
|
2013-06-05 05:02:51 -07:00
|
|
|
|
2014-02-27 02:51:13 -08:00
|
|
|
static already_AddRefed<FocusEvent> Constructor(const GlobalObject& aGlobal,
|
|
|
|
const nsAString& aType,
|
|
|
|
const FocusEventInit& aParam,
|
|
|
|
ErrorResult& aRv);
|
2013-06-05 05:02:51 -07:00
|
|
|
protected:
|
|
|
|
nsresult InitFocusEvent(const nsAString& aType,
|
|
|
|
bool aCanBubble,
|
|
|
|
bool aCancelable,
|
|
|
|
nsIDOMWindow* aView,
|
|
|
|
int32_t aDetail,
|
2014-02-27 02:51:13 -08:00
|
|
|
EventTarget* aRelatedTarget);
|
2013-06-05 05:02:51 -07:00
|
|
|
};
|
|
|
|
|
2014-02-27 02:51:13 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_FocusEvent_h_
|