2007-06-01 20:01:38 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=4:tabstop=4:
|
|
|
|
*/
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2007
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Bolian Yin <bolian.yin@sun.com>
|
|
|
|
* Ginn Chen <ginn.chen@sun.com>
|
|
|
|
* Alexander Surkov <surkov.alexander@gmail.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsApplicationAccessible.h"
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
#include "States.h"
|
2009-12-10 11:12:19 -08:00
|
|
|
#include "nsAccessibilityService.h"
|
2010-04-26 23:52:03 -07:00
|
|
|
#include "nsAccUtils.h"
|
2009-12-10 11:12:19 -08:00
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
#include "nsIComponentManager.h"
|
2010-04-22 20:46:37 -07:00
|
|
|
#include "nsIDOMDocument.h"
|
|
|
|
#include "nsIDOMWindow.h"
|
|
|
|
#include "nsIWindowMediator.h"
|
2007-06-01 20:01:38 -07:00
|
|
|
#include "nsServiceManagerUtils.h"
|
2010-05-14 02:24:41 -07:00
|
|
|
#include "mozilla/Services.h"
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
nsApplicationAccessible::nsApplicationAccessible() :
|
|
|
|
nsAccessibleWrap(nsnull, nsnull)
|
2007-06-01 20:01:38 -07:00
|
|
|
{
|
2011-02-22 05:54:46 -08:00
|
|
|
mFlags |= eApplicationAccessible;
|
2007-06-01 20:01:38 -07:00
|
|
|
}
|
|
|
|
|
2008-08-06 05:19:56 -07:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2007-06-01 20:01:38 -07:00
|
|
|
// nsISupports
|
|
|
|
|
2010-03-18 11:49:39 -07:00
|
|
|
NS_IMPL_ISUPPORTS_INHERITED1(nsApplicationAccessible, nsAccessible,
|
|
|
|
nsIAccessibleApplication)
|
2008-08-06 05:19:56 -07:00
|
|
|
|
2010-04-22 20:45:16 -07:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2010-06-11 01:23:18 -07:00
|
|
|
// nsIAccessible
|
2010-04-22 20:45:16 -07:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2010-06-11 01:23:18 -07:00
|
|
|
nsApplicationAccessible::GetParent(nsIAccessible **aAccessible)
|
2010-04-22 20:45:16 -07:00
|
|
|
{
|
2010-06-11 01:23:18 -07:00
|
|
|
NS_ENSURE_ARG_POINTER(aAccessible);
|
|
|
|
*aAccessible = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2010-04-22 20:45:16 -07:00
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetNextSibling(nsIAccessible **aNextSibling)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aNextSibling);
|
|
|
|
*aNextSibling = nsnull;
|
2010-04-22 20:45:16 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetPreviousSibling(nsIAccessible **aPreviousSibling)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aPreviousSibling);
|
|
|
|
*aPreviousSibling = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-06-01 20:01:38 -07:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetName(nsAString& aName)
|
|
|
|
{
|
2008-08-24 09:45:56 -07:00
|
|
|
aName.Truncate();
|
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
nsCOMPtr<nsIStringBundleService> bundleService =
|
2010-05-14 02:24:41 -07:00
|
|
|
mozilla::services::GetStringBundleService();
|
2007-06-01 20:01:38 -07:00
|
|
|
|
|
|
|
NS_ASSERTION(bundleService, "String bundle service must be present!");
|
|
|
|
NS_ENSURE_STATE(bundleService);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIStringBundle> bundle;
|
2008-10-08 05:58:46 -07:00
|
|
|
nsresult rv = bundleService->CreateBundle("chrome://branding/locale/brand.properties",
|
|
|
|
getter_AddRefs(bundle));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2007-06-01 20:01:38 -07:00
|
|
|
|
|
|
|
nsXPIDLString appName;
|
2008-10-08 05:58:46 -07:00
|
|
|
rv = bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
|
|
|
getter_Copies(appName));
|
|
|
|
if (NS_FAILED(rv) || appName.IsEmpty()) {
|
|
|
|
NS_WARNING("brandShortName not found, using default app name");
|
|
|
|
appName.AssignLiteral("Gecko based application");
|
2007-06-01 20:01:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
aName.Assign(appName);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
NS_IMETHODIMP
|
2010-06-11 01:23:18 -07:00
|
|
|
nsApplicationAccessible::GetValue(nsAString &aValue)
|
2007-06-01 20:01:38 -07:00
|
|
|
{
|
2009-12-10 11:12:19 -08:00
|
|
|
aValue.Truncate();
|
2007-06-01 20:01:38 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-04-23 06:14:05 -07:00
|
|
|
void
|
|
|
|
nsApplicationAccessible::Description(nsString &aDescription)
|
2010-06-11 01:23:18 -07:00
|
|
|
{
|
|
|
|
aDescription.Truncate();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetKeyboardShortcut(nsAString &aKeyboardShortcut)
|
|
|
|
{
|
|
|
|
aKeyboardShortcut.Truncate();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
PRUint64
|
|
|
|
nsApplicationAccessible::State()
|
2007-06-01 20:01:38 -07:00
|
|
|
{
|
2011-04-11 23:18:42 -07:00
|
|
|
return IsDefunct() ? states::DEFUNCT : 0;
|
2010-06-11 01:23:18 -07:00
|
|
|
}
|
2009-12-10 11:12:19 -08:00
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aAttributes);
|
|
|
|
*aAttributes = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2010-06-11 01:23:18 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GroupPosition(PRInt32 *aGroupLevel,
|
|
|
|
PRInt32 *aSimilarItemsInGroup,
|
|
|
|
PRInt32 *aPositionInGroup)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aGroupLevel);
|
|
|
|
*aGroupLevel = 0;
|
|
|
|
NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
|
|
|
|
*aSimilarItemsInGroup = 0;
|
|
|
|
NS_ENSURE_ARG_POINTER(aPositionInGroup);
|
|
|
|
*aPositionInGroup = 0;
|
2007-06-01 20:01:38 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-03-28 21:44:20 -07:00
|
|
|
nsAccessible*
|
2010-06-11 01:23:18 -07:00
|
|
|
nsApplicationAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
|
2011-03-28 21:44:20 -07:00
|
|
|
EWhichChildAtPoint aWhichChild)
|
2010-06-11 01:23:18 -07:00
|
|
|
{
|
2011-03-28 21:44:20 -07:00
|
|
|
return nsnull;
|
2010-06-11 01:23:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetRelationByType(PRUint32 aRelationType,
|
|
|
|
nsIAccessibleRelation **aRelation)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aRelation);
|
|
|
|
*aRelation = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetRelationsCount(PRUint32 *aCount)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aCount);
|
|
|
|
*aCount = 0;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetRelation(PRUint32 aIndex,
|
|
|
|
nsIAccessibleRelation **aRelation)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aRelation);
|
|
|
|
*aRelation = nsnull;
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetRelations(nsIArray **aRelations)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aRelations);
|
|
|
|
*aRelations = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
|
|
|
|
PRInt32 *aWidth, PRInt32 *aHeight)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aX);
|
|
|
|
*aX = 0;
|
|
|
|
NS_ENSURE_ARG_POINTER(aY);
|
|
|
|
*aY = 0;
|
|
|
|
NS_ENSURE_ARG_POINTER(aWidth);
|
|
|
|
*aWidth = 0;
|
|
|
|
NS_ENSURE_ARG_POINTER(aHeight);
|
|
|
|
*aHeight = 0;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::SetSelected(PRBool aIsSelected)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::TakeSelection()
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::TakeFocus()
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetNumActions(PRUint8 *aNumActions)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aNumActions);
|
|
|
|
*aNumActions = 0;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetActionName(PRUint8 aIndex, nsAString &aName)
|
|
|
|
{
|
|
|
|
aName.Truncate();
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetActionDescription(PRUint8 aIndex,
|
|
|
|
nsAString &aDescription)
|
|
|
|
{
|
|
|
|
aDescription.Truncate();
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::DoAction(PRUint8 aIndex)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
2009-12-10 11:12:19 -08:00
|
|
|
}
|
2009-11-19 08:35:38 -08:00
|
|
|
|
2010-03-18 11:49:39 -07:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsIAccessibleApplication
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetAppName(nsAString& aName)
|
|
|
|
{
|
|
|
|
aName.Truncate();
|
|
|
|
|
|
|
|
if (!mAppInfo)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
nsCAutoString cname;
|
|
|
|
nsresult rv = mAppInfo->GetName(cname);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
AppendUTF8toUTF16(cname, aName);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetAppVersion(nsAString& aVersion)
|
|
|
|
{
|
|
|
|
aVersion.Truncate();
|
|
|
|
|
|
|
|
if (!mAppInfo)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
nsCAutoString cversion;
|
|
|
|
nsresult rv = mAppInfo->GetVersion(cversion);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
AppendUTF8toUTF16(cversion, aVersion);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetPlatformName(nsAString& aName)
|
|
|
|
{
|
|
|
|
aName.AssignLiteral("Gecko");
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetPlatformVersion(nsAString& aVersion)
|
|
|
|
{
|
|
|
|
aVersion.Truncate();
|
|
|
|
|
|
|
|
if (!mAppInfo)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
nsCAutoString cversion;
|
|
|
|
nsresult rv = mAppInfo->GetPlatformVersion(cversion);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
AppendUTF8toUTF16(cversion, aVersion);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsAccessNode public methods
|
2009-11-19 08:35:38 -08:00
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
PRBool
|
|
|
|
nsApplicationAccessible::IsDefunct()
|
|
|
|
{
|
2010-06-08 09:39:58 -07:00
|
|
|
return nsAccessibilityService::IsShutdown();
|
2009-12-10 11:12:19 -08:00
|
|
|
}
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2010-06-11 21:04:35 -07:00
|
|
|
PRBool
|
2009-12-10 11:12:19 -08:00
|
|
|
nsApplicationAccessible::Init()
|
|
|
|
{
|
2010-03-18 11:49:39 -07:00
|
|
|
mAppInfo = do_GetService("@mozilla.org/xre/app-info;1");
|
2010-06-11 21:04:35 -07:00
|
|
|
return PR_TRUE;
|
2010-03-18 11:49:39 -07:00
|
|
|
}
|
|
|
|
|
2010-06-11 21:04:35 -07:00
|
|
|
void
|
2010-03-18 11:49:39 -07:00
|
|
|
nsApplicationAccessible::Shutdown()
|
|
|
|
{
|
|
|
|
mAppInfo = nsnull;
|
2007-06-01 20:01:38 -07:00
|
|
|
}
|
|
|
|
|
2010-10-20 21:16:10 -07:00
|
|
|
bool
|
|
|
|
nsApplicationAccessible::IsPrimaryForNode() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsAccessible public methods
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
void
|
|
|
|
nsApplicationAccessible::ApplyARIAState(PRUint64* aState)
|
2010-06-11 01:23:18 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-09-04 19:14:01 -07:00
|
|
|
PRUint32
|
|
|
|
nsApplicationAccessible::NativeRole()
|
2009-12-10 11:12:19 -08:00
|
|
|
{
|
2010-09-04 19:14:01 -07:00
|
|
|
return nsIAccessibleRole::ROLE_APP_ROOT;
|
2007-06-01 20:01:38 -07:00
|
|
|
}
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
PRUint64
|
|
|
|
nsApplicationAccessible::NativeState()
|
2008-03-29 20:24:02 -07:00
|
|
|
{
|
2011-04-11 23:18:42 -07:00
|
|
|
return 0;
|
2009-11-19 06:44:59 -08:00
|
|
|
}
|
2008-03-29 20:24:02 -07:00
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
void
|
|
|
|
nsApplicationAccessible::InvalidateChildren()
|
|
|
|
{
|
2010-06-25 02:50:23 -07:00
|
|
|
// Do nothing because application children are kept updated by AppendChild()
|
|
|
|
// and RemoveChild() method calls.
|
2009-11-19 08:35:38 -08:00
|
|
|
}
|
2009-11-19 06:44:59 -08:00
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsAccessible protected methods
|
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
void
|
|
|
|
nsApplicationAccessible::CacheChildren()
|
|
|
|
{
|
2010-04-22 20:46:37 -07:00
|
|
|
// CacheChildren is called only once for application accessible when its
|
|
|
|
// children are requested because empty InvalidateChldren() prevents its
|
|
|
|
// repeated calls.
|
|
|
|
|
2010-06-25 02:50:23 -07:00
|
|
|
// Basically children are kept updated by Append/RemoveChild method calls.
|
|
|
|
// However if there are open windows before accessibility was started
|
2010-04-22 20:46:37 -07:00
|
|
|
// then we need to make sure root accessibles for open windows are created so
|
2010-04-23 18:51:10 -07:00
|
|
|
// that all root accessibles are stored in application accessible children
|
2010-04-22 20:46:37 -07:00
|
|
|
// array.
|
|
|
|
|
|
|
|
nsCOMPtr<nsIWindowMediator> windowMediator =
|
|
|
|
do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
|
|
|
|
|
|
|
|
nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
|
|
|
|
nsresult rv = windowMediator->GetEnumerator(nsnull,
|
|
|
|
getter_AddRefs(windowEnumerator));
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return;
|
|
|
|
|
|
|
|
PRBool hasMore = PR_FALSE;
|
|
|
|
windowEnumerator->HasMoreElements(&hasMore);
|
|
|
|
while (hasMore) {
|
|
|
|
nsCOMPtr<nsISupports> window;
|
|
|
|
windowEnumerator->GetNext(getter_AddRefs(window));
|
|
|
|
nsCOMPtr<nsIDOMWindow> DOMWindow = do_QueryInterface(window);
|
|
|
|
if (DOMWindow) {
|
|
|
|
nsCOMPtr<nsIDOMDocument> DOMDocument;
|
|
|
|
DOMWindow->GetDocument(getter_AddRefs(DOMDocument));
|
|
|
|
if (DOMDocument) {
|
2010-06-28 06:22:49 -07:00
|
|
|
nsCOMPtr<nsIDocument> docNode(do_QueryInterface(DOMDocument));
|
|
|
|
GetAccService()->GetDocAccessible(docNode); // ensure creation
|
2010-04-22 20:46:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
windowEnumerator->HasMoreElements(&hasMore);
|
|
|
|
}
|
2009-12-10 11:12:19 -08:00
|
|
|
}
|
|
|
|
|
2010-03-10 02:26:11 -08:00
|
|
|
nsAccessible*
|
2009-12-10 11:12:19 -08:00
|
|
|
nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
|
|
|
|
{
|
|
|
|
if (IsDefunct()) {
|
|
|
|
if (aError)
|
|
|
|
*aError = NS_ERROR_FAILURE;
|
2009-11-19 06:44:59 -08:00
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
return nsnull;
|
2009-11-19 08:35:38 -08:00
|
|
|
}
|
2009-12-10 11:12:19 -08:00
|
|
|
|
|
|
|
if (aError)
|
|
|
|
*aError = NS_OK; // fail peacefully
|
|
|
|
|
|
|
|
return nsnull;
|
2007-06-01 20:01:38 -07:00
|
|
|
}
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2010-10-20 21:16:10 -07:00
|
|
|
// nsIAccessNode and nsAccessNode
|
2010-06-11 01:23:18 -07:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetDOMNode(nsIDOMNode **aDOMNode)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aDOMNode);
|
|
|
|
*aDOMNode = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetDocument(nsIAccessibleDocument **aDocument)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aDocument);
|
|
|
|
*aDocument = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetRootDocument(nsIAccessibleDocument **aRootDocument)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aRootDocument);
|
|
|
|
*aRootDocument = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetInnerHTML(nsAString &aInnerHTML)
|
|
|
|
{
|
|
|
|
aInnerHTML.Truncate();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::ScrollTo(PRUint32 aScrollType)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType,
|
|
|
|
PRInt32 aX, PRInt32 aY)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetOwnerWindow(void **aOwnerWindow)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aOwnerWindow);
|
|
|
|
*aOwnerWindow = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetComputedStyleValue(const nsAString &aPseudoElt,
|
|
|
|
const nsAString &aPropertyName,
|
|
|
|
nsAString &aValue)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetComputedStyleCSSValue(const nsAString &aPseudoElt,
|
|
|
|
const nsAString &aPropertyName,
|
|
|
|
nsIDOMCSSPrimitiveValue **aCSSPrimitiveValue)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aCSSPrimitiveValue);
|
|
|
|
*aCSSPrimitiveValue = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsApplicationAccessible::GetLanguage(nsAString &aLanguage)
|
|
|
|
{
|
|
|
|
aLanguage.Truncate();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2010-10-20 21:16:10 -07:00
|
|
|
|