1 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* For documentation of the accessibility architecture,
7 * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
10 #ifndef _AccessibleWrap_H_
11 #define _AccessibleWrap_H_
13 #include <objc/objc.h>
15 #include "Accessible.h"
21 #include "nsAutoPtr.h"
30 class AccessibleWrap
: public Accessible
32 public: // construction, destruction
33 AccessibleWrap(nsIContent
* aContent
, DocAccessible
* aDoc
);
34 virtual ~AccessibleWrap();
37 * Get the native Obj-C object (mozAccessible).
39 NS_IMETHOD
GetNativeInterface (void** aOutAccessible
);
42 * The objective-c |Class| type that this accessible's native object
43 * should be instantied with. used on runtime to determine the
44 * right type for this accessible's associated native object.
46 virtual Class
GetNativeType ();
48 virtual void Shutdown ();
49 virtual void InvalidateChildren();
51 virtual bool InsertChildAt(uint32_t aIdx
, Accessible
* aChild
) MOZ_OVERRIDE
;
52 virtual bool RemoveChild(Accessible
* aAccessible
);
54 virtual nsresult
HandleAccEvent(AccEvent
* aEvent
);
57 * Ignored means that the accessible might still have children, but is not
58 * displayed to the user. it also has no native accessible object represented
63 inline bool HasPopup ()
64 { return (NativeState() & mozilla::a11y::states::HASPOPUP
); }
67 * Returns this accessible's all children, adhering to "flat" accessibles by
68 * not returning their children.
70 void GetUnignoredChildren(nsTArray
<Accessible
*>* aChildrenArray
);
71 Accessible
* GetUnignoredParent() const;
76 * Return true if the parent doesn't have children to expose to AT.
78 bool AncestorIsFlat();
81 * Get the native object. Create it if needed.
84 mozAccessible
* GetNativeObject();
92 * Our native object. Private because its creation is done lazily.
93 * Don't access it directly. Ever. Unless you are GetNativeObject() or
97 // if we are in Objective-C, we use the actual Obj-C class.
98 mozAccessible
* mNativeObject
;
104 * We have created our native. This does not mean there is one.
105 * This can never go back to false.
106 * We need it because checking whether we need a native object cost time.
112 } // namespace mozilla