AxAdapter Class Reference

A base class for control-specific event handlers that process events controls and emit speech, as appropriate. More...

#include <ax/ax_ui_adaptation.h>

Inheritance diagram for AxAdapter:

AxButtonAdapter AxCheckBoxAdapter AxChoiceAdapter AxComboBoxAdapter AxDialogAdapter AxFrameAdapter AxHtmlWindowAdapter AxHyperlinkCtrlAdapter AxListBoxAdapter AxListCtrlAdapter AxNotebookAdapter AxPanelAdapter AxRadioButtonAdapter AxSliderAdapter AxSpinCtrlAdapter AxStaticTextAdapter AxTextCtrlAdapter AxToggleButtonAdapter AxTreeCtrlAdapter List of all members.

Public Member Functions

 AxAdapter (wxWindow *window=NULL, AxSpeech *speech=NULL)
 ~AxAdapter ()
void Init ()
virtual wxString GetName ()=0
 Override to return the name of the control, e.g. button, listbox.
virtual wxString GetLabel ()
 Override to return the label for the control, e.g. button label or static text before a listbox.
void SetAlternateLabel (const wxString &label)
 Call to set an alternate label for the item, for example for buttons that don't have a speakable label.
const wxString & GetAlternateLabel () const
 Returns the alternate label (see SetAlternateLabel).
virtual wxString GetHelpText ()
 Override to return help on the current control.
virtual wxString GetStateText (AxContentLevel level)=0
 Override to return text representing the state of the control, for example the current value.
virtual wxString GetContent (AxContentLevel level)=0
 Get content.
virtual bool UpdateAppearance (int hints)
 Update the appearance - text size, background, etc.
virtual bool PostUpdateAppearance (int WXUNUSED(hints))
 Called after children have been updated.
virtual wxWindow * GetMainControl () const
 Override this if the adapter's actual window might not be the top-level control (may be the case for composite controls).
virtual bool IsVoiced () const
 Override and return false from this function if the control shouldn't be voiced.
virtual bool DescribeControlContext (bool metaInfo=true, AxContentLevel level=AxContentSummary)
 Describe control current state.
virtual bool DescribeContainerWindow (AxContentLevel level=AxContentSummary)
 Describe this window and all its children.
virtual bool DescribeWindowRecursively (wxWindow *window, AxContentLevel level, wxString &text)
 Get descriptions for this window, recursively.
virtual bool Say (const wxString &text, int flags=AxSpeechFlagsPurge, int verbosity=2)
 Say some text.
virtual bool Say (AxSpeechChannel channel, const wxString &text, int flags=AxSpeechFlagsPurge, int verbosity=2)
 Say some text.
virtual bool StopSpeech (AxSpeechChannel channel=AxSpeechDefaultChannel)
 Stop speaking.
virtual bool PauseOrResumeSpeech (AxSpeechChannel channel=AxSpeechDefaultChannel)
 Pause or resume speech.
virtual bool SkipForward (AxSpeechChannel channel=AxSpeechDefaultChannel)
 Skip forward.
virtual bool SkipBack (AxSpeechChannel channel=AxSpeechDefaultChannel)
 Skip back.
virtual bool IsSpeaking (AxSpeechChannel channel=AxSpeechDefaultChannel) const
 Are we speaking?
virtual bool CanStop (AxSpeechChannel channel=AxSpeechDefaultChannel) const
 Can we stop?
virtual bool CanPause (AxSpeechChannel channel=AxSpeechDefaultChannel) const
 Can we pause?
virtual bool CanResume (AxSpeechChannel channel=AxSpeechDefaultChannel) const
 Can we resume?
void SetSpeech (AxSpeech *speech)
AxSpeechGetSpeech () const
void SetWindow (wxWindow *win)
wxWindow * GetWindow () const
void SetShortcutManager (wxShortcutManager *shortcutManager)
wxShortcutManagerGetShortcutManager () const
void OnKeyDown (wxKeyEvent &event)
void OnChar (wxKeyEvent &event)
void OnIdle (wxIdleEvent &event)
void OnSetFocus (wxFocusEvent &event)
virtual wxString GetStaticLabel ()
 Find a static text control that might describe this control.
