1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/src/generic/ApplicationAccessible.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,98 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:expandtab:shiftwidth=2:tabstop=2: 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#ifndef mozilla_a11y_ApplicationAccessible_h__ 1.12 +#define mozilla_a11y_ApplicationAccessible_h__ 1.13 + 1.14 +#include "AccessibleWrap.h" 1.15 +#include "nsIAccessibleApplication.h" 1.16 + 1.17 +#include "nsIMutableArray.h" 1.18 +#include "nsIXULAppInfo.h" 1.19 + 1.20 +namespace mozilla { 1.21 +namespace a11y { 1.22 + 1.23 +/** 1.24 + * ApplicationAccessible is for the whole application of Mozilla. 1.25 + * Only one instance of ApplicationAccessible exists for one Mozilla instance. 1.26 + * And this one should be created when Mozilla Startup (if accessibility 1.27 + * feature has been enabled) and destroyed when Mozilla Shutdown. 1.28 + * 1.29 + * All the accessibility objects for toplevel windows are direct children of 1.30 + * the ApplicationAccessible instance. 1.31 + */ 1.32 + 1.33 +class ApplicationAccessible : public AccessibleWrap, 1.34 + public nsIAccessibleApplication 1.35 +{ 1.36 +public: 1.37 + 1.38 + ApplicationAccessible(); 1.39 + 1.40 + // nsISupports 1.41 + NS_DECL_ISUPPORTS_INHERITED 1.42 + 1.43 + // nsIAccessible 1.44 + NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument); 1.45 + NS_IMETHOD ScrollTo(uint32_t aScrollType); 1.46 + NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY); 1.47 + NS_IMETHOD GetLanguage(nsAString& aLanguage); 1.48 + NS_IMETHOD GetParent(nsIAccessible **aParent); 1.49 + NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling); 1.50 + NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling); 1.51 + NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY, 1.52 + int32_t *aWidth, int32_t *aHeight); 1.53 + NS_IMETHOD SetSelected(bool aIsSelected); 1.54 + NS_IMETHOD TakeSelection(); 1.55 + NS_IMETHOD TakeFocus(); 1.56 + NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName); 1.57 + NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription); 1.58 + NS_IMETHOD DoAction(uint8_t aIndex); 1.59 + 1.60 + // nsIAccessibleApplication 1.61 + NS_DECL_NSIACCESSIBLEAPPLICATION 1.62 + 1.63 + // Accessible 1.64 + virtual void Shutdown(); 1.65 + virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE; 1.66 + virtual GroupPos GroupPosition(); 1.67 + virtual ENameValueFlag Name(nsString& aName); 1.68 + virtual void ApplyARIAState(uint64_t* aState) const; 1.69 + virtual void Description(nsString& aDescription); 1.70 + virtual void Value(nsString& aValue); 1.71 + virtual mozilla::a11y::role NativeRole(); 1.72 + virtual uint64_t State(); 1.73 + virtual uint64_t NativeState(); 1.74 + virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE; 1.75 + 1.76 + virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, 1.77 + EWhichChildAtPoint aWhichChild); 1.78 + virtual Accessible* FocusedChild(); 1.79 + 1.80 + virtual void InvalidateChildren(); 1.81 + 1.82 + // ActionAccessible 1.83 + virtual uint8_t ActionCount(); 1.84 + virtual KeyBinding AccessKey() const; 1.85 + 1.86 +protected: 1.87 + 1.88 + // Accessible 1.89 + virtual void CacheChildren(); 1.90 + virtual Accessible* GetSiblingAtOffset(int32_t aOffset, 1.91 + nsresult *aError = nullptr) const; 1.92 + 1.93 +private: 1.94 + nsCOMPtr<nsIXULAppInfo> mAppInfo; 1.95 +}; 1.96 + 1.97 +} // namespace a11y 1.98 +} // namespace mozilla 1.99 + 1.100 +#endif 1.101 +