Re: Getting an accessibility attributed string
Re: Getting an accessibility attributed string
- Subject: Re: Getting an accessibility attributed string
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 05 May 2008 07:26:43 -0400
- Thread-topic: Getting an accessibility attributed string
on 2008-05-05 5:39 AM, Christiaan Hofman at email@hidden wrote:
> BTW, is there some documentation about what the required/optional
> parametrized attributes are for the various roles? I could only find
> this for non-parametrized attributes, with a very useless remark to
> look at the "framework specific documentation". So my question is:
> where can I find this "framework specific documentation"? An actual
> link would have been helpful.
I think, by "framework specific documentation," they mean read the "Cocoa
Accessibility Reference" document or the "Carbon Accessibility Reference"
document, depending on whether you are using the Cocoa frameworks or the
Carbon frameworks.
For example, to read about the parameterized attributes in general, examine
the section headed "Parameterized Attributes" in the Carbon Accessibility
Reference document. Each of the parameterized attribute constants is listed
and explained briefly.
The parameterized attributes are for working with text, so they only work in
text views and text fields. There is a specific function to get the names of
the supported attributes in a particular text view/control.
If you're trying to write an assistive application, you're pretty much on
your own. I've been complaining about the lack of documentation for writing
assistive applications for a long time, to no avail. You can find some, but
mostly you have to read the documentation about how to make your Carbon or
Cocoa application accessible and work backwards from that.
The only specific assistive oriented documentation I'm aware of at this time
are:
<http://developer.apple.com/documentation/Accessibility/Reference/Accessibil
ityLowlevel/index.html>
and the "NSAccessibility Protocol Reference" document. I believe the first
of these has information about the AXAttributedString.h header. And, of
course, read all of the AX headers and NSAccessibility.h.
I figured out how all this stuff works a long time ago, but it took a lot of
reading between the lines and experimentation. You can play with
parameterized attributes using the 30-day free trial version of my PreFab UI
Browser at <http://prefabsoftware.com/uibrowser/>. Open any RTF file in
TextEdit, then launch UI Browser and choose TextEdit as the target
application. Use UI Browser's browser view to navigate to the text entry
area in the scroll view in the TextEdit window, then open UI Browser's
Attributes drawer. If you set UI Browser's General - Terminology preference
to use "Technical" Accessibility names, you'll recognize all of the
parameterized attribute names. They are marked with a hollow triangular
bullet in the Attributes drawer, meaning that you can set a parameter and
see the resulting parameterized value. For example, select the
AXAttributedStringForRange attribute, then an area appears in the Attributes
drawer where you can enter the start and length values for the range you
want to examine, then click the View in Window button to see the resulting
attributed substring.
You can also use UI Browser's hot key feature to explore parameterized
attributes. Place the mouse over any line in an RTF file open in TextEdit,
hit UI Brower's system-wide hot key (CTRL-CMD-S by default), and open UI
Browser's Attributes drawer. For convenience, I designed this feature so
that it reports parameterized values for the complete line of text under the
mouse by default, but you can then reset the parameters for any of the
parameterized attributes in UI Browser to see how it all works.
You'll find a little more information in UI Browser's Help book, in the
"Text and Parameterized Attributes" section of the "View and Set Attributes"
chapter.
To convert between standard attributed string parameters and accessibility
attributed string parameters, I have written two Objective-C methods, which
I call -attributedStringFromAXAttributedString: and
-attributedStringAttributesFromAXAttributedStringAttributes:. Write me
privately off-list for the source, if you're interested. These methods work
by brute force, based on my understanding of the relevant accessibility
header files.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden