Top Banner
2002 Prentice Hall. All rights reserved. 1 Chapter 24 – Accessibility Outline 24.1 Introduction 24.2 Regulations and Resources 24.3 Web Accessibility Initiative 24.4 Providing Alternatives for Images 24.5 Maximizing Readability by Focusing on Structure 24.6 Accessibility in Visual Studio .NET 24.6.1 Enlarging Toolbar Icons 24.6.2 Enlarging the Text 24.6.3 Modifying the Toolbox 24.6.4 Modifying the Keyboard 24.6.5 Rearranging Windows 24.7 Accessibility in C# 24.8 Accessibility in XHTML Tables
78

Csphtp1 24

May 20, 2015

Download

Technology

Khánh Đỗ

C# how to programing
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Csphtp1 24

2002 Prentice Hall. All rights reserved.

1

Chapter 24 – Accessibility

Outline24.1 Introduction24.2 Regulations and Resources24.3 Web Accessibility Initiative24.4 Providing Alternatives for Images24.5 Maximizing Readability by Focusing on Structure24.6 Accessibility in Visual Studio .NET

24.6.1 Enlarging Toolbar Icons24.6.2 Enlarging the Text24.6.3 Modifying the Toolbox24.6.4 Modifying the Keyboard24.6.5 Rearranging Windows

24.7 Accessibility in C#24.8 Accessibility in XHTML Tables

Page 2: Csphtp1 24

2002 Prentice Hall. All rights reserved.

2

Chapter 24 – Accessibility

Outline24.9 Accessibility in XHTML Frames24.10 Accessibility in XML24.11 Using Voice Synthesis and Recognition with VoiceXML™24.12 CallXML™24.13 JAWS® for Windows24.14 Other Accessibility Tools24.15 Accessibility in Microsoft® Windows® 2000

24.15.1 Tools for People with Visual Impairments24.15.2 Tools for People with Hearing Impairments24.15.3 Tools for Users Who Have Difficulty Using the Keyboard24.15.4 Microsoft Narrator24.15.5 Microsoft On-Screen Keyboard24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5

24.16 Internet and World Wide Web Resources

Page 3: Csphtp1 24

2002 Prentice Hall. All rights reserved.

3

24.1 Introduction

• Accessibility– Usability of an application

• Tailored toward disabled community

– Requirements

– Recommendations

Page 4: Csphtp1 24

2002 Prentice Hall. All rights reserved.

4

24.2 Regulations and Resources

• Legislation – ADA

• Extra job opportunities

Page 5: Csphtp1 24

2002 Prentice Hall. All rights reserved.

5

24.2 Regulations and Resources

Act Purpose Americans with Disabilities Act The ADA prohibits discrimination on the basis of disability in

employment, state and local government, public accommodations, commercial facilities, transportation and telecommunications.

Telecommunications Act of 1996 The Telecommunications Act of 1996 contains two amendments to Section 255 and Section 251(a)(2) of the Communications Act of 1934. These amendments require that communication devices, such as cell phones, telephones and pagers, be accessible to individuals with disabilities.

Individuals with Disabilities Education Act of 1997

The Individuals with Disabilities Education Act stipulates that education materials in schools must be made accessible to children with disabilities.

Rehabilitation Act Section 504 of the Rehabilitation Act states that college sponsored activities receiving federal funding cannot discriminate against individuals with disabilities. Section 508 mandates that all government institutions receiving federal funding must design their Web sites so that they are accessible to individuals with disabilities. Businesses that sell services to the government also must abide by this act.

Fig. 24.1 Acts designed to ensure Internet access for people with disabilities.

Page 6: Csphtp1 24

2002 Prentice Hall. All rights reserved.

6

24.2 Regulations and Resources

Fig. 24.2 We Media’s home page. (Courtesy of WeMedia, Inc.)

Page 7: Csphtp1 24

2002 Prentice Hall. All rights reserved.

7

24.3 Web Accessibility Initiative

• World Wide Web Consortium • WAI published Web Content Accessibility

Guidelines– Uses checkpoints

– Priority rating

Page 8: Csphtp1 24

2002 Prentice Hall. All rights reserved.

8

24.4 Providing Alternative for Images

• Textual equivalent• User agents

– Screen readers• Cannot interpret pictures

– Braille displays

• Maximize accessibility of content• Screen interface Emacspeak• WeMedia Browser• IBM Home Page Reader

Page 9: Csphtp1 24

2002 Prentice Hall. All rights reserved.

9

24.5 Maximizing Readability by Focusing on Structure

• Improper usage of XHTML tags• Readability

– Usage of simpler words

– No slang

– First sentence convey message

• Gunning Fog Index

Page 10: Csphtp1 24