virtual wxString GetControlLabel ()
 Get a possible label using wxControl::GetLabel.
virtual AxAdapterFindFocusedAdapter ()
 Get the AxAdapter for the focused control, or if not found, return 'this'.
virtual bool ApplyFontSize ()
 Apply the current font size to the window.
virtual bool ApplyWindowColours ()
 Apply window colours.
void SetChannel (int channel)
 Sets the speech channel to be used by this adapter.
AxSpeechChannel GetChannel (AxSpeechChannel channel=AxSpeechDefaultChannel) const
 Returns the speech channel to be used by this adapter.
void OnDescribeContext (wxCommandEvent &event)
void OnDescribeContainer (wxCommandEvent &event)
void OnStopSpeech (wxCommandEvent &event)
void OnPauseResumeSpeech (wxCommandEvent &event)
void OnSkipForward (wxCommandEvent &event)
void OnSkipBack (wxCommandEvent &event)
void OnContextHelp (wxCommandEvent &event)
void OnSysColourChanged (wxSysColourChangedEvent &event)
void OnGoHome (wxCommandEvent &event)
void OnGoUp (wxCommandEvent &event)

Static Public Member Functions

static bool IsPunctuation (const wxChar &ch)
static bool IsSentenceEnd (const wxChar &ch)
static bool IsWhitespace (const wxChar &ch)
static bool RemoveTrailingPunctuation (wxString &str)
 Remove trailing punctuation.
static bool AddStop (wxString &str, const wxString &punct=wxT("."))
 Add a full stop to the string, unless there's already one there.
static bool AddPause (wxString &str, const wxString &punct=wxT(";"))
 Add a semicolon to the string to create a pause, unless there's already one there.
static wxString GetSpokenTextForKeycode (int keycode)
 Returns a speakable string for the key pressed.

Protected Attributes

wxWindow * m_window
AxSpeechm_speech
wxShortcutManagerm_shortcutManager
AxSpeechChannel m_channel
wxString m_alternateLabel

Detailed Description

A base class for control-specific event handlers that process events controls and emit speech, as appropriate.

AxAdapter also generates shortcut commands from key presses, and provides some utility functions such as Say.


Constructor & Destructor Documentation

AxAdapter::OnDescribeContainer AxAdapter::OnPauseResumeSpeech AxAdapter::OnSkipBack AxAdapter::OnGoUp AxAdapter::AxAdapter ( wxWindow *  window = NULL,
AxSpeech speech = NULL 
)

AxAdapter::~AxAdapter (  ) 


Member Function Documentation

void AxAdapter::Init (  ) 

Reimplemented in AxTextCtrlAdapter, and AxFrameAdapter.

virtual wxString AxAdapter::GetName (  )  [pure virtual]

Override to return the name of the control, e.g. button, listbox.

Implemented in AxTextCtrlAdapter, AxSearchCtrlAdapter, AxDialogAdapter, AxPanelAdapter, AxFrameAdapter, AxStaticTextAdapter, AxStaticBoxAdapter, AxButtonAdapter, AxToggleButtonAdapter, AxCheckBoxAdapter, AxRadioButtonAdapter, AxListBoxAdapter, AxListCtrlAdapter, AxTreeCtrlAdapter, AxComboBoxAdapter, AxChoiceAdapter, AxSpinCtrlAdapter, AxSliderAdapter, AxHtmlWindowAdapter, AxNotebookAdapter, and AxHyperlinkCtrlAdapter.

wxString AxAdapter::GetLabel (  )  [virtual]

Override to return the label for the control, e.g. button label or static text before a listbox.

Reimplemented in AxTextCtrlAdapter, AxDialogAdapter, AxPanelAdapter, AxFrameAdapter, AxStaticTextAdapter, AxButtonAdapter, AxToggleButtonAdapter, AxCheckBoxAdapter, and AxRadioButtonAdapter.

void AxAdapter::SetAlternateLabel ( const wxString &  label  )  [inline]

Call to set an alternate label for the item, for example for buttons that don't have a speakable label.

If the stored label is empty, the existing label will be used or deduced from a static control nearby.

const wxString& AxAdapter::GetAlternateLabel (  )  const [inline]

