gecko-dev/accessible/src/xul/nsXULAlertAccessible.cpp

63 lines
1.5 KiB
C++
Raw Normal View History

2005-03-15 15:44:02 +00:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 11:12:37 +00:00
/* 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/. */
2005-03-15 15:44:02 +00:00
#include "nsXULAlertAccessible.h"
2005-03-15 15:44:02 +00:00
#include "Role.h"
#include "States.h"
2005-03-15 15:44:02 +00:00
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULAlertAccessible
////////////////////////////////////////////////////////////////////////////////
2005-03-15 15:44:02 +00:00
nsXULAlertAccessible::
nsXULAlertAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
2005-03-15 15:44:02 +00:00
{
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULAlertAccessible, Accessible)
role
nsXULAlertAccessible::NativeRole()
2005-03-15 15:44:02 +00:00
{
return roles::ALERT;
2005-03-15 15:44:02 +00:00
}
PRUint64
nsXULAlertAccessible::NativeState()
2005-03-15 15:44:02 +00:00
{
return Accessible::NativeState() | states::ALERT;
2005-03-15 15:44:02 +00:00
}
ENameValueFlag
nsXULAlertAccessible::Name(nsString& aName)
{
// Screen readers need to read contents of alert, not the accessible name.
// If we have both some screen readers will read the alert twice.
aName.Truncate();
return eNameOK;
}
////////////////////////////////////////////////////////////////////////////////
// Widgets
bool
nsXULAlertAccessible::IsWidget() const
{
return true;
}
Accessible*
nsXULAlertAccessible::ContainerWidget() const
{
// If a part of colorpicker widget.
if (mParent && mParent->IsMenuButton())
return mParent;
return nsnull;
}