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/sbdproc.cpp | 214 +++++++++++++++++++++--------------------- 1 file changed, 107 insertions(+), 107 deletions(-) (limited to 'kttsd/filters/sbd/sbdproc.cpp') 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() -- cgit v1.2.1