AxAdapter Class Reference
[Basic AxTk UI classes]

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

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.

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::ApplyFontSize (  )  [virtual]

Apply the current font size to the window.

bool AxAdapter::ApplyWindowColours (  )  [virtual]

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

Can we pause?

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

Can we resume?

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

Can we stop?

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

Describe this window and all its children.

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::DescribeWindowRecursively ( wxWindow *  window,
AxContentLevel  level,
wxString &  text 
) [virtual]

Get descriptions for this window, recursively.

Only describe visible windows.

AxAdapter * AxAdapter::FindFocusedAdapter (  )  [virtual]

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

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

Returns the alternate label (see SetAlternateLabel).

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

Returns the speech channel to be used by this adapter.

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

wxString AxAdapter::GetControlLabel (  )  [virtual]

Get a possible label using wxControl::GetLabel.

wxString AxAdapter::GetHelpText (  )  [virtual]

Override to return help on the current control.

By default, wxWindow::GetHelpText is used.

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.

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 wxString AxAdapter::GetName (  )  [pure virtual]

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

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

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

Returns a speakable string for the key pressed.

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

wxString AxAdapter::GetStaticLabel (  )  [virtual]

Find a static text control that might describe this control.

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

void AxAdapter::Init (  ) 

Reimplemented in AxTextCtrlAdapter, and AxFrameAdapter.

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

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

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

Are we speaking?

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::IsWhitespace ( const wxChar &  ch  )  [static]

void AxAdapter::OnChar ( wxKeyEvent &  event  ) 

void AxAdapter::OnContextHelp ( wxCommandEvent &  event  ) 

void AxAdapter::OnDescribeContainer ( wxCommandEvent &  event  ) 

void AxAdapter::OnDescribeContext ( wxCommandEvent &  event  ) 

Reimplemented in AxTextCtrlAdapter.

void AxAdapter::OnGoHome ( wxCommandEvent &  event  ) 

void AxAdapter::OnGoUp ( wxCommandEvent &  event  ) 

void AxAdapter::OnIdle ( wxIdleEvent &  event  ) 

void AxAdapter::OnKeyDown ( wxKeyEvent &  event  ) 

void AxAdapter::OnPauseResumeSpeech ( wxCommandEvent &  event  ) 

void AxAdapter::OnSetFocus ( wxFocusEvent &  event  ) 

void AxAdapter::OnSkipBack ( wxCommandEvent &  event  ) 

void AxAdapter::OnSkipForward ( wxCommandEvent &  event  ) 

void AxAdapter::OnStopSpeech ( wxCommandEvent &  event  ) 

void AxAdapter::OnSysColourChanged ( wxSysColourChangedEvent &  event  ) 

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

Pause or resume speech.

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

Called after children have been updated.

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

Remove trailing punctuation.

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

Say some text.

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

Say some text.

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.

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

Sets the speech channel to be used by this adapter.

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

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

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

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

Skip back.

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

Skip forward.

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

Stop speaking.

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

Update the appearance - text size, background, etc.

By default, update the font.

Reimplemented in AxTextCtrlAdapter, and AxButtonAdapter.


Member Data Documentation

wxString AxAdapter::m_alternateLabel [protected]

wxWindow* AxAdapter::m_window [protected]


The documentation for this class was generated from the following files:

Generated on Wed May 6 19:22:06 2009 for AxTk by  doxygen 1.5.8