2002 Prentice Hall. All rights reserved.

10

24.6 Accessibility in Visual Studio .NET

• Visual Studio .NET guidelines– Color for enhancement purposes

– Provide information about objects

– Design user interface to match user preferences

– Flexibility of time settings

Page 11: Csphtp1 24

2002 Prentice Hall. All rights reserved.

11

24.6.1 Enlarging Toolbar Icons

Fig. 24.3 Enlarging icons using the Customize feature.

Page 12: Csphtp1 24

2002 Prentice Hall. All rights reserved.

12

24.6.1 Enlarging Toolbar Icons

Fig. 24.4 Enlarged icons in the development window.

Page 13: Csphtp1 24

2002 Prentice Hall. All rights reserved.

13

24.6.2 Enlarging the Text

Fig. 24.5 Text Editor before modifying the font size.

Page 14: Csphtp1 24

2002 Prentice Hall. All rights reserved.

14

24.6.2 Enlarging the Text

Fig. 24.6 Enlarging text in the Options window.

Page 15: Csphtp1 24

2002 Prentice Hall. All rights reserved.

15

24.6.2 Enlarging the Text

Fig. 24.7 Text Editor after the font size is modified.

Page 16: Csphtp1 24

2002 Prentice Hall. All rights reserved.

16

24.6.3 Modifying the Toolbox

Fig. 24.8 Adding tabs to the Toolbox.

Page 17: Csphtp1 24

2002 Prentice Hall. All rights reserved.

17

24.6.4 Modifying the Keyboard

Fig. 24.9 Shortcut key creation.

operation selectionapplication to apply shortcuts

mapping scheme

key designation

Page 18: Csphtp1 24

2002 Prentice Hall. All rights reserved.

18

24.6.5 Rearranging Windows

Fig. 24.10 Removing tabs from Visual Studio environment.

Page 19: Csphtp1 24

2002 Prentice Hall. All rights reserved.

19

24.6.5 Rearranging Windows

Fig. 24.11 Console windows with tabs and without tabs.

no tabs

tabs

Page 20: Csphtp1 24

2002 Prentice Hall. All rights reserved.

20

24.7 Accessibility in C#

• Features and guidelines– Gear toward broad rather than specific users

– Use larger fonts

– Keyboard shortcuts

– Visual and audio context

– Visual cues

– Test application’s functionality

• Text-to-speech control• Tab stops

– Tab order

• Use specific classes provided by .NET

Page 21: Csphtp1 24

2002 Prentice Hall. All rights reserved.

21

24.7 Accessibility in C#

Property Purpose AccessibleDescription Describes the control to an accessibility client application. For

example, a CheckBox that says "New User" would not need more of a description, but a CheckBox with an image of a cat would have its AccessibleDescription property set to something like "A CheckBox with an image of a cat on it".

AccessibleName Contains a short name or identifier for the control.

AccessibleRole Member of the AccessibleRole enumeration. Represents the role of this control in the application—this may help the accessibility client application determine what actions it should take.

IsAccessible Contains a bool value specifying whether this control is visible to accessibility client applications.

Fig. 24.12 Properties of class Control related to accessibility.

Page 22: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline22

TextToSpeech.cs

1 // Fig. 24.13: TextToSpeech.cs2 // Providing audio for people with visual impairments.3 4 using System;5 using System.Drawing;6 using System.Collections;7 using System.ComponentModel;8 using System.Windows.Forms;9 using System.Data;10 11 // helps users navigate a form with aid of audio cues12 public class TextToSpeech : System.Windows.Forms.Form13 {14 private System.Windows.Forms.Label nameLabel;15 private System.Windows.Forms.Label phoneLabel;16 17 private System.Windows.Forms.TextBox nameTextBox;18 private System.Windows.Forms.TextBox phoneTextBox;19 private System.Windows.Forms.TextBox passwordTextBox;20 21 private System.Windows.Forms.Button submitButton;22 23 private System.Windows.Forms.Label passwordLabel;24 25 private AxHTTSLib.AxTextToSpeech speaker;26 27 private System.ComponentModel.Container components = null;28 29 // default constructor30 public TextToSpeech()31 {32 InitializeComponent();33

Text-to-speech control

Page 23: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline23

TextToSpeech.cs

