From 28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:20:30 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kttsd/filters/sbd/sbdconf.cpp | 124 ++++++++++++------------ kttsd/filters/sbd/sbdconf.h | 12 +-- kttsd/filters/sbd/sbdproc.cpp | 214 +++++++++++++++++++++--------------------- kttsd/filters/sbd/sbdproc.h | 118 +++++++++++------------ 4 files changed, 234 insertions(+), 234 deletions(-) (limited to 'kttsd/filters/sbd') diff --git a/kttsd/filters/sbd/sbdconf.cpp b/kttsd/filters/sbd/sbdconf.cpp index 2d4cf5d..5244974 100644 --- a/kttsd/filters/sbd/sbdconf.cpp +++ b/kttsd/filters/sbd/sbdconf.cpp @@ -22,14 +22,14 @@ ******************************************************************************/ // Qt includes. -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include // KDE includes. #include @@ -56,13 +56,13 @@ /** * Constructor */ -SbdConf::SbdConf( QWidget *parent, const char *name, const QStringList& /*args*/) : +SbdConf::SbdConf( TQWidget *parent, const char *name, const TQStringList& /*args*/) : KttsFilterConf(parent, name) { // kdDebug() << "SbdConf::SbdConf: Running" << endl; // Create configuration widget. - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "SbdConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new SbdConfWidget(this, "SbdConfigWidget"); @@ -73,24 +73,24 @@ SbdConf::SbdConf( QWidget *parent, const char *name, const QStringList& /*args*/ m_widget->reButton->setEnabled( m_reEditorInstalled ); if ( m_reEditorInstalled ) - connect( m_widget->reButton, SIGNAL(clicked()), this, SLOT(slotReButton_clicked()) ); + connect( m_widget->reButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReButton_clicked()) ); - connect( m_widget->reLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); - connect( m_widget->sbLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); - connect( m_widget->nameLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); - connect( m_widget->appIdLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged()) ); - connect(m_widget->languageBrowseButton, SIGNAL(clicked()), - this, SLOT(slotLanguageBrowseButton_clicked())); - connect(m_widget->loadButton, SIGNAL(clicked()), - this, SLOT(slotLoadButton_clicked())); - connect(m_widget->saveButton, SIGNAL(clicked()), - this, SLOT(slotSaveButton_clicked())); - connect(m_widget->clearButton, SIGNAL(clicked()), - this, SLOT(slotClearButton_clicked())); + connect( m_widget->reLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); + connect( m_widget->sbLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); + connect( m_widget->nameLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); + connect( m_widget->appIdLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged()) ); + connect(m_widget->languageBrowseButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLanguageBrowseButton_clicked())); + connect(m_widget->loadButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLoadButton_clicked())); + connect(m_widget->saveButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSaveButton_clicked())); + connect(m_widget->clearButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotClearButton_clicked())); // Set up defaults. defaults(); @@ -116,7 +116,7 @@ SbdConf::~SbdConf(){ * @param configGroup Call config->setGroup with this argument before * loading your configuration. */ -void SbdConf::load(KConfig* config, const QString& configGroup){ +void SbdConf::load(KConfig* config, const TQString& configGroup){ // kdDebug() << "SbdConf::load: Running" << endl; config->setGroup( configGroup ); m_widget->nameLineEdit->setText( @@ -125,10 +125,10 @@ void SbdConf::load(KConfig* config, const QString& configGroup){ config->readEntry("SentenceDelimiterRegExp", m_widget->reLineEdit->text()) ); m_widget->sbLineEdit->setText( config->readEntry("SentenceBoundary", m_widget->sbLineEdit->text()) ); - QStringList langCodeList = config->readListEntry("LanguageCodes"); + TQStringList langCodeList = config->readListEntry("LanguageCodes"); if (!langCodeList.isEmpty()) m_languageCodeList = langCodeList; - QString language = ""; + TQString language = ""; for ( uint ndx=0; ndx < m_languageCodeList.count(); ++ndx) { if (!language.isEmpty()) language += ","; @@ -149,7 +149,7 @@ void SbdConf::load(KConfig* config, const QString& configGroup){ * @param configGroup Call config->setGroup with this argument before * saving your configuration. */ -void SbdConf::save(KConfig* config, const QString& configGroup){ +void SbdConf::save(KConfig* config, const TQString& configGroup){ // kdDebug() << "SbdConf::save: Running" << endl; config->setGroup( configGroup ); config->writeEntry("UserFilterName", m_widget->nameLineEdit->text() ); @@ -192,10 +192,10 @@ bool SbdConf::supportsMultiInstance() { return true; } * return an empty string. * @return Filter instance name. */ -QString SbdConf::userPlugInName() +TQString SbdConf::userPlugInName() { if ( m_widget->reLineEdit->text().isEmpty() ) - return QString::null; + return TQString::null; else return m_widget->nameLineEdit->text(); } @@ -210,8 +210,8 @@ void SbdConf::slotReButton_clicked() { // Show Regular Expression Editor dialog if it is installed. if ( !m_reEditorInstalled ) return; - QDialog *editorDialog = - KParts::ComponentFactory::createInstanceFromQuery( "KRegExpEditor/KRegExpEditor" ); + TQDialog *editorDialog = + KParts::ComponentFactory::createInstanceFromQuery( "KRegExpEditor/KRegExpEditor" ); if ( editorDialog ) { // kdeutils was installed, so the dialog was found. Fetch the editor interface. @@ -220,9 +220,9 @@ void SbdConf::slotReButton_clicked() Q_ASSERT( reEditor ); // This should not fail!// now use the editor. reEditor->setRegExp( m_widget->reLineEdit->text() ); int dlgResult = editorDialog->exec(); - if ( dlgResult == QDialog::Accepted ) + if ( dlgResult == TQDialog::Accepted ) { - QString re = reEditor->regExp(); + TQString re = reEditor->regExp(); m_widget->reLineEdit->setText( re ); configChanged(); } @@ -232,21 +232,21 @@ void SbdConf::slotReButton_clicked() void SbdConf::slotLanguageBrowseButton_clicked() { - // Create a QHBox to host KListView. - QHBox* hBox = new QHBox(m_widget, "SelectLanguage_hbox"); + // Create a TQHBox to host KListView. + TQHBox* hBox = new TQHBox(m_widget, "SelectLanguage_hbox"); // Create a KListView and fill with all known languages. KListView* langLView = new KListView(hBox, "SelectLanguage_lview"); langLView->addColumn(i18n("Language")); langLView->addColumn(i18n("Code")); - langLView->setSelectionMode(QListView::Extended); - QStringList allLocales = KGlobal::locale()->allLanguagesTwoAlpha(); - QString locale; - QString languageCode; - QString countryCode; - QString charSet; - QString language; + langLView->setSelectionMode(TQListView::Extended); + TQStringList allLocales = KGlobal::locale()->allLanguagesTwoAlpha(); + TQString locale; + TQString languageCode; + TQString countryCode; + TQString charSet; + TQString language; // Blank line so user can select no language. - QListViewItem* item = new KListViewItem(langLView, "", ""); + TQListViewItem* item = new KListViewItem(langLView, "", ""); if (m_languageCodeList.isEmpty()) item->setSelected(true); const int allLocalesCount = allLocales.count(); for (int ndx=0; ndx < allLocalesCount; ++ndx) @@ -256,7 +256,7 @@ void SbdConf::slotLanguageBrowseButton_clicked() language = KGlobal::locale()->twoAlphaToLanguageName(languageCode); if (!countryCode.isEmpty()) language += " (" + KGlobal::locale()->twoAlphaToCountryName(countryCode)+")"; - QListViewItem* item = new KListViewItem(langLView, language, locale); + TQListViewItem* item = new KListViewItem(langLView, language, locale); if (m_languageCodeList.contains(locale)) item->setSelected(true); } // Sort by language. @@ -274,13 +274,13 @@ void SbdConf::slotLanguageBrowseButton_clicked() true); dlg->setMainWidget(hBox); dlg->setHelp("", "kttsd"); - dlg->setInitialSize(QSize(300, 500), false); + dlg->setInitialSize(TQSize(300, 500), false); int dlgResult = dlg->exec(); - languageCode = QString::null; - if (dlgResult == QDialog::Accepted) + languageCode = TQString::null; + if (dlgResult == TQDialog::Accepted) { m_languageCodeList.clear(); - QListViewItem* item = langLView->firstChild(); + TQListViewItem* item = langLView->firstChild(); while (item) { if (item->isSelected()) m_languageCodeList += item->text(1); @@ -289,7 +289,7 @@ void SbdConf::slotLanguageBrowseButton_clicked() } delete dlg; // TODO: Also delete KListView and QHBox? - if (dlgResult != QDialog::Accepted) return; + if (dlgResult != TQDialog::Accepted) return; language = ""; for ( uint ndx=0; ndx < m_languageCodeList.count(); ++ndx) { @@ -302,9 +302,9 @@ void SbdConf::slotLanguageBrowseButton_clicked() void SbdConf::slotLoadButton_clicked() { - // QString dataDir = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/stringreplacer/"; - QString dataDir = KGlobal::dirs()->findAllResources("data", "kttsd/sbd/").last(); - QString filename = KFileDialog::getOpenFileName( + // TQString dataDir = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/stringreplacer/"; + TQString dataDir = KGlobal::dirs()->findAllResources("data", "kttsd/sbd/").last(); + TQString filename = KFileDialog::getOpenFileName( dataDir, "*rc|SBD Config (*rc)", m_widget, @@ -318,7 +318,7 @@ void SbdConf::slotLoadButton_clicked() void SbdConf::slotSaveButton_clicked() { - QString filename = KFileDialog::getSaveFileName( + TQString filename = KFileDialog::getSaveFileName( KGlobal::dirs()->saveLocation( "data" ,"kttsd/sbd/", false ), "*rc|SBD Config (*rc)", m_widget, @@ -331,11 +331,11 @@ void SbdConf::slotSaveButton_clicked() void SbdConf::slotClearButton_clicked() { - m_widget->nameLineEdit->setText( QString::null ); - m_widget->reLineEdit->setText( QString::null ); - m_widget->sbLineEdit->setText( QString::null ); + m_widget->nameLineEdit->setText( TQString::null ); + m_widget->reLineEdit->setText( TQString::null ); + m_widget->sbLineEdit->setText( TQString::null ); m_languageCodeList.clear(); - m_widget->languageLineEdit->setText( QString::null ); - m_widget->appIdLineEdit->setText( QString::null ); + m_widget->languageLineEdit->setText( TQString::null ); + m_widget->appIdLineEdit->setText( TQString::null ); configChanged(); } diff --git a/kttsd/filters/sbd/sbdconf.h b/kttsd/filters/sbd/sbdconf.h index 131a759..eb1b817 100644 --- a/kttsd/filters/sbd/sbdconf.h +++ b/kttsd/filters/sbd/sbdconf.h @@ -25,7 +25,7 @@ #define _SBDCONF_H_ // Qt includes. -#include +#include // KDE includes. #include @@ -48,7 +48,7 @@ class SbdConf : public KttsFilterConf /** * Constructor */ - SbdConf( QWidget *parent, const char *name, const QStringList &args = QStringList() ); + SbdConf( TQWidget *parent, const char *name, const TQStringList &args = TQStringList() ); /** * Destructor @@ -73,7 +73,7 @@ class SbdConf : public KttsFilterConf * any instance-specific parameters to load, but it may still wish * to load parameters that apply to all instances of the plugin. */ - virtual void load(KConfig *config, const QString &configGroup); + virtual void load(KConfig *config, const TQString &configGroup); /** * This function gets called when the user wants to save the settings in @@ -85,7 +85,7 @@ class SbdConf : public KttsFilterConf * @param configGroup Call config->setGroup with this argument before * saving your configuration. */ - virtual void save(KConfig *config, const QString &configGroup); + virtual void save(KConfig *config, const TQString &configGroup); /** * This function is called to set the settings in the module to sensible @@ -111,7 +111,7 @@ class SbdConf : public KttsFilterConf * return an empty string. * @return Filter instance name. */ - virtual QString userPlugInName(); + virtual TQString userPlugInName(); /** * Returns True if this filter is a Sentence Boundary Detector. @@ -133,7 +133,7 @@ class SbdConf : public KttsFilterConf // True if kdeutils Regular Expression Editor is installed. bool m_reEditorInstalled; // Language Code. - QStringList m_languageCodeList; + TQStringList m_languageCodeList; }; #endif //_SBDCONF_H_ diff --git a/kttsd/filters/sbd/sbdproc.cpp b/kttsd/filters/sbd/sbdproc.cpp index cdc80d9..6117b11 100644 --- a/kttsd/filters/sbd/sbdproc.cpp +++ b/kttsd/filters/sbd/sbdproc.cpp @@ -22,9 +22,9 @@ ******************************************************************************/ // Qt includes. -#include -#include -#include +#include +#include +#include // KDE includes. #include @@ -41,9 +41,9 @@ /** * Constructor. */ -SbdThread::SbdThread( QObject *parent, const char *name ) : - QObject( parent, name ), - QThread() +SbdThread::SbdThread( TQObject *parent, const char *name ) : + TQObject( parent, name ), + TQThread() { } @@ -57,8 +57,8 @@ SbdThread::SbdThread( QObject *parent, const char *name ) : /** * Get/Set text being processed. */ -void SbdThread::setText( const QString& text ) { m_text = text; } -QString SbdThread::text() { return m_text; } +void SbdThread::setText( const TQString& text ) { m_text = text; } +TQString SbdThread::text() { return m_text; } /** * Set/Get TalkerCode. @@ -72,14 +72,14 @@ TalkerCode* SbdThread::talkerCode() { return m_talkerCode; } * * @param re The sentence delimiter regular expression. */ -void SbdThread::setSbRegExp( const QString& re ) { m_re = re; } +void SbdThread::setSbRegExp( const TQString& re ) { m_re = re; } /** * The configured Sentence Boundary Regular Expression. * * @param re The sentence delimiter regular expression. */ -void SbdThread::setConfiguredSbRegExp( const QString& re ) { m_configuredRe = re; } +void SbdThread::setConfiguredSbRegExp( const TQString& re ) { m_configuredRe = re; } /** * The configured Sentence Boundary that replaces SB regular expression. @@ -87,7 +87,7 @@ void SbdThread::setConfiguredSbRegExp( const QString& re ) { m_configuredRe = re * @param sb The sentence boundary replacement. * */ -void SbdThread::setConfiguredSentenceBoundary( const QString& sb ) { m_configuredSentenceBoundary = sb; } +void SbdThread::setConfiguredSentenceBoundary( const TQString& sb ) { m_configuredSentenceBoundary = sb; } /** * Did this filter do anything? If the filter returns the input as output @@ -97,7 +97,7 @@ void SbdThread::setWasModified(bool wasModified) { m_wasModified = wasModified; bool SbdThread::wasModified() { return m_wasModified; } // Given a tag name, returns SsmlElemType. -SbdThread::SsmlElemType SbdThread::tagToSsmlElemType( const QString tagName ) +SbdThread::SsmlElemType SbdThread::tagToSsmlElemType( const TQString tagName ) { if ( tagName == "speak" ) return etSpeak; if ( tagName == "voice" ) return etVoice; @@ -110,12 +110,12 @@ SbdThread::SsmlElemType SbdThread::tagToSsmlElemType( const QString tagName ) } // Parses an SSML element, pushing current settings onto the context stack. -void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) +void SbdThread::pushSsmlElem( SsmlElemType et, const TQDomElement& elem ) { // TODO: Need to convert relative values into absolute values and also convert // only to values recognized by SSML2SABLE stylesheet. Either that or enhance all // the synth stylesheets. - QDomNamedNodeMap attrList = elem.attributes(); + TQDomNamedNodeMap attrList = elem.attributes(); int attrCount = attrList.count(); switch ( et ) { @@ -123,7 +123,7 @@ void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) SpeakElem e = m_speakStack.top(); for ( int ndx=0; ndx < attrCount; ++ndx ) { - QDomAttr a = attrList.item( ndx ).toAttr(); + TQDomAttr a = attrList.item( ndx ).toAttr(); if ( a.name() == "lang" ) e.lang = a.value(); } m_speakStack.push( e ); @@ -139,7 +139,7 @@ void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) ProsodyElem e = m_prosodyStack.top(); for ( int ndx=0; ndx < attrCount; ++ndx ) { - QDomAttr a = attrList.item( ndx ).toAttr(); + TQDomAttr a = attrList.item( ndx ).toAttr(); if ( a.name() == "pitch" ) e.pitch = a.value(); if ( a.name() == "contour" ) e.contour = a.value(); if ( a.name() == "range" ) e.range = a.value(); @@ -153,7 +153,7 @@ void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) EmphasisElem e = m_emphasisStack.top(); for ( int ndx=0; ndx < attrCount; ++ndx ) { - QDomAttr a = attrList.item( ndx ).toAttr(); + TQDomAttr a = attrList.item( ndx ).toAttr(); if ( a.name() == "level" ) e.level = a.value(); } m_emphasisStack.push( e ); @@ -162,7 +162,7 @@ void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) PSElem e = m_psStack.top(); for ( int ndx=0; ndx < attrCount; ++ndx ) { - QDomAttr a = attrList.item( ndx ).toAttr(); + TQDomAttr a = attrList.item( ndx ).toAttr(); if ( a.name() == "lang" ) e.lang = a.value(); } m_psStack.push( e ); @@ -173,17 +173,17 @@ void SbdThread::pushSsmlElem( SsmlElemType et, const QDomElement& elem ) // Given an attribute name and value, constructs an XML representation of the attribute, // i.e., name="value". -QString SbdThread::makeAttr( const QString& name, const QString& value ) +TQString SbdThread::makeAttr( const TQString& name, const TQString& value ) { - if ( value.isEmpty() ) return QString::null; + if ( value.isEmpty() ) return TQString::null; return " " + name + "=\"" + value + "\""; } // Returns an XML representation of an SSML tag from the top of the context stack. -QString SbdThread::makeSsmlElem( SsmlElemType et ) +TQString SbdThread::makeSsmlElem( SsmlElemType et ) { - QString s; - QString a; + TQString s; + TQString a; switch ( et ) { // Must always output speak tag, otherwise kttsd won't think each sentence is SSML. @@ -198,7 +198,7 @@ QString SbdThread::makeSsmlElem( SsmlElemType et ) VoiceElem e = m_voiceStack.top(); a += makeAttr( "lang", e.lang ); a += makeAttr( "gender", e.gender ); - a += makeAttr( "age", QString::number(e.age) ); + a += makeAttr( "age", TQString::number(e.age) ); a += makeAttr( "name", e.name ); a += makeAttr( "variant", e.variant ); if ( !a.isEmpty() ) s = ""; @@ -240,14 +240,14 @@ void SbdThread::popSsmlElem( SsmlElemType et ) } // Returns an XML representation of a break element. -QString SbdThread::makeBreakElem( const QDomElement& e ) +TQString SbdThread::makeBreakElem( const TQDomElement& e ) { - QString s = "setGroup( configGroup ); // m_configuredRe = config->readEntry( "SentenceDelimiterRegExp", "([\\.\\?\\!\\:\\;])\\s|(\\n *\\n)" ); m_configuredRe = config->readEntry( "SentenceDelimiterRegExp", "([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))" ); m_sbdThread->setConfiguredSbRegExp( m_configuredRe ); - QString sb = config->readEntry( "SentenceBoundary", "\\1\t" ); + TQString sb = config->readEntry( "SentenceBoundary", "\\1\t" ); sb.replace( "\\t", "\t" ); m_sbdThread->setConfiguredSentenceBoundary( sb ); m_appIdList = config->readListEntry( "AppID" ); @@ -638,7 +638,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ * @param appId The DCOP appId of the application that queued the text. * Also useful for hints about how to do the filtering. */ -/*virtual*/ QString SbdProc::convert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId) +/*virtual*/ TQString SbdProc::convert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId) { if ( asyncConvert( inputText, talkerCode, appId) ) { @@ -662,14 +662,14 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ * program may then call @ref getOutput to retrieve converted text. Calling * program must call @ref ackFinished to acknowledge the conversion. */ -/*virtual*/ bool SbdProc::asyncConvert(const QString& inputText, TalkerCode* talkerCode, - const QCString& appId) +/*virtual*/ bool SbdProc::asyncConvert(const TQString& inputText, TalkerCode* talkerCode, + const TQCString& appId) { m_sbdThread->setWasModified( false ); // If language doesn't match, return input unmolested. if ( !m_languageCodeList.isEmpty() ) { - QString languageCode = talkerCode->languageCode(); + TQString languageCode = talkerCode->languageCode(); // kdDebug() << "StringReplacerProc::convert: converting " << inputText << // " if language code " << languageCode << " matches " << m_languageCodeList << endl; if ( !m_languageCodeList.contains( languageCode ) ) @@ -689,7 +689,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ // kdDebug() << "SbdProc::convert: converting " << inputText << " if appId " // << appId << " matches " << m_appIdList << endl; bool found = false; - QString appIdStr = appId; + TQString appIdStr = appId; for ( uint ndx=0; ndx < m_appIdList.count(); ++ndx ) { if ( appIdStr.contains(m_appIdList[ndx]) ) @@ -729,7 +729,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ /** * Returns the filtered output. */ -/*virtual*/ QString SbdProc::getOutput() { return m_sbdThread->text(); } +/*virtual*/ TQString SbdProc::getOutput() { return m_sbdThread->text(); } /** * Acknowledges the finished filtering. @@ -737,7 +737,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ /*virtual*/ void SbdProc::ackFinished() { m_state = fsIdle; - m_sbdThread->setText( QString::null ); + m_sbdThread->setText( TQString::null ); } /** @@ -753,7 +753,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ delete m_sbdThread; m_sbdThread = new SbdThread(); m_sbdThread->setConfiguredSbRegExp( m_configuredRe ); - connect( m_sbdThread, SIGNAL(filteringFinished()), this, SLOT(slotSbdThreadFilteringFinished()) ); + connect( m_sbdThread, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotSbdThreadFilteringFinished()) ); m_state = fsIdle; emit filteringStopped(); } @@ -771,7 +771,7 @@ bool SbdProc::init(KConfig* config, const QString& configGroup){ * * @param re The sentence delimiter regular expression. */ -/*virtual*/ void SbdProc::setSbRegExp(const QString& re) { m_sbdThread->setSbRegExp( re ); } +/*virtual*/ void SbdProc::setSbRegExp(const TQString& re) { m_sbdThread->setSbRegExp( re ); } // Received when SBD Thread finishes. void SbdProc::slotSbdThreadFilteringFinished() diff --git a/kttsd/filters/sbd/sbdproc.h b/kttsd/filters/sbd/sbdproc.h index 6c181d5..75e4d59 100644 --- a/kttsd/filters/sbd/sbdproc.h +++ b/kttsd/filters/sbd/sbdproc.h @@ -46,11 +46,11 @@ #define _SBDPROC_H_ // Qt includes. -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // KTTS includes. #include "filterproc.h" @@ -60,7 +60,7 @@ class KConfig; class QDomElement; class QDomNode; -class SbdThread: public QObject, public QThread +class SbdThread: public TQObject, public QThread { Q_OBJECT @@ -68,7 +68,7 @@ class SbdThread: public QObject, public QThread /** * Constructor. */ - SbdThread( QObject *parent = 0, const char *name = 0); + SbdThread( TQObject *parent = 0, const char *name = 0); /** * Destructor. @@ -78,8 +78,8 @@ class SbdThread: public QObject, public QThread /** * Get/Set text being processed. */ - void setText( const QString& text ); - QString text(); + void setText( const TQString& text ); + TQString text(); /** * Set/Get TalkerCode. @@ -93,14 +93,14 @@ class SbdThread: public QObject, public QThread * * @param re The sentence delimiter regular expression. */ - void setSbRegExp( const QString& re ); + void setSbRegExp( const TQString& re ); /** * The configured Sentence Boundary Regular Expression. * * @param re The sentence delimiter regular expression. */ - void setConfiguredSbRegExp( const QString& re ); + void setConfiguredSbRegExp( const TQString& re ); /** * The configured Sentence Boundary that replaces SB regular expression. @@ -108,7 +108,7 @@ class SbdThread: public QObject, public QThread * @param sb The sentence boundary replacement. * */ - void setConfiguredSentenceBoundary( const QString& sb ); + void setConfiguredSentenceBoundary( const TQString& sb ); /** * Did this filter do anything? If the filter returns the input as output @@ -122,7 +122,7 @@ class SbdThread: public QObject, public QThread protected: virtual void run(); - virtual bool event ( QEvent * e ); + virtual bool event ( TQEvent * e ); private: enum TextType { @@ -143,94 +143,94 @@ class SbdThread: public QObject, public QThread // Speak Element. struct SpeakElem { - QString lang; // xml:lang="en". + TQString lang; // xml:lang="en". }; // Voice Element. struct VoiceElem { - QString lang; // xml:lang="en". - QString gender; // "male", "female", or "neutral". + TQString lang; // xml:lang="en". + TQString gender; // "male", "female", or "neutral". uint age; // Age in years. - QString name; // Synth-specific voice name. - QString variant; // Ignored. + TQString name; // Synth-specific voice name. + TQString variant; // Ignored. }; // Prosody Element. struct ProsodyElem { - QString pitch; // "x-low", "low", "medium", "high", "x-high", "default". - QString contour; // Pitch contour (ignored). - QString range; // "x-low", "low", "medium", "high", "x-high", "default". - QString rate; // "x-slow", "slow", "medium", "fast", "x-fast", "default". - QString duration; // Ignored. - QString volume; // "silent", "x-soft", "soft", "medium", "load", "x-load", "default". + TQString pitch; // "x-low", "low", "medium", "high", "x-high", "default". + TQString contour; // Pitch contour (ignored). + TQString range; // "x-low", "low", "medium", "high", "x-high", "default". + TQString rate; // "x-slow", "slow", "medium", "fast", "x-fast", "default". + TQString duration; // Ignored. + TQString volume; // "silent", "x-soft", "soft", "medium", "load", "x-load", "default". }; // Emphasis Element. struct EmphasisElem { - QString level; // "strong", "moderate", "none" and "reduced" + TQString level; // "strong", "moderate", "none" and "reduced" }; // Break Element. struct BreakElem { - QString strength; // "x-weak", "weak", "medium" (default value), "strong", + TQString strength; // "x-weak", "weak", "medium" (default value), "strong", // or "x-strong", "none" - QString time; // Ignored. + TQString time; // Ignored. }; // Paragraph and Sentence Elements. struct PSElem { - QString lang; // xml:lang="en". + TQString lang; // xml:lang="en". }; // Given a tag name, returns SsmlElemType. - SsmlElemType tagToSsmlElemType(const QString tagName); + SsmlElemType tagToSsmlElemType(const TQString tagName); // Parses an SSML element, pushing current settings onto the context stack. - void pushSsmlElem( SsmlElemType et, const QDomElement& elem ); + void pushSsmlElem( SsmlElemType et, const TQDomElement& elem ); // Given an attribute name and value, constructs an XML representation of the attribute, // i.e., name="value". - QString makeAttr( const QString& name, const QString& value ); + TQString makeAttr( const TQString& name, const TQString& value ); // Returns an XML representation of an SSML tag from the top of the context stack. - QString makeSsmlElem( SsmlElemType et ); + TQString makeSsmlElem( SsmlElemType et ); // Pops element from the indicated context stack. void popSsmlElem( SsmlElemType et ); - QString makeBreakElem( const QDomElement& e ); + TQString makeBreakElem( const TQDomElement& e ); // Converts a text fragment into a CDATA section. - QString makeCDATA( const QString& text ); + TQString makeCDATA( const TQString& text ); // Returns an XML representation of an utterance node consisting of voice, // prosody, and emphasis elements. - QString makeSentence( const QString& text ); + TQString makeSentence( const TQString& text ); // Starts a sentence by returning a speak tag. - QString startSentence(); + TQString startSentence(); // Ends a sentence and appends a Tab. - QString endSentence(); + TQString endSentence(); // Parses a node of the SSML tree and recursively parses its children. // Returns the filtered text with each sentence a complete ssml tree. - QString parseSsmlNode( QDomNode& n, const QString& re ); + TQString parseSsmlNode( TQDomNode& n, const TQString& re ); // Parses Ssml. - QString parseSsml( const QString& inputText, const QString& re ); + TQString parseSsml( const TQString& inputText, const TQString& re ); // Parses code. Each newline is converted into a tab character (\t). - QString parseCode( const QString& inputText ); + TQString parseCode( const TQString& inputText ); // Parses plain text. - QString parsePlainText( const QString& inputText, const QString& re ); + TQString parsePlainText( const TQString& inputText, const TQString& re ); // Context stacks. - QValueStack m_speakStack; - QValueStack m_voiceStack; - QValueStack m_prosodyStack; - QValueStack m_emphasisStack; - QValueStack m_psStack; + TQValueStack m_speakStack; + TQValueStack m_voiceStack; + TQValueStack m_prosodyStack; + TQValueStack m_emphasisStack; + TQValueStack m_psStack; // The text being processed. - QString m_text; + TQString m_text; // Talker Code. TalkerCode* m_talkerCode; // Configured default Sentence Delimiter regular expression. - QString m_configuredRe; + TQString m_configuredRe; // Configured Sentence Boundary replacement expression. - QString m_configuredSentenceBoundary; + TQString m_configuredSentenceBoundary; // Application-specified Sentence Delimiter regular expression (if any). - QString m_re; + TQString m_re; // False if input was not modified. bool m_wasModified; // True when a sentence has been started. @@ -245,7 +245,7 @@ class SbdProc : virtual public KttsFilterProc /** * Constructor. */ - SbdProc( QObject *parent, const char *name, const QStringList &args = QStringList() ); + SbdProc( TQObject *parent, const char *name, const TQStringList &args = TQStringList() ); /** * Destructor. @@ -261,7 +261,7 @@ class SbdProc : virtual public KttsFilterProc * Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain * separate configuration files of their own. */ - virtual bool init( KConfig *config, const QString &configGroup ); + virtual bool init( KConfig *config, const TQString &configGroup ); /** * Returns True if this filter is a Sentence Boundary Detector. @@ -291,7 +291,7 @@ class SbdProc : virtual public KttsFilterProc * @param appId The DCOP appId of the application that queued the text. * Also useful for hints about how to do the filtering. */ - virtual QString convert( const QString& inputText, TalkerCode* talkerCode, const QCString& appId ); + virtual TQString convert( const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId ); /** * Convert input. Runs asynchronously. @@ -307,7 +307,7 @@ class SbdProc : virtual public KttsFilterProc * program may then call @ref getOutput to retrieve converted text. Calling * program must call @ref ackFinished to acknowledge the conversion. */ - virtual bool asyncConvert( const QString& inputText, TalkerCode* talkerCode, const QCString& appId ); + virtual bool asyncConvert( const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId ); /** * Waits for a previous call to asyncConvert to finish. @@ -322,7 +322,7 @@ class SbdProc : virtual public KttsFilterProc /** * Returns the filtered output. */ - virtual QString getOutput(); + virtual TQString getOutput(); /** * Acknowledges the finished filtering. @@ -344,7 +344,7 @@ class SbdProc : virtual public KttsFilterProc /** * Set Sentence Boundary Regular Expression. */ - virtual void setSbRegExp( const QString& re ); + virtual void setSbRegExp( const TQString& re ); private slots: // Received when SBD Thread finishes. @@ -352,15 +352,15 @@ class SbdProc : virtual public KttsFilterProc private: // If not empty, apply filters only to apps using talkers speaking these language codes. - QStringList m_languageCodeList; + TQStringList m_languageCodeList; // If not empty, apply filter only to apps containing this string. - QStringList m_appIdList; + TQStringList m_appIdList; // SBD Thread Object. SbdThread* m_sbdThread; // State. int m_state; // Configured default Sentence Delimiter regular expression. - QString m_configuredRe; + TQString m_configuredRe; }; #endif // _SBDPROC_H_ -- cgit v1.2.1