Audacity 3.2.0
WindowAccessible.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 WindowAccessible
6
7 David Bailes
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WINDOW_ACCESSIBLE__
12#define __AUDACITY_WINDOW_ACCESSIBLE__
13
14#include <wx/setup.h> // for wxUSE_* macros
15
16#if wxUSE_ACCESSIBILITY
17
18#include <wx/access.h> // to inherit
19#include <Internat.h> // for TranslatableString
20
21class WX_WRAPPERS_API WindowAccessible: public wxAccessible
22{
23public:
24 WindowAccessible(wxWindow* win);
25 virtual ~WindowAccessible() {}
26
27 wxAccStatus GetName(int childId, wxString* name) override;
28
29};
30
31class WX_WRAPPERS_API SliderAx final : public WindowAccessible
32{
33public:
34 SliderAx(wxWindow * window, const TranslatableString &fmt);
35
36 virtual ~ SliderAx();
37
38 // Retrieves the address of an IDispatch interface for the specified child.
39 // All objects must support this property.
40 wxAccStatus GetChild(int childId, wxAccessible** child) override;
41
42 // Gets the number of children.
43 wxAccStatus GetChildCount(int* childCount) override;
44
45 // Gets the default action for this object (0) or > 0 (the action for a child).
46 // Return wxACC_OK even if there is no action. actionName is the action, or the empty
47 // string if there is no action.
48 // The retrieved string describes the action that is performed on an object,
49 // not what the object does as a result. For example, a toolbar button that prints
50 // a document has a default action of "Press" rather than "Prints the current document."
51 wxAccStatus GetDefaultAction(int childId, wxString *actionName) override;
52
53 // Returns the description for this object or a child.
54 wxAccStatus GetDescription(int childId, wxString *description) override;
55
56 // Gets the window with the keyboard focus.
57 // If childId is 0 and child is NULL, no object in
58 // this subhierarchy has the focus.
59 // If this object has the focus, child should be 'this'.
60 wxAccStatus GetFocus(int *childId, wxAccessible **child) override;
61
62 // Returns help text for this object or a child, similar to tooltip text.
63 wxAccStatus GetHelpText(int childId, wxString *helpText) override;
64
65 // Returns the keyboard shortcut for this object or child.
66 // Return e.g. ALT+K
67 wxAccStatus GetKeyboardShortcut(int childId, wxString *shortcut) override;
68
69 // Returns the rectangle for this object (id = 0) or a child element (id > 0).
70 // rect is in screen coordinates.
71 wxAccStatus GetLocation(wxRect& rect, int elementId) override;
72
73 // Gets the name of the specified object.
74 wxAccStatus GetName(int childId, wxString *name) override;
75
76 // Returns a role constant.
77 wxAccStatus GetRole(int childId, wxAccRole *role) override;
78
79 // Gets a variant representing the selected children
80 // of this object.
81 // Acceptable values:
82 // - a null variant (IsNull() returns TRUE)
83 // - a list variant (GetType() == wxT("list"))
84 // - an integer representing the selected child element,
85 // or 0 if this object is selected (GetType() == wxT("long"))
86 // - a "void*" pointer to a wxAccessible child object
87 wxAccStatus GetSelections(wxVariant *selections) override;
88
89 // Returns a state constant.
90 wxAccStatus GetState(int childId, long* state) override;
91
92 // Returns a localized string representing the value for the object
93 // or child.
94 wxAccStatus GetValue(int childId, wxString* strValue) override;
95
96private:
97 wxWindow *mParent;
99};
100
101#endif // wxUSE_ACCESSIBILITY
102#endif // __AUDACITY_WINDOW_ACCESSIBLE__
wxString name
Definition: TagsEditor.cpp:166
Holds a msgid for the translation catalog; may also bind format arguments.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...