34 // set Form to be visible to accessibility applications35 this.IsAccessible = true;36 37 // let all controls be visible to accessibility applications38 foreach ( Control current in this.Controls )39 current.IsAccessible = true;40 }41 42 private void InitializeComponent()43 {44 this.nameLabel.AccessibleDescription = "User Name";45 this.nameLabel.AccessibleName = "User Name";46 this.nameLabel.TabIndex = 5;47 this.nameLabel.MouseHover += 48 new System.EventHandler( this.controls_MouseHover );49 50 this.phoneLabel.AccessibleDescription = 51 "Phone Number Label";52 this.phoneLabel.AccessibleName = "Phone Number Label";53 this.phoneLabel.TabIndex = 6;54 this.phoneLabel.MouseHover += 55 new System.EventHandler( this.controls_MouseHover );56 57 this.nameTextBox.AccessibleDescription = 58 "Enter User Name";59 this.nameTextBox.AccessibleName = "User Name TextBox";60 this.nameTextBox.TabIndex = 1;61 this.nameTextBox.MouseHover += 62 new System.EventHandler( this.controls_MouseHover );63

TabIndex property of the control

Set AccessibleDiscription properties of all the controlsSet AccessibleName

properties of all the controls

Not visible in the Properties window during design time

Loop through each control and update IsAccessible property to true

Page 24: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline24

TextToSpeech.cs

64 this.phoneTextBox.AccessibleDescription = 65 "Enter Phone Number";66 this.phoneTextBox.AccessibleName = "Phone Number TextBox";67 this.phoneTextBox.TabIndex = 2;68 this.phoneTextBox.MouseHover += 69 new System.EventHandler( this.controls_MouseHover );70 71 this.passwordTextBox.AccessibleDescription = 72 "Enter Password";73 this.passwordTextBox.AccessibleName = "Password TextBox";74 this.passwordTextBox.TabIndex = 3;75 this.passwordTextBox.MouseHover += 76 new System.EventHandler( this.controls_MouseHover );77 78 this.submitButton.AccessibleDescription = 79 "Submit the Information";80 this.submitButton.AccessibleName = "Submit Information";81 this.submitButton.TabIndex = 4;82 this.submitButton.Text = "&Submit";83 this.submitButton.Click += 84 new System.EventHandler( this.submitButton_Click );85 this.submitButton.MouseHover += 86 new System.EventHandler( this.controls_MouseHover );87 88 this.passwordLabel.AccessibleDescription = 89 "Password Label";90 this.passwordLabel.AccessibleName = "Password Label";91 this.passwordLabel.TabIndex = 7;92 this.passwordLabel.MouseHover += 93 new System.EventHandler( this.controls_MouseHover );94

&Submit allows special keyboard access

Page 25: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline25

TextToSpeech.cs

95 this.speaker.AccessibleDescription = 96 "Give Information about Form";97 this.speaker.AccessibleName = "Speaker";98 this.speaker.TabIndex = 8;99 this.speaker.TabStop = false;100 101 this.AccessibleDescription = "Registration Form";102 this.AccessibleName = "Registration Form"; 103 }104 105 [STAThread]106 static void Main() 107 {108 Application.Run( new TextToSpeech() );109 }110 111 // tell user over which control the mouse is112 private void controls_MouseHover( 113 object sender, System.EventArgs e )114 {115 // if mouse is over a Label, tell user to enter information116 if ( sender.GetType() == nameLabel.GetType() )117 {118 Label temporary = ( Label) sender;119 speaker.Speak( "Please enter your " + temporary.Text +120 " in the textbox to the right" );121 }122

This method to determine type of control

Casts sender to a Label and assign to Label temporary

A reference to control that triggered the event

Provide string to be converted to speech

Determine which type matches the labelMethod GetType returns

instance of class Type

Page 26: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline26

TextToSpeech.cs

123 // if mouse is over a TextBox, tell user what 124 // information was entered125 else if ( sender.GetType() == nameTextBox.GetType() )126 {127 TextBox temporary = ( TextBox ) sender;128 speaker.Speak( "You have entered " + 129 ( temporary.Text == "" ? "nothing" : 130 temporary.Text ) + " in the " + temporary.Name );131 }132 133 // otherwise, user is over Button, so tell user to click134 // it to submit the information135 else136 speaker.Speak( 137 "Click on this button to submit your information" );138 139 } // end method controls_MouseHover140 141 // thank user for information submission142 private void submitButton_Click( 143 object sender, System.EventArgs e )144 {145 speaker.Speak( 146 "Thank you, your information has been submitted." );147 148 Application.Exit();149 }150 151 } // end class TextToSpeech

When the type is neither a Label nor a TexBox

Notify the user

Page 27: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline27

TextToSpeech.cs Program Output

Page 28: Csphtp1 24

2002 Prentice Hall. All rights reserved.

28

24.8 Accessibility in XHTML Tables

• Present content more adequately – Specify caption and header

– Visually more appropriate labels

– Correct size for header cell and id attribute

Page 29: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline29

withoutheaders.html

