/src/mozilla-central/accessible/atk/AccessibleWrap.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef __NS_ACCESSIBLE_WRAP_H__ |
8 | | #define __NS_ACCESSIBLE_WRAP_H__ |
9 | | |
10 | | #include "nsCOMPtr.h" |
11 | | #include "Accessible.h" |
12 | | |
13 | | struct _AtkObject; |
14 | | typedef struct _AtkObject AtkObject; |
15 | | |
16 | | enum AtkProperty { |
17 | | PROP_0, // gobject convention |
18 | | PROP_NAME, |
19 | | PROP_DESCRIPTION, |
20 | | PROP_PARENT, // ancestry has changed |
21 | | PROP_ROLE, |
22 | | PROP_LAYER, |
23 | | PROP_MDI_ZORDER, |
24 | | PROP_TABLE_CAPTION, |
25 | | PROP_TABLE_COLUMN_DESCRIPTION, |
26 | | PROP_TABLE_COLUMN_HEADER, |
27 | | PROP_TABLE_ROW_DESCRIPTION, |
28 | | PROP_TABLE_ROW_HEADER, |
29 | | PROP_TABLE_SUMMARY, |
30 | | PROP_LAST // gobject convention |
31 | | }; |
32 | | |
33 | | struct AtkPropertyChange { |
34 | | int32_t type; // property type as listed above |
35 | | void *oldvalue; |
36 | | void *newvalue; |
37 | | }; |
38 | | |
39 | | namespace mozilla { |
40 | | namespace a11y { |
41 | | |
42 | | class MaiHyperlink; |
43 | | |
44 | | /** |
45 | | * AccessibleWrap, and its descendents in atk directory provide the |
46 | | * implementation of AtkObject. |
47 | | */ |
48 | | class AccessibleWrap : public Accessible |
49 | | { |
50 | | public: |
51 | | AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc); |
52 | | virtual ~AccessibleWrap(); |
53 | | void ShutdownAtkObject(); |
54 | | |
55 | | virtual void Shutdown() override; |
56 | | |
57 | | // return the atk object for this AccessibleWrap |
58 | | virtual void GetNativeInterface(void** aOutAccessible) override; |
59 | | virtual nsresult HandleAccEvent(AccEvent* aEvent) override; |
60 | | |
61 | | AtkObject * GetAtkObject(void); |
62 | | static AtkObject* GetAtkObject(Accessible* aAccessible); |
63 | | |
64 | | bool IsValidObject(); |
65 | | |
66 | 0 | static const char * ReturnString(nsAString &aString) { |
67 | 0 | static nsCString returnedString; |
68 | 0 | returnedString = NS_ConvertUTF16toUTF8(aString); |
69 | 0 | return returnedString.get(); |
70 | 0 | } |
71 | | |
72 | | static void GetKeyBinding(Accessible* aAccessible, nsAString& aResult); |
73 | | |
74 | | static Accessible* GetColumnHeader(TableAccessible* aAccessible, |
75 | | int32_t aColIdx); |
76 | | static Accessible* GetRowHeader(TableAccessible* aAccessible, |
77 | | int32_t aRowIdx); |
78 | | protected: |
79 | | |
80 | | nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject); |
81 | | nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject); |
82 | | |
83 | | AtkObject *mAtkObject; |
84 | | |
85 | | private: |
86 | | uint16_t CreateMaiInterfaces(); |
87 | | }; |
88 | | |
89 | | } // namespace a11y |
90 | | } // namespace mozilla |
91 | | |
92 | | #endif /* __NS_ACCESSIBLE_WRAP_H__ */ |