Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/XULCommandEvent.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
// This class implements a XUL "command" event.  See XULCommandEvent.webidl
8
9
#ifndef mozilla_dom_XULCommandEvent_h_
10
#define mozilla_dom_XULCommandEvent_h_
11
12
#include "mozilla/RefPtr.h"
13
#include "mozilla/dom/UIEvent.h"
14
#include "mozilla/dom/XULCommandEventBinding.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
class XULCommandEvent : public UIEvent
20
{
21
public:
22
  XULCommandEvent(EventTarget* aOwner,
23
                  nsPresContext* aPresContext,
24
                  WidgetInputEvent* aEvent);
25
26
  NS_DECL_ISUPPORTS_INHERITED
27
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULCommandEvent, UIEvent)
28
29
  virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
30
0
  {
31
0
    return XULCommandEvent_Binding::Wrap(aCx, this, aGivenProto);
32
0
  }
33
34
  virtual XULCommandEvent* AsXULCommandEvent() override
35
0
  {
36
0
    return this;
37
0
  }
38
39
  bool AltKey();
40
  bool CtrlKey();
41
  bool ShiftKey();
42
  bool MetaKey();
43
  uint16_t InputSource();
44
45
  already_AddRefed<Event> GetSourceEvent()
46
0
  {
47
0
    RefPtr<Event> e = mSourceEvent;
48
0
    return e.forget();
49
0
  }
50
51
  void InitCommandEvent(const nsAString& aType,
52
                        bool aCanBubble, bool aCancelable,
53
                        nsGlobalWindowInner* aView,
54
                        int32_t aDetail,
55
                        bool aCtrlKey, bool aAltKey,
56
                        bool aShiftKey, bool aMetaKey,
57
                        Event* aSourceEvent,
58
                        uint16_t aInputSource,
59
                        ErrorResult& aRv);
60
61
protected:
62
0
  ~XULCommandEvent() {}
63
64
  RefPtr<Event> mSourceEvent;
65
  uint16_t mInputSource;
66
};
67
68
} // namespace dom
69
} // namespace mozilla
70
71
already_AddRefed<mozilla::dom::XULCommandEvent>
72
NS_NewDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
73
                         nsPresContext* aPresContext,
74
                         mozilla::WidgetInputEvent* aEvent);
75
76
#endif // mozilla_dom_XULCommandEvent_h_