1 <?xml version = "1.0"?>2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">4 5 <!-- Fig. 24.14: withoutheaders.html -->6 <!-- Table without headers -->7 8 <html xmlns = "http://www.w3.org/1999/xhtml">9 <head>10 <title>XHTML Table Without Headers</title>11 12 <style type = "text/css">13 body { background-color: #ccffaa; 14 text-align: center }15 </style>16 </head>17 18 <body>19 20 <p>Price of Fruit</p>21 22 <table border = "1" width = "50%">23 24 <tr>25 <td>Fruit</td>26 <td>Price</td>27 </tr>28 29 <tr>30 <td>Apple</td>31 <td>$0.25</td>32 </tr>33

Page 30: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline30

withoutheaders.html

Program Output

34 <tr>35 <td>Orange</td>36 <td>$0.50</td>37 </tr>38 39 <tr>40 <td>Banana</td>41 <td>$1.00</td>42 </tr>43 44 <tr>45 <td>Pineapple</td>46 <td>$2.00</td>47 </tr>48 49 </table>50 51 </body>52 </html>

Page 31: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline31

withheaders.html

1 <?xml version = "1.0"?>2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">4 5 <!-- Fig. 24.15: withheaders.html -->6 <!-- Table with headers -->7 8 <html xmlns = "http://www.w3.org/1999/xhtml">9 <head>10 <title>XHTML Table With Headers</title>11 12 <style type = "text/css">13 body { background-color: #ccffaa;14 text-align: center }15 </style>16 </head>17 18 <body>19 20 <!-- This table uses the id and headers attributes to -->21 <!-- ensure readability by text-based browsers. It also -->22 <!-- uses a summary attribute, used by screen readers to -->23 <!-- describe the table. -->24 25 <table width = "50%" border = "1" 26 summary = "This table uses th elements and id and 27 headers attributes to make the table readable 28 by screen readers">29 30 <caption><strong>Price of Fruit</strong></caption>31 32 <tr>33 <th id = "fruit">Fruit</th>34 <th id = "price">Price</th>35 </tr>

Provide summary content for screen reader

Page 32: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline32

withheaders.html

36 37 <tr>38 <td headers = "fruit">Apple</td>39 <td headers = "price">$0.25</td>40 </tr>41 42 <tr>43 <td headers = "fruit">Orange</td>44 <td headers = "price">$0.50</td>45 </tr>46 47 <tr>48 <td headers = "fruit">Banana</td>49 <td headers = "price">$1.00</td>50 </tr>51 52 <tr>53 <td headers = "fruit">Pineapple</td>54 <td headers = "price">$2.00</td>55 </tr>56 57 </table>58 59 </body>60 </html>

Every cell in the table is preceded by its corresponding header

Page 33: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline33

withheaders.html Program Output

Page 34: Csphtp1 24

2002 Prentice Hall. All rights reserved.

34

24.9 Accessibility in XHTML Frames

• Frames– Content always displays on the screen

– More XHTML file in one browser window

Page 35: Csphtp1 24

2002 Prentice Hall. All rights reserved.

35

24.10 Accessibility in XML

• Recommendations– Include text description

– Element type should allow grouping and classification

– Should identify important content

Page 36: Csphtp1 24

2002 Prentice Hall. All rights reserved.

36

24.11 Using Voice Synthesis and Recognition with VoiceXML

• Speech synthesizers– VoiceXML

• Platform-independent

• Geared for people with impairment or are illiterate

• Read web pages to user

– Speech recognition• Understand spoken words

Page 37: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline37

main.vxml

1 <?xml version = "1.0"?>2 <vxml version = "1.0">3 4 <!-- Fig. 24.16: main.vxml -->5 <!-- Voice page -->6 7 <link next = "#home">8 <grammar>home</grammar>9 </link>10 11 <link next = "#end">12 <grammar>exit</grammar>13 </link>14 15 <var name = "currentOption" expr = "'home'"/>16 17 <form>18 <block>19 <emp>Welcome</emp> to the voice page of Deitel and 20 Associates. To exit any time say exit. 21 To go to the home page any time say home.22 </block>23 24 <subdialog src = "#home"/>25 </form>26 27 <menu id = "home">28 <prompt count = "1" timeout = "10s"> 29 You have just entered the Deitel home page. 30 Please make a selection by speaking one of the 31 following options:32 <break msecs = "1000" />33 <enumerate/>34 </prompt>35

form element presents information to the user and get data

menu element provides the list options and transfer control

Create active link to homepageSpecifies URL the browser is directed to

Element grammar marks the text user must speak to select the linkLink to id end when user speak exit

block can only exit within form element

Signal text should be spoken with emphasis

Instruct user to make selection

Maintain record of the number of times that a prompt is spoken

Page 38: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline38

main.vxml

