Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/accessible/generic/RootAccessible.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
#ifndef mozilla_a11y_RootAccessible_h__
7
#define mozilla_a11y_RootAccessible_h__
8
9
#include "HyperTextAccessible.h"
10
#include "DocAccessibleWrap.h"
11
12
#include "nsIDOMEventListener.h"
13
14
class nsIDocument;
15
16
namespace mozilla {
17
namespace a11y {
18
19
class RootAccessible : public DocAccessibleWrap,
20
                       public nsIDOMEventListener
21
{
22
  NS_DECL_ISUPPORTS_INHERITED
23
24
public:
25
  RootAccessible(nsIDocument* aDocument, nsIPresShell* aPresShell);
26
27
  // nsIDOMEventListener
28
  NS_DECL_NSIDOMEVENTLISTENER
29
30
  // Accessible
31
  virtual void Shutdown() override;
32
  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
33
  virtual Relation RelationByType(RelationType aType) const override;
34
  virtual mozilla::a11y::role NativeRole() const override;
35
  virtual uint64_t NativeState() const override;
36
37
  // RootAccessible
38
39
  /**
40
   * Notify that the sub document presshell was activated.
41
   */
42
  virtual void DocumentActivated(DocAccessible* aDocument);
43
44
  /**
45
   * Return the primary remote top level document if any.
46
   */
47
  ProxyAccessible* GetPrimaryRemoteTopLevelContentDoc() const;
48
49
protected:
50
  virtual ~RootAccessible();
51
52
  /**
53
   * Add/remove DOM event listeners.
54
   */
55
  virtual nsresult AddEventListeners() override;
56
  virtual nsresult RemoveEventListeners() override;
57
58
  /**
59
   * Process the DOM event.
60
   */
61
  void ProcessDOMEvent(dom::Event* aEvent);
62
63
  /**
64
   * Process "popupshown" event. Used by HandleEvent().
65
   */
66
  void HandlePopupShownEvent(Accessible* aAccessible);
67
68
  /*
69
   * Process "popuphiding" event. Used by HandleEvent().
70
   */
71
  void HandlePopupHidingEvent(nsINode* aNode);
72
73
#ifdef MOZ_XUL
74
  void HandleTreeRowCountChangedEvent(dom::Event* aEvent,
75
                                      XULTreeAccessible* aAccessible);
76
  void HandleTreeInvalidatedEvent(dom::Event* aEvent,
77
                                  XULTreeAccessible* aAccessible);
78
79
    uint32_t GetChromeFlags() const;
80
#endif
81
};
82
83
inline RootAccessible*
84
Accessible::AsRoot()
85
0
{
86
0
  return IsRoot() ? static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
87
0
}
88
89
} // namespace a11y
90
} // namespace mozilla
91
92
#endif