Returns the alternate label (see SetAlternateLabel).

wxString AxAdapter::GetHelpText (  )  [virtual]

Override to return help on the current control.

By default, wxWindow::GetHelpText is used.

virtual wxString AxAdapter::GetStateText ( AxContentLevel  level  )  [pure virtual]

Override to return text representing the state of the control, for example the current value.

Implemented in AxTextCtrlAdapter, AxSearchCtrlAdapter, AxDialogAdapter, AxFrameAdapter, AxButtonAdapter, AxToggleButtonAdapter, AxCheckBoxAdapter, AxRadioButtonAdapter, AxListBoxAdapter, AxListCtrlAdapter, AxTreeCtrlAdapter, AxComboBoxAdapter, AxChoiceAdapter, AxSpinCtrlAdapter, AxSliderAdapter, AxHtmlWindowAdapter, AxNotebookAdapter, and AxHyperlinkCtrlAdapter.

virtual wxString AxAdapter::GetContent ( AxContentLevel  level  )  [pure virtual]

Get content.

Implemented in AxTextCtrlAdapter, AxSearchCtrlAdapter, AxDialogAdapter, AxFrameAdapter, AxButtonAdapter, AxToggleButtonAdapter, AxCheckBoxAdapter, AxRadioButtonAdapter, AxListBoxAdapter, AxListCtrlAdapter, AxTreeCtrlAdapter, AxComboBoxAdapter, AxChoiceAdapter, AxSpinCtrlAdapter, AxSliderAdapter, AxHtmlWindowAdapter, AxNotebookAdapter, and AxHyperlinkCtrlAdapter.

bool AxAdapter::UpdateAppearance ( int  hints  )  [virtual]

Update the appearance - text size, background, etc.

By default, update the font.

Reimplemented in AxTextCtrlAdapter, and AxButtonAdapter.

virtual bool AxAdapter::PostUpdateAppearance ( int   WXUNUSED(hints)  )  [inline, virtual]

Called after children have been updated.

virtual wxWindow* AxAdapter::GetMainControl (  )  const [inline, virtual]

Override this if the adapter's actual window might not be the top-level control (may be the case for composite controls).

Reimplemented in AxSearchCtrlAdapter.

virtual bool AxAdapter::IsVoiced (  )  const [inline, virtual]

Override and return false from this function if the control shouldn't be voiced.

Reimplemented in AxPanelAdapter, and AxStaticTextAdapter.

bool AxAdapter::DescribeControlContext ( bool  metaInfo = true,
AxContentLevel  level = AxContentSummary 
) [virtual]

Describe control current state.

If metaInfo is true, describes the kind of control it is. This is a default implementation that can be overridden to give more specific detail.

bool AxAdapter::DescribeContainerWindow ( AxContentLevel  level = AxContentSummary  )  [virtual]

Describe this window and all its children.

bool AxAdapter::DescribeWindowRecursively ( wxWindow *  window,
AxContentLevel  level,
wxString &  text 
) [virtual]

Get descriptions for this window, recursively.

Only describe visible windows.

bool AxAdapter::Say ( const wxString &  text,
int  flags = AxSpeechFlagsPurge,
int  verbosity = 2 
) [virtual]

Say some text.

bool AxAdapter::Say ( AxSpeechChannel  channel,
const wxString &  text,
int  flags = AxSpeechFlagsPurge,
int  verbosity = 2 
) [virtual]

Say some text.

bool AxAdapter::StopSpeech ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  [virtual]

Stop speaking.

bool AxAdapter::PauseOrResumeSpeech ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  [virtual]

Pause or resume speech.

bool AxAdapter::SkipForward ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  [virtual]

Skip forward.

bool AxAdapter::SkipBack ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  [virtual]

Skip back.

bool AxAdapter::IsSpeaking ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  const [virtual]

Are we speaking?

bool AxAdapter::CanStop ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  const [virtual]

Can we stop?

bool AxAdapter::CanPause ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  const [virtual]

Can we pause?

bool AxAdapter::CanResume ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  const [virtual]

Can we resume?

void AxAdapter::SetSpeech ( AxSpeech speech  )  [inline]

