2010-08-18 19:14:50 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
2007-06-01 20:01:38 -07:00
|
|
|
*/
|
2012-05-21 04:12:37 -07: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/. */
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2012-05-12 13:09:07 -07:00
|
|
|
#ifndef mozilla_a11y_ApplicationAccessible_h__
|
|
|
|
#define mozilla_a11y_ApplicationAccessible_h__
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "AccessibleWrap.h"
|
2014-09-23 05:23:02 -07:00
|
|
|
#include "xpcAccessibleApplication.h"
|
2010-03-18 11:49:39 -07:00
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
#include "nsIMutableArray.h"
|
2010-03-18 11:49:39 -07:00
|
|
|
#include "nsIXULAppInfo.h"
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2012-05-12 13:09:07 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
2012-05-29 17:51:00 -07:00
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
/**
|
2012-04-25 04:29:40 -07:00
|
|
|
* ApplicationAccessible is for the whole application of Mozilla.
|
|
|
|
* Only one instance of ApplicationAccessible exists for one Mozilla instance.
|
2007-06-01 20:01:38 -07:00
|
|
|
* And this one should be created when Mozilla Startup (if accessibility
|
|
|
|
* feature has been enabled) and destroyed when Mozilla Shutdown.
|
|
|
|
*
|
|
|
|
* All the accessibility objects for toplevel windows are direct children of
|
2012-04-25 04:29:40 -07:00
|
|
|
* the ApplicationAccessible instance.
|
2007-06-01 20:01:38 -07:00
|
|
|
*/
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
class ApplicationAccessible : public AccessibleWrap,
|
2014-09-23 05:23:02 -07:00
|
|
|
public xpcAccessibleApplication
|
2007-06-01 20:01:38 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-08-18 19:14:50 -07:00
|
|
|
|
2012-04-25 04:29:40 -07:00
|
|
|
ApplicationAccessible();
|
2007-06-01 20:01:38 -07:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2013-10-28 20:30:55 -07:00
|
|
|
virtual void Shutdown();
|
2014-09-16 10:30:23 -07:00
|
|
|
virtual nsIntRect Bounds() const MOZ_OVERRIDE;
|
2012-10-19 00:15:23 -07:00
|
|
|
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
|
2012-05-29 17:51:00 -07:00
|
|
|
virtual GroupPos GroupPosition();
|
|
|
|
virtual ENameValueFlag Name(nsString& aName);
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual void ApplyARIAState(uint64_t* aState) const;
|
2011-04-23 06:14:05 -07:00
|
|
|
virtual void Description(nsString& aDescription);
|
2012-04-09 02:48:41 -07:00
|
|
|
virtual void Value(nsString& aValue);
|
2014-09-16 10:30:23 -07:00
|
|
|
virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t State() MOZ_OVERRIDE;
|
|
|
|
virtual uint64_t NativeState() MOZ_OVERRIDE;
|
2013-10-19 11:19:50 -07:00
|
|
|
virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
|
2011-08-09 02:31:31 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
|
2012-05-28 18:18:45 -07:00
|
|
|
EWhichChildAtPoint aWhichChild);
|
|
|
|
virtual Accessible* FocusedChild();
|
2009-12-10 11:12:19 -08:00
|
|
|
|
|
|
|
virtual void InvalidateChildren();
|
2007-06-01 20:01:38 -07:00
|
|
|
|
2011-07-19 06:12:40 -07:00
|
|
|
// ActionAccessible
|
|
|
|
virtual KeyBinding AccessKey() const;
|
|
|
|
|
2014-09-23 05:23:02 -07:00
|
|
|
// ApplicationAccessible
|
|
|
|
void AppName(nsAString& aName) const
|
|
|
|
{
|
|
|
|
nsAutoCString cname;
|
|
|
|
mAppInfo->GetName(cname);
|
|
|
|
AppendUTF8toUTF16(cname, aName);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AppVersion(nsAString& aVersion) const
|
|
|
|
{
|
|
|
|
nsAutoCString cversion;
|
|
|
|
mAppInfo->GetVersion(cversion);
|
|
|
|
AppendUTF8toUTF16(cversion, aVersion);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PlatformName(nsAString& aName) const
|
|
|
|
{
|
|
|
|
aName.AssignLiteral("Gecko");
|
|
|
|
}
|
|
|
|
|
|
|
|
void PlatformVersion(nsAString& aVersion) const
|
|
|
|
{
|
|
|
|
nsAutoCString cversion;
|
|
|
|
mAppInfo->GetPlatformVersion(cversion);
|
|
|
|
AppendUTF8toUTF16(cversion, aVersion);
|
|
|
|
}
|
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~ApplicationAccessible() {}
|
2009-12-10 11:12:19 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2007-06-01 20:01:38 -07:00
|
|
|
virtual void CacheChildren();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
|
2012-07-30 07:20:58 -07:00
|
|
|
nsresult *aError = nullptr) const;
|
2010-03-18 11:49:39 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIXULAppInfo> mAppInfo;
|
2007-06-01 20:01:38 -07:00
|
|
|
};
|
|
|
|
|
2012-05-12 13:09:07 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2007-06-01 20:01:38 -07:00
|
|
|
#endif
|
|
|
|
|