36 <prompt count = "2">37 Please say one of the following.38 <break msecs = "1000" />39 <enumerate/>40 </prompt>41 42 <choice next = "#about">About us</choice>43 <choice next = "#directions">Driving directions</choice>44 <choice next = "publications.vxml">Publications</choice>45 </menu>46 47 <form id = "about">48 <block>49 About Deitel and Associates, Inc.50 Deitel and Associates, Inc. is an internationally 51 recognized corporate training and publishing 52 organization, specializing in programming languages,53 Internet and World Wide Web technology and object 54 technology education. Deitel and Associates, Inc. is a 55 member of the World Wide Web Consortium. The company56 provides courses on Java, C++, Visual Basic, C, Internet57 and World Wide Web programming and Object Technology. 58 <assign name = "currentOption" expr = "'about'"/>59 <goto next = "#repeat"/>60 </block>61 </form>62

Prompt remind user to make a selection

Page 39: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline39

main.vxml

63 <form id = "directions">64 <block>65 Directions to Deitel and Associates, Inc.66 We are located on Route 20 in Sudbury, 67 Massachusetts, equidistant from route 68 <sayas class = "digits">128</sayas> and route 69 <sayas class = "digits">495</sayas>.70 <assign name = "currentOption" expr = "'directions'"/>71 <goto next = "#repeat"/>72 </block>73 </form>74 75 <form id = "repeat">76 <field name = "confirm" type = "boolean">77 <prompt>78 To repeat say yes. To go back to home, say no.79 </prompt>80 81 <filled>82 <if cond = "confirm == true">83 <goto expr = "'#' + currentOption"/>84 <else/>85 <goto next = "#home"/>86 </if>87 </filled>88 89 </field>90 </form> 91 92 <form id = "end">93 <block>94 Thank you for visiting Deitel and Associates voice page.95 Have a nice day.96 <exit/>97 </block>98 </form>

Page 40: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline40

main.vxml

99 100 </vxml>101 <?xml version = "1.0"?>101 <?xml version = "1.0"?> 102 <vxml version = "1.0">103 104 <!-- Fig. 24.17: publications.vxml -->105 <!-- Voice page for various publications -->106 107 <link next = "main.vxml#home">108 <grammar>home</grammar>109 </link>110 111 <link next = "main.vxml#end">112 <grammar>exit</grammar>113 </link>114 115 <link next = "#publication">116 <grammar>menu</grammar>117 </link>118 119 <var name = "currentOption" expr = "'home'"/>120 121 <menu id = "publication">122 123 <prompt count = "1" timeout = "12s"> 124 Following are some of our publications. For more 125 information visit our web page at www.deitel.com. 126 To repeat the following menu, say menu at any time.127 Please select by saying one of the following books:128 <break msecs = "1000" />129 <enumerate/>130 </prompt>131

Provide links to the menu element which prompt user to select publication

Define link elements that provide links to main.vxml

Page 41: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline41

main.vxml

132 <prompt count = "2">133 Please select from the following books.134 <break msecs = "1000" />135 <enumerate/>136 </prompt>137 138 <choice next = "#java">Java.</choice>139 <choice next = "#c">C.</choice>140 <choice next = "#cplus">C plus plus.</choice>141 </menu>142 143 <form id = "java">144 <block>145 Java How to program, third edition.146 The complete, authoritative introduction to Java. 147 Java is revolutionizing software development with 148 multimedia-intensive, platform-independent, 149 object-oriented code for conventional, Internet, 150 Intranet and Extranet-based applets and applications. 151 This Third Edition of the world's most widely used 152 university-level Java textbook carefully explains 153 Java's extraordinary capabilities. 154 <assign name = "currentOption" expr = "'java'"/>155 <goto next = "#repeat"/>156 </block>157 </form>158

Describe the book according to topic

Page 42: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline42

main.vxml

159 <form id = "c">160 <block>161 C How to Program, third edition.162 This is the long-awaited, thorough revision to the 163 world's best-selling introductory C book! The book's 164 powerful "teach by example" approach is based on165 more than 10,000 lines of live code, thoroughly 166 explained and illustrated with screen captures showing 167 detailed output.World-renowned corporate trainers and 168 best-selling authors Harvey and Paul Deitel offer the 169 most comprehensive, practical introduction to C ever 170 published with hundreds of hands-on exercises, more 171 than 250 complete programs written and documented for 172 easy learning, and exceptional insight into good 173 programming practices, maximizing performance, avoiding 174 errors, debugging, and testing. New features include 175 thorough introductions to C++, Java, and object-oriented 176 programming that build directly on the C skills taught 177 in this book; coverage of graphical user interface 178 development and C library functions; and many new, 179 substantial hands-on projects.For anyone who wants to 180 learn C, improve their existing C skills, and understand 181 how C serves as the foundation for C++, Java, and 182 object-oriented development. 183 <assign name = "currentOption" expr = "'c'"/>184 <goto next = "#repeat"/>185 </block>186 </form>187

