include/tts/tts_custompronunciationdialog.h

Go to the documentation of this file.
00001 
00002 // Name:        custompronunciationdialog.h
00003 // Purpose:     
00004 // Author:      Julian Smart
00005 // Modified by: 
00006 // Created:     11/02/2009 20:01:56
00007 // RCS-ID:      
00008 // Copyright:   (c) Anthemion Software Limited
00009 // Licence:     New BSD License
00011 
00012 #ifndef _CUSTOMPRONUNCIATIONDIALOG_H_
00013 #define _CUSTOMPRONUNCIATIONDIALOG_H_
00014 
00015 /*
00016  * Includes
00017  */
00018 
00020 #include "wx/html/htmlwin.h"
00022 
00023 #include "tts/tts.h"
00024 
00025 /*
00026  * Forward declarations
00027  */
00028 
00030 class wxBoxSizer;
00031 class wxTTSHtmlWindow;
00033 
00034 /*
00035  * Control identifiers
00036  */
00037 
00039 #define SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
00040 #define SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_TITLE _("Custom Pronunciations")
00041 #define SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_IDNAME ID_CUSTOMPRONUNCIATIONDIALOG
00042 #define SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_SIZE wxSize(400, 300)
00043 #define SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_POSITION wxDefaultPosition
00045 
00046 // An HTML window
00047 class wxTTSHtmlWindow: public wxHtmlWindow
00048 {
00049 public:
00050     wxTTSHtmlWindow(wxWindow* parent, wxWindowID id,
00051         const wxPoint& pos, const wxSize& size, long style);
00052 
00053     virtual void OnLinkClicked(const wxHtmlLinkInfo& info);
00054     void ShowDisabled();
00055 
00056     bool ScrollToAnchor(const wxString& anchor);
00057 
00058 protected:
00059 };
00060 
00067 class wxTTSCustomPronunciationDialog: public wxDialog
00068 {    
00069     DECLARE_DYNAMIC_CLASS( wxTTSCustomPronunciationDialog )
00070     DECLARE_EVENT_TABLE()
00071 
00072 public:
00074     wxTTSCustomPronunciationDialog();
00075     wxTTSCustomPronunciationDialog( wxTTSTransformer* transformer, wxWindow* parent, wxWindowID id = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_IDNAME, const wxString& caption = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_POSITION, const wxSize& size = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_SIZE, long style = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_STYLE );
00076 
00078     bool Create( wxTTSTransformer* transformer, wxWindow* parent, wxWindowID id = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_IDNAME, const wxString& caption = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_POSITION, const wxSize& size = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_SIZE, long style = SYMBOL_WXTTSCUSTOMPRONUNCIATIONDIALOG_STYLE );
00079 
00081     ~wxTTSCustomPronunciationDialog();
00082 
00084     void Init();
00085 
00087     void CreateControls();
00088 
00090     void FillWordList();
00091 
00093     void ShowWord(int i);
00094 
00096     wxTextToSpeech* GetSpeech() const { return m_speech; }
00097     
00099     void SetSpeech(wxTextToSpeech* speech) { m_speech = speech; }
00100 
00102     static void SetShowToolTips(bool show) { m_showToolTips = show; }
00103     static bool GetShowToolTips() { return m_showToolTips; }
00104     
00106 
00108     void OnCustomWordListboxSelected( wxCommandEvent& event );
00109 
00111     void OnAddCustomWordClick( wxCommandEvent& event );
00112 
00114     void OnRemoveCustomWordClick( wxCommandEvent& event );
00115 
00117     void OnRemoveCustomWordUpdate( wxUpdateUIEvent& event );
00118 
00120     void OnCustomWordUpdate( wxUpdateUIEvent& event );
00121 
00123     void OnCustomWordSayClick( wxCommandEvent& event );
00124 
00126     void OnCustomWordSayUpdate( wxUpdateUIEvent& event );
00127 
00129     void OnCustomReplacementTextUpdated( wxCommandEvent& event );
00130 
00132     void OnCustomReplacementUpdate( wxUpdateUIEvent& event );
00133 
00135     void OnCustomReplacementSayClick( wxCommandEvent& event );
00136 
00138     void OnCustomReplacementSayUpdate( wxUpdateUIEvent& event );
00139 
00141 
00143 
00145     wxBitmap GetBitmapResource( const wxString& name );
00146 
00148     wxIcon GetIconResource( const wxString& name );
00150 
00152     static bool ShowToolTips();
00153 
00155     wxBoxSizer* m_innerSizer;
00156     wxListBox* m_wordListCtrl;
00157     wxTextCtrl* m_customWordCtrl;
00158     wxTextCtrl* m_replacementWordCtrl;
00159     wxTTSHtmlWindow* m_htmlWindow;
00161     enum {
00162         ID_CUSTOMPRONUNCIATIONDIALOG = 22700,
00163         ID_CUSTOM_WORD_LISTBOX = 22701,
00164         ID_ADD_CUSTOM_WORD = 22702,
00165         ID_REMOVE_CUSTOM_WORD = 22703,
00166         ID_CUSTOM_WORD = 22704,
00167         ID_CUSTOM_WORD_SAY = 22705,
00168         ID_CUSTOM_REPLACEMENT = 22706,
00169         ID_CUSTOM_REPLACEMENT_SAY = 22707,
00170         ID_CUSTOM_PRONUNCIATION_HTMLWINDOW = 22708
00171     };
00173 
00174     wxTTSTransformer*           m_transformer;
00175     bool                        m_ignoreEvents;
00176     wxTextToSpeech*             m_speech;
00177     static bool                 m_showToolTips;
00178 };
00179 
00180 #endif
00181     // _CUSTOMPRONUNCIATIONDIALOG_H_

Generated on Wed May 6 19:20:19 2009 for AxTk by  doxygen 1.5.1