2012-05-23 13:21:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_a11y_logs_h__
|
|
|
|
#define mozilla_a11y_logs_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
2013-09-11 02:18:59 +04:00
|
|
|
#include "nsStringFwd.h"
|
2012-05-23 13:21:40 +04:00
|
|
|
|
|
|
|
class nsIDocument;
|
2012-06-01 08:27:25 +04:00
|
|
|
class nsINode;
|
2012-05-23 13:21:40 +04:00
|
|
|
class nsIRequest;
|
2012-06-02 05:58:44 +04:00
|
|
|
class nsISelection;
|
2013-09-11 02:18:59 +04:00
|
|
|
class nsISupports;
|
2012-05-23 13:21:40 +04:00
|
|
|
class nsIWebProgress;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
2012-06-01 08:26:28 +04:00
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
class AccEvent;
|
|
|
|
class Accessible;
|
|
|
|
class DocAccessible;
|
2012-06-01 08:26:28 +04:00
|
|
|
class OuterDocAccessible;
|
|
|
|
|
2012-05-23 13:21:40 +04:00
|
|
|
namespace logging {
|
|
|
|
|
|
|
|
enum EModules {
|
|
|
|
eDocLoad = 1 << 0,
|
|
|
|
eDocCreate = 1 << 1,
|
|
|
|
eDocDestroy = 1 << 2,
|
2012-05-29 21:15:35 +04:00
|
|
|
eDocLifeCycle = eDocLoad | eDocCreate | eDocDestroy,
|
2012-06-02 05:58:44 +04:00
|
|
|
|
|
|
|
eEvents = 1 << 3,
|
2016-04-07 16:30:22 +03:00
|
|
|
eEventTree = 1 << 4,
|
|
|
|
ePlatforms = 1 << 5,
|
|
|
|
eText = 1 << 6,
|
|
|
|
eTree = 1 << 7,
|
|
|
|
|
|
|
|
eDOMEvents = 1 << 8,
|
|
|
|
eFocus = 1 << 9,
|
|
|
|
eSelection = 1 << 10,
|
2016-03-01 21:07:20 +03:00
|
|
|
eNotifications = eDOMEvents | eSelection | eFocus,
|
|
|
|
|
|
|
|
// extras
|
2016-04-07 16:30:22 +03:00
|
|
|
eStack = 1 << 11,
|
|
|
|
eVerbose = 1 << 12
|
2012-05-23 13:21:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-01 08:27:25 +04:00
|
|
|
* Return true if any of the given modules is logged.
|
2012-05-23 13:21:40 +04:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
bool IsEnabled(uint32_t aModules);
|
2012-05-23 13:21:40 +04:00
|
|
|
|
2016-03-01 21:07:20 +03:00
|
|
|
/**
|
|
|
|
* Return true if all of the given modules are logged.
|
|
|
|
*/
|
|
|
|
bool IsEnabledAll(uint32_t aModules);
|
|
|
|
|
2012-11-04 06:19:56 +04:00
|
|
|
/**
|
|
|
|
* Return true if the given module is logged.
|
|
|
|
*/
|
|
|
|
bool IsEnabled(const nsAString& aModules);
|
|
|
|
|
2012-05-23 13:21:40 +04:00
|
|
|
/**
|
|
|
|
* Log the document loading progress.
|
|
|
|
*/
|
|
|
|
void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
|
2012-08-22 19:56:38 +04:00
|
|
|
nsIRequest* aRequest, uint32_t aStateFlags);
|
2012-05-23 13:21:40 +04:00
|
|
|
void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
|
2012-10-10 05:01:46 +04:00
|
|
|
void DocCompleteLoad(DocAccessible* aDocument, bool aIsLoadEventTarget);
|
2012-05-23 13:21:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Log that document load event was fired.
|
|
|
|
*/
|
|
|
|
void DocLoadEventFired(AccEvent* aEvent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log that document laod event was handled.
|
|
|
|
*/
|
|
|
|
void DocLoadEventHandled(AccEvent* aEvent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log the document was created.
|
|
|
|
*/
|
|
|
|
void DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
|
2012-07-30 18:20:58 +04:00
|
|
|
DocAccessible* aDocument = nullptr);
|
2012-05-23 13:21:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Log the document was destroyed.
|
|
|
|
*/
|
|
|
|
void DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
|
2012-07-30 18:20:58 +04:00
|
|
|
DocAccessible* aDocument = nullptr);
|
2012-05-23 13:21:40 +04:00
|
|
|
|
|
|
|
/**
|
2012-06-01 08:26:28 +04:00
|
|
|
* Log the outer document was destroyed.
|
|
|
|
*/
|
|
|
|
void OuterDocDestroy(OuterDocAccessible* OuterDoc);
|
|
|
|
|
2012-09-27 03:53:23 +04:00
|
|
|
/**
|
|
|
|
* Log the focus notification target.
|
|
|
|
*/
|
|
|
|
void FocusNotificationTarget(const char* aMsg, const char* aTargetDescr,
|
|
|
|
Accessible* aTarget);
|
|
|
|
void FocusNotificationTarget(const char* aMsg, const char* aTargetDescr,
|
|
|
|
nsINode* aTargetNode);
|
|
|
|
void FocusNotificationTarget(const char* aMsg, const char* aTargetDescr,
|
|
|
|
nsISupports* aTargetThing);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log a cause of active item descendant change (submessage).
|
|
|
|
*/
|
|
|
|
void ActiveItemChangeCausedBy(const char* aMsg, Accessible* aTarget);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log the active widget (submessage).
|
|
|
|
*/
|
|
|
|
void ActiveWidget(Accessible* aWidget);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log the focus event was dispatched (submessage).
|
|
|
|
*/
|
|
|
|
void FocusDispatched(Accessible* aTarget);
|
|
|
|
|
2012-06-02 05:58:44 +04:00
|
|
|
/**
|
|
|
|
* Log the selection change.
|
|
|
|
*/
|
2014-02-12 05:18:31 +04:00
|
|
|
void SelChange(nsISelection* aSelection, DocAccessible* aDocument,
|
|
|
|
int16_t aReason);
|
2012-06-02 05:58:44 +04:00
|
|
|
|
2016-03-01 21:07:20 +03:00
|
|
|
/**
|
|
|
|
* Log the given accessible elements info.
|
|
|
|
*/
|
|
|
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...);
|
|
|
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags,
|
|
|
|
const char* aMsg1, Accessible* aAcc,
|
|
|
|
const char* aMsg2, nsINode* aNode);
|
|
|
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent);
|
|
|
|
|
2012-06-01 08:26:28 +04:00
|
|
|
/**
|
|
|
|
* Log the message ('title: text' format) on new line. Print the start and end
|
|
|
|
* boundaries of the message body designated by '{' and '}' (2 spaces indent for
|
|
|
|
* body).
|
2012-05-23 13:21:40 +04:00
|
|
|
*/
|
2012-06-01 08:26:28 +04:00
|
|
|
void MsgBegin(const char* aTitle, const char* aMsgText, ...);
|
|
|
|
void MsgEnd();
|
2012-05-23 13:21:40 +04:00
|
|
|
|
2012-09-27 03:53:23 +04:00
|
|
|
/**
|
|
|
|
* Print start and end boundaries of the message body designated by '{' and '}'
|
|
|
|
* (2 spaces indent for body).
|
|
|
|
*/
|
|
|
|
void SubMsgBegin();
|
|
|
|
void SubMsgEnd();
|
|
|
|
|
2012-06-01 08:27:25 +04:00
|
|
|
/**
|
2012-06-02 05:58:44 +04:00
|
|
|
* Log the entry into message body (4 spaces indent).
|
2012-06-01 08:27:25 +04:00
|
|
|
*/
|
|
|
|
void MsgEntry(const char* aEntryText, ...);
|
|
|
|
|
2012-05-23 13:21:40 +04:00
|
|
|
/**
|
|
|
|
* Log the text, two spaces offset is used.
|
|
|
|
*/
|
|
|
|
void Text(const char* aText);
|
|
|
|
|
|
|
|
/**
|
2012-06-02 05:58:44 +04:00
|
|
|
* Log the accessible object address as message entry (4 spaces indent).
|
2012-05-23 13:21:40 +04:00
|
|
|
*/
|
2012-05-29 05:18:45 +04:00
|
|
|
void Address(const char* aDescr, Accessible* aAcc);
|
2012-05-23 13:21:40 +04:00
|
|
|
|
2012-06-01 08:27:25 +04:00
|
|
|
/**
|
2012-06-02 05:58:44 +04:00
|
|
|
* Log the DOM node info as message entry.
|
2012-06-01 08:27:25 +04:00
|
|
|
*/
|
|
|
|
void Node(const char* aDescr, nsINode* aNode);
|
|
|
|
|
2012-10-11 19:13:18 +04:00
|
|
|
/**
|
|
|
|
* Log the document accessible info as message entry.
|
|
|
|
*/
|
|
|
|
void Document(DocAccessible* aDocument);
|
|
|
|
|
2012-09-27 03:53:23 +04:00
|
|
|
/**
|
|
|
|
* Log the accessible and its DOM node as a message entry.
|
|
|
|
*/
|
2016-03-01 21:07:20 +03:00
|
|
|
void AccessibleInfo(const char* aDescr, Accessible* aAccessible);
|
2012-09-27 03:53:23 +04:00
|
|
|
void AccessibleNNode(const char* aDescr, Accessible* aAccessible);
|
2012-10-05 17:00:28 +04:00
|
|
|
void AccessibleNNode(const char* aDescr, nsINode* aNode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log the DOM event.
|
|
|
|
*/
|
|
|
|
void DOMEvent(const char* aDescr, nsINode* aOrigTarget,
|
|
|
|
const nsAString& aEventType);
|
2012-09-27 03:53:23 +04:00
|
|
|
|
2012-05-23 13:21:40 +04:00
|
|
|
/**
|
|
|
|
* Log the call stack, two spaces offset is used.
|
|
|
|
*/
|
|
|
|
void Stack();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable logging of the specified modules, all other modules aren't logged.
|
|
|
|
*/
|
|
|
|
void Enable(const nsAFlatCString& aModules);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable logging of modules specified by A11YLOG environment variable,
|
|
|
|
* all other modules aren't logged.
|
|
|
|
*/
|
|
|
|
void CheckEnv();
|
|
|
|
|
2016-03-01 21:07:20 +03:00
|
|
|
} // namespace logging
|
|
|
|
|
2012-05-23 13:21:40 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|