Page 43: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline43

main.vxml

188 <form id = "cplus">189 <block>190 The C++ how to program, second edition.191 With nearly 250,000 sold, Harvey and Paul Deitel's C++ 192 How to Program is the world's best-selling introduction193 to C++ programming. Now, this classic has been thoroughly 194 updated! The new, full-color Third Edition has been 195 completely revised to reflect the ANSI C++ standard, add 196 powerful new coverage of object analysis and design with 197 UML, and give beginning C++ developers even better live 198 code examples and real-world projects. The Deitels' C++ 199 How to Program is the most comprehensive, practical 200 introduction to C++ ever published with hundreds of 201 hands-on exercises, roughly 250 complete programs written 202 and documented for easy learning, and exceptional insight 203 into good programming practices, maximizing performance, 204 avoiding errors, debugging, and testing. This new Third 205 Edition covers every key concept and technique ANSI C++ 206 developers need to master: control structures, functions, 207 arrays, pointers and strings, classes and data 208 abstraction, operator overloading, inheritance, virtual 209 functions, polymorphism, I/O, templates, exception 210 handling, file processing, data structures, and more. It 211 also includes a detailed introduction to Standard 212 Template Library containers, container adapters, 213 algorithms, and iterators. 214 <assign name = "currentOption" expr = "'cplus'"/>215 <goto next = "#repeat"/>216 </block>217 </form>218

Page 44: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline44

main.vxml

219 <form id = "repeat">220 <field name = "confirm" type = "boolean">221 222 <prompt>223 To repeat say yes. Say no, to go back to home.224 </prompt>225 226 <filled>227 <if cond = "confirm == true">228 <goto expr = "'#' + currentOption"/>229 <else/>230 <goto next = "#publication"/>231 </if>232 </filled>233 </field>234 </form> 235 </vxml>

Prompt the user if they want to repeat

Page 45: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline45

main.vxml Program Output

Computer speaks:Welcome to the voice page of Deitel and Associates. To exit any time say exit. To go to the home page any time say home.

User speaks:Home

Computer speaks:You have just entered the Deitel home page. Please make a selection by speaking one of the following options: About us, Driving directions, Publications.

User speaks:Driving directions

Computer speaks:Directions to Deitel and Associates, Inc.We are located on Route 20 in Sudbury,Massachusetts, equidistant from route 128and route 495.To repeat say yes. To go back to home, say no.

Page 46: Csphtp1 24

2002 Prentice Hall. All rights reserved.

46

24.11 Using Voice Synthesizers and Recognition with VoiceXML ™

VoiceXML Tag Description <assign> Assigns a value to a variable.

<block> Presents information to users without any interaction between the user and the computer (i.e., the computer does not expect any input from the user).

<break> Instructs the computer to pause its speech output for a specified period of time.

<choice> Specifies an option in a menu element.

<enumerate> Lists all the available options to the user.

<exit> Exits the program.

<filled> Contains elements that execute when the computer receives input for a form element from the user.

<form> Gathers information from the user for a set of variables.

<goto> Transfers control from one dialog to another.

<grammar> Specifies grammar for the expected input from the user.

<if>, <else>, <elseif>

Indicates a control statement used for making logic decisions.

<link> Performs a transfer of control similar to the goto statement, but a link can be executed at any time during the program’s execution.

<menu> Provides user options and transfers control to other dialogs, on the basis of the selected option.

<prompt> Specifies text to be read to users when they must make a selection.

<subdialog> Calls another dialog. After executing the subdialog, the calling dialog resumes control.

<var> Declares a variable.

<vxml> Top-level tag that specifies that the document should be processed by a VoiceXML interpreter.

Fig. 24.18 VoiceXML tags.

Page 47: Csphtp1 24

2002 Prentice Hall. All rights reserved.

47

24.12 CallML

• Voice technology – Phone-to-web applications

– Text-to-speech engine

– Can support multiple session

Page 48: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline48

hello.xml

Program Output

1 <?xml version = "1.0" encoding = "UTF-8"?>2 3 <!-- Fig. 24.19: hello.xml -->4 <!-- The classic Hello World example -->5 6 <callxml>7 <text>Hello World.</text>8 </callxml>

Declare that content is a CallXML document

Text to be spoken

Logging feature of the Voxeo Account Manager

Page 49: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline49

isbn.xml

1 <?xml version = "1.0" encoding = "UTF-8"?>2 3 <!-- Fig. 24.20: isbn.xml -->4 <!-- Reads the ISBN value of three Deitel books -->5 6 <callxml>7 <block>8 <text>9 Welcome. To obtain the ISBN of the Internet and World10 Wide Web How to Program: Second Edition, please enter 1. 11 To obtain the ISBN of the XML How to Program,12 please enter 2. To obtain the ISBN of the Java How13 to Program: Fourth Edition, please enter 3. To exit the14 application, please enter 4.15 </text>16 17 <!-- Obtains the numeric value entered by the user and -->18 <!-- stores it in the variable ISBN. The user has 60 -->19 <!-- seconds to enter one numeric value -->20 <getDigits var = "ISBN"21 maxDigits = "1"22 termDigits = "1234"23 maxTime = "60s" />24 25 <!-- Requests that the user enter a valid numeric -->26 <!-- value after the elapsed time of 60 seconds -->27 <onMaxSilence>28 <text>29 Please enter either 1, 2, 3 or 4.30 </text>31

Encapsulates other CallXML

getDigits element obtain user’s touch-tone response

Indicate maximum number of digits the application acceptContain list of characters that terminate user input

Maximum amount of time allowed

Invoked when attribute maxTime or maxSilence expires

Ask user to enter a value

Page 50: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline50

isbn.xml

32 <getDigits var = "ISBN"33 termDigits = "1234" 34 maxDigits = "1"35 maxTime = "60s" />36 37 </onMaxSilence>38 39 <onTermDigit value = "1">40 <text>41 The ISBN for the Internet book is 0130308978.42 Thank you for calling our CallXML application.43 Good-bye.44 </text>45 </onTermDigit>46 47 <onTermDigit value = "2">48 <text>49 The ISBN for the XML book is 0130284173.50 Thank you for calling our CallXML application.51 Good-bye.52 </text>53 </onTermDigit>54 55 <onTermDigit value = "3">56 <text>57 The ISBN for the Java book is 0130341517.58 Thank you for calling our CallXML application.59 Good-bye.60 </text>61 </onTermDigit>62

Event handler notify application of appropriate action to perform

Page 51: Csphtp1 24

2002 Prentice Hall.All rights reserved.

Outline51

isbn.xml

Program Output

63 <onTermDigit value = "4">64 <text>65 Thank you for calling our CallXML application.66 Good-bye.67 </text>68 </onTermDigit>69 </block>70 71 <!-- Event handler that terminates the call -->72 <onHangup />73 </callxml>

Terminate the telephone call when the user hangs up

Display the “conversation” between application and user

Page 52: Csphtp1 24

2002 Prentice Hall. All rights reserved.

52

24.12 CallXML™Elements Description assign Assigns a value to a variable, var.

clear Clears the contents of the var attribute.

clearDigits Clears all digits that the user has entered.

goto Navigates to another section of the current CallXML application or to a different CallXML application. The value attribute specifies the URL of the application. The submit attribute lists the variables that are passed to the invoked application. The method attribute states whether to use the HTTP get or post request type when sending and retrieving information. A get request retrieves data from a Web server without modifying the contents, whereas the post request receives modified data.

run Starts a new CallXML session for each call. The value attribute specifies the CallXML application to retrieve. The submit attribute lists the variables that are passed to the invoked application. The method attribute states whether to use the HTTP get or post request type. The var attribute stores the identification number of the session.

sendEvent Allows multiple sessions to exchange messages. The value attribute stores the message, and the session attribute specifies the identification number of the session that receives the message.

answer Answers an incoming telephone call.

call Calls the URL specified by the value attribute. The callerID attribute contains the phone number that is displayed on a CallerID device. The maxTime attribute specifies the length of time to wait for the call to be answered before disconnecting.

conference Connects multiple sessions so that individuals can participate in a conference call. The targetSessions attribute specifies the identification numbers of the sessions, and the termDigits attribute indicates the touch-tone keys that terminate the call.

wait Waits for user input. The value attribute specifies how long to wait. The termDigits attribute indicates the touch-tone keys that terminate the wait element.

play Plays an audio file or a pronounce a value that is stored as a number, date or amount of money and is indicated by the format attribute. The value attribute contains the information (location of the audio file, number, date or amount of money) that corresponds to the format attribute. The clearDigits attribute specifies whether or not to delete the previously entered input. The termDigits attribute indicates the touch-tone keys that terminate the audio file, etc.

recordAudio Records an audio file and stores it at the URL specified by value. The format attribute indicates the file extension of the audio clip. Other attributes include termDigits, clearDigits, maxTime and maxSilence.

Fig. 24.21 CallXML elements.

Page 53: Csphtp1 24

2002 Prentice Hall. All rights reserved.

53

24.13 JAWS for Windows

• Job Access with Sound– Screen reader

– Help people with visual impairments interact with technology

Page 54: Csphtp1 24

2002 Prentice Hall. All rights reserved.

54

24.14 Other Accessibility Tools

• Microsoft’s Active Accessibility– Accessibility aid can retrieve information about application’s

user interface

– Software Development Kit

– Redistribution Kit

• Braille keyboard• Project Ocularis• EagleEyes• Synchronized Multimedia Integration Langauge

Page 55: Csphtp1 24

2002 Prentice Hall. All rights reserved.

55

24.15 Accessibility in Microsoft Windows 2000

• Set accessibility option through Accessibility Wizard for Windows 95 or higher versions

Page 56: Csphtp1 24

2002 Prentice Hall. All rights reserved.

56

24.15 Accessibility in Windows 2000

Fig. 24.22 Display Settings dialog.

Page 57: Csphtp1 24

2002 Prentice Hall. All rights reserved.

57

24.15 Accessibility in Windows 2000

Fig. 24.23 Accessibility Wizard initialization options.

Page 58: Csphtp1 24

2002 Prentice Hall. All rights reserved.

58

24.15.1 Tools for People with Visual Impairments

Fig. 24.24 Scroll Bar and Window Border Size dialog.

Page 59: Csphtp1 24

2002 Prentice Hall. All rights reserved.

59

24.15.1 Tools for People with Visual Impairments

Fig. 24.25 Adjusting up window element sizes.

Page 60: Csphtp1 24

2002 Prentice Hall. All rights reserved.

60

24.15.1 Tools for People with Visual Impairments

Fig. 24.26 Display Color Settings options.

Page 61: Csphtp1 24

2002 Prentice Hall. All rights reserved.

61

24.15.1 Tools for People with Visual Impairments

Fig. 24.27 Accessibility Wizard mouse cursor adjustment tool.

Page 62: Csphtp1 24

2002 Prentice Hall. All rights reserved.

62

24.15.2 Tools for People with Hearing Impairments

Fig. 24.28 SoundSentry dialog.

Page 63: Csphtp1 24

2002 Prentice Hall. All rights reserved.

63

24.15.2 Tools for People with Hearing Impairments

Fig. 24.29 ShowSounds dialog.

Page 64: Csphtp1 24

2002 Prentice Hall. All rights reserved.

64

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.30 StickyKeys window.

Page 65: Csphtp1 24

2002 Prentice Hall. All rights reserved.

65

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.31 BounceKeys dialog.

Page 66: Csphtp1 24

2002 Prentice Hall. All rights reserved.

66

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.32 ToggleKeys window.

Page 67: Csphtp1 24

2002 Prentice Hall. All rights reserved.

67

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.33 Extra Keyboard Help dialog.

Page 68: Csphtp1 24

2002 Prentice Hall. All rights reserved.

68

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.34 MouseKeys window.

Page 69: Csphtp1 24

2002 Prentice Hall. All rights reserved.

69

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.35 Mouse Button Settings window.

Page 70: Csphtp1 24

2002 Prentice Hall. All rights reserved.

70

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.36 Mouse Speed dialog.

Page 71: Csphtp1 24

2002 Prentice Hall. All rights reserved.

71

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.37 Set Automatic Timeouts dialog.

Page 72: Csphtp1 24

2002 Prentice Hall. All rights reserved.

72

24.15.3 Tool for Users who have Difficulty Using the Keyboard

Fig. 24.38 Saving new accessibility settings.

Page 73: Csphtp1 24

2002 Prentice Hall. All rights reserved.

73

24.15.4 Microsoft Narrator

Fig. 24.39 Narrator window.

Page 74: Csphtp1 24

2002 Prentice Hall. All rights reserved.

74

24.15.4 Microsoft Narrator

Fig. 24.40 Voice settings window.

Page 75: Csphtp1 24

2002 Prentice Hall. All rights reserved.

75

24.15.4 Microsoft Narrator

Fig. 24.41 Narrator reading Notepad text.

Page 76: Csphtp1 24

2002 Prentice Hall. All rights reserved.

76

24.15.4 Microsoft On-Screen Keyboard

Fig. 24.42 Microsoft On-Screen Keyboard.

Page 77: Csphtp1 24

2002 Prentice Hall. All rights reserved.

77

24.15.6 Accessibility Features on Internet Explorer 5.5

Fig. 24.43 Microsoft Internet Explorer 5.5’s accessibility options.

Page 78: Csphtp1 24

2002 Prentice Hall. All rights reserved.

78

24.15.6 Accessibility Features on Internet Explorer 5.5

Fig. 24.44 Advanced accessibility settings in Microsoft Internet Explorer 5.5.