AxSpeech* AxAdapter::GetSpeech (  )  const [inline]

void AxAdapter::SetWindow ( wxWindow *  win  )  [inline]

wxWindow* AxAdapter::GetWindow (  )  const [inline]

void AxAdapter::SetShortcutManager ( wxShortcutManager shortcutManager  )  [inline]

wxShortcutManager* AxAdapter::GetShortcutManager (  )  const [inline]

void AxAdapter::OnKeyDown ( wxKeyEvent &  event  ) 

void AxAdapter::OnChar ( wxKeyEvent &  event  ) 

void AxAdapter::OnIdle ( wxIdleEvent &  event  ) 

void AxAdapter::OnSetFocus ( wxFocusEvent &  event  ) 

bool AxAdapter::IsPunctuation ( const wxChar &  ch  )  [static]

bool AxAdapter::IsSentenceEnd ( const wxChar &  ch  )  [static]

bool AxAdapter::IsWhitespace ( const wxChar &  ch  )  [static]

bool AxAdapter::RemoveTrailingPunctuation ( wxString &  str  )  [static]

Remove trailing punctuation.

bool AxAdapter::AddStop ( wxString &  str,
const wxString &  punct = wxT(".") 
) [static]

Add a full stop to the string, unless there's already one there.

Remove extra punctuation, e.g. semicolon.

bool AxAdapter::AddPause ( wxString &  str,
const wxString &  punct = wxT(";") 
) [static]

Add a semicolon to the string to create a pause, unless there's already one there.

Remove extra punctuation.

wxString AxAdapter::GetSpokenTextForKeycode ( int  keycode  )  [static]

Returns a speakable string for the key pressed.

wxString AxAdapter::GetStaticLabel (  )  [virtual]

Find a static text control that might describe this control.

wxString AxAdapter::GetControlLabel (  )  [virtual]

Get a possible label using wxControl::GetLabel.

AxAdapter * AxAdapter::FindFocusedAdapter (  )  [virtual]

Get the AxAdapter for the focused control, or if not found, return 'this'.

bool AxAdapter::ApplyFontSize (  )  [virtual]

Apply the current font size to the window.

bool AxAdapter::ApplyWindowColours (  )  [virtual]

Apply window colours.

Reimplemented in AxDialogAdapter, AxPanelAdapter, AxFrameAdapter, AxStaticTextAdapter, AxCheckBoxAdapter, AxRadioButtonAdapter, AxNotebookAdapter, and AxHyperlinkCtrlAdapter.

void AxAdapter::SetChannel ( int  channel  )  [inline]

Sets the speech channel to be used by this adapter.

AxSpeechChannel AxAdapter::GetChannel ( AxSpeechChannel  channel = AxSpeechDefaultChannel  )  const

Returns the speech channel to be used by this adapter.

void AxAdapter::OnDescribeContext ( wxCommandEvent &  event  ) 

Reimplemented in AxTextCtrlAdapter.

void AxAdapter::OnDescribeContainer ( wxCommandEvent &  event  ) 

void AxAdapter::OnStopSpeech ( wxCommandEvent &  event  ) 

void AxAdapter::OnPauseResumeSpeech ( wxCommandEvent &  event  ) 

void AxAdapter::OnSkipForward ( wxCommandEvent &  event  ) 

void AxAdapter::OnSkipBack ( wxCommandEvent &  event  ) 

void AxAdapter::OnContextHelp ( wxCommandEvent &  event  ) 

void AxAdapter::OnSysColourChanged ( wxSysColourChangedEvent &  event  ) 

void AxAdapter::OnGoHome ( wxCommandEvent &  event  ) 

void AxAdapter::OnGoUp ( wxCommandEvent &  event  ) 


Member Data Documentation

wxWindow* AxAdapter::m_window [protected]

AxSpeech* AxAdapter::m_speech [protected]

wxShortcutManager* AxAdapter::m_shortcutManager [protected]

AxSpeechChannel AxAdapter::m_channel [protected]

wxString AxAdapter::m_alternateLabel [protected]


The documentation for this class was generated from the following files:
Generated on Wed May 6 19:20:20 2009 for AxTk by  doxygen 1.5.1