1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_logs_h__
8 #define mozilla_a11y_logs_h__
11 #include "nsAString.h"
25 class OuterDocAccessible
;
33 eDocLifeCycle
= eDocLoad
| eDocCreate
| eDocDestroy
,
44 eNotifications
= eDOMEvents
| eSelection
| eFocus
48 * Return true if any of the given modules is logged.
50 bool IsEnabled(uint32_t aModules
);
53 * Return true if the given module is logged.
55 bool IsEnabled(const nsAString
& aModules
);
58 * Log the document loading progress.
60 void DocLoad(const char* aMsg
, nsIWebProgress
* aWebProgress
,
61 nsIRequest
* aRequest
, uint32_t aStateFlags
);
62 void DocLoad(const char* aMsg
, nsIDocument
* aDocumentNode
);
63 void DocCompleteLoad(DocAccessible
* aDocument
, bool aIsLoadEventTarget
);
66 * Log that document load event was fired.
68 void DocLoadEventFired(AccEvent
* aEvent
);
71 * Log that document laod event was handled.
73 void DocLoadEventHandled(AccEvent
* aEvent
);
76 * Log the document was created.
78 void DocCreate(const char* aMsg
, nsIDocument
* aDocumentNode
,
79 DocAccessible
* aDocument
= nullptr);
82 * Log the document was destroyed.
84 void DocDestroy(const char* aMsg
, nsIDocument
* aDocumentNode
,
85 DocAccessible
* aDocument
= nullptr);
88 * Log the outer document was destroyed.
90 void OuterDocDestroy(OuterDocAccessible
* OuterDoc
);
93 * Log the focus notification target.
95 void FocusNotificationTarget(const char* aMsg
, const char* aTargetDescr
,
97 void FocusNotificationTarget(const char* aMsg
, const char* aTargetDescr
,
98 nsINode
* aTargetNode
);
99 void FocusNotificationTarget(const char* aMsg
, const char* aTargetDescr
,
100 nsISupports
* aTargetThing
);
103 * Log a cause of active item descendant change (submessage).
105 void ActiveItemChangeCausedBy(const char* aMsg
, Accessible
* aTarget
);
108 * Log the active widget (submessage).
110 void ActiveWidget(Accessible
* aWidget
);
113 * Log the focus event was dispatched (submessage).
115 void FocusDispatched(Accessible
* aTarget
);
118 * Log the selection change.
120 void SelChange(nsISelection
* aSelection
, DocAccessible
* aDocument
);
123 * Log the message ('title: text' format) on new line. Print the start and end
124 * boundaries of the message body designated by '{' and '}' (2 spaces indent for
127 void MsgBegin(const char* aTitle
, const char* aMsgText
, ...);
131 * Print start and end boundaries of the message body designated by '{' and '}'
132 * (2 spaces indent for body).
138 * Log the entry into message body (4 spaces indent).
140 void MsgEntry(const char* aEntryText
, ...);
143 * Log the text, two spaces offset is used.
145 void Text(const char* aText
);
148 * Log the accessible object address as message entry (4 spaces indent).
150 void Address(const char* aDescr
, Accessible
* aAcc
);
153 * Log the DOM node info as message entry.
155 void Node(const char* aDescr
, nsINode
* aNode
);
158 * Log the document accessible info as message entry.
160 void Document(DocAccessible
* aDocument
);
163 * Log the accessible and its DOM node as a message entry.
165 void AccessibleNNode(const char* aDescr
, Accessible
* aAccessible
);
166 void AccessibleNNode(const char* aDescr
, nsINode
* aNode
);
171 void DOMEvent(const char* aDescr
, nsINode
* aOrigTarget
,
172 const nsAString
& aEventType
);
175 * Log the call stack, two spaces offset is used.
180 * Enable logging of the specified modules, all other modules aren't logged.
182 void Enable(const nsAFlatCString
& aModules
);
185 * Enable logging of modules specified by A11YLOG environment variable,
186 * all other modules aren't logged.
192 } // namespace mozilla