• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeaccessibility API Reference
  • KDE Home
  • Contact Us
 

jovie

Public Types | Signals | Public Member Functions | List of all members
KttsFilterProc Class Reference

#include <filterproc.h>

Inheritance diagram for KttsFilterProc:
Inheritance graph
[legend]

Public Types

enum  FilterState { fsIdle = 0, fsFiltering = 1, fsStopping = 2, fsFinished = 3 }
 

Signals

void error (bool keepGoing, const QString &msg)
 
void filteringFinished ()
 
void filteringStopped ()
 

Public Member Functions

 KttsFilterProc (QObject *parent, const QVariantList &)
 
virtual ~KttsFilterProc ()
 
virtual void ackFinished ()
 
virtual bool asyncConvert (const QString &inputText, TalkerCode *talkerCode, const QString &appId)
 
virtual QString convert (const QString &inputText, TalkerCode *talkerCode, const QString &appId)
 
virtual QString getOutput ()
 
virtual int getState ()
 
virtual bool init (KConfig *config, const QString &configGroup)
 
virtual bool isSBD ()
 
virtual void setSbRegExp (const QString &re)
 
virtual void stopFiltering ()
 
virtual bool supportsAsync ()
 
virtual void waitForFinished ()
 
virtual bool wasModified ()
 

Detailed Description

Definition at line 38 of file filterproc.h.

Member Enumeration Documentation

enum KttsFilterProc::FilterState
Enumerator
fsIdle 
fsFiltering 
fsStopping 
fsFinished 

Definition at line 43 of file filterproc.h.

Constructor & Destructor Documentation

KttsFilterProc::KttsFilterProc ( QObject *  parent,
const QVariantList &   
)

Constructor.

Definition at line 34 of file filterproc.cpp.

KttsFilterProc::~KttsFilterProc ( )
virtual

Destructor.

Definition at line 43 of file filterproc.cpp.

Member Function Documentation

void KttsFilterProc::ackFinished ( )
virtual

Acknowledges the finished filtering.

Reimplemented in XmlTransformerProc.

Definition at line 131 of file filterproc.cpp.

bool KttsFilterProc::asyncConvert ( const QString &  inputText,
TalkerCode *  talkerCode,
const QString &  appId 
)
virtual

Convert input.

Runs asynchronously.

Parameters
inputTextInput text.
talkerCodeTalkerCode structure for the talker that KTTSD intends to use for synthing the text. Useful for extracting hints about how to filter the text. For example, languageCode.
appIdThe DCOP appId of the application that queued the text. Also useful for hints about how to do the filtering.
Returns
False if the filter cannot perform the conversion.

When conversion is completed, emits signal filteringFinished. Calling program may then call getOutput to retrieve converted text. Calling program must call ackFinished to acknowledge the conversion.

Reimplemented in XmlTransformerProc.

Definition at line 110 of file filterproc.cpp.

QString KttsFilterProc::convert ( const QString &  inputText,
TalkerCode *  talkerCode,
const QString &  appId 
)
virtual

Convert input, returning output.

Runs synchronously.

Parameters
inputTextInput text.
talkerCodeTalkerCode structure for the talker that KTTSD intends to use for synthing the text. Useful for extracting hints about how to filter the text. For example, languageCode.
appIdThe DCOP appId of the application that queued the text. Also useful for hints about how to do the filtering.

Reimplemented in XmlTransformerProc, TalkerChooserProc, FilterMgr, and StringReplacerProc.

Definition at line 90 of file filterproc.cpp.

void KttsFilterProc::error ( bool  keepGoing,
const QString &  msg 
)
signal

If an error occurs, Filter should signal the error and return input as output in convert method.

If Filter should not be called in the future, perhaps because it could not find its configuration file, return False for keepGoing.

Parameters
keepGoingFalse if the filter should not be called in the future.
msgError message.
void KttsFilterProc::filteringFinished ( )
signal

Emitted when asynchronous filtering has completed.

void KttsFilterProc::filteringStopped ( )
signal

Emitted when stopFiltering has been called and filtering has in fact stopped.

QString KttsFilterProc::getOutput ( )
virtual

Returns the filtered output.

Reimplemented in XmlTransformerProc.

Definition at line 126 of file filterproc.cpp.

int KttsFilterProc::getState ( )
virtual

Returns the state of the Filter.

Reimplemented in XmlTransformerProc.

Definition at line 121 of file filterproc.cpp.

bool KttsFilterProc::init ( KConfig *  config,
const QString &  configGroup 
)
virtual

Initialize the filter.

Parameters
configSettings object.
configGroupSettings Group.
Returns
False if filter is not ready to filter.

Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain separate configuration files of their own.

Reimplemented in XmlTransformerProc, StringReplacerProc, and TalkerChooserProc.

Definition at line 57 of file filterproc.cpp.

bool KttsFilterProc::isSBD ( )
virtual

Returns True if this filter is a Sentence Boundary Detector.

If so, the filter should implement setSbRegExp() .

Returns
True if this filter is a SBD.

Definition at line 67 of file filterproc.cpp.

void KttsFilterProc::setSbRegExp ( const QString &  re)
virtual

Set Sentence Boundary Regular Expression.

This method will only be called if the application overrode the default.

Parameters
reThe sentence delimiter regular expression.

Definition at line 151 of file filterproc.cpp.

void KttsFilterProc::stopFiltering ( )
virtual

Stops filtering.

The filteringStopped signal will emit when filtering has in fact stopped and state returns to fsIdle;

Reimplemented in XmlTransformerProc.

Definition at line 137 of file filterproc.cpp.

bool KttsFilterProc::supportsAsync ( )
virtual

Returns True if the plugin supports asynchronous processing, i.e., supports asyncConvert method.

Returns
True if this plugin supports asynchronous processing.

If the plugin returns True, it must also implement getState . It must also emit filteringFinished when filtering is completed. If the plugin returns True, it must also implement stopFiltering . It must also emit filteringStopped when filtering has been stopped.

Reimplemented in XmlTransformerProc, and TalkerChooserProc.

Definition at line 79 of file filterproc.cpp.

void KttsFilterProc::waitForFinished ( )
virtual

Waits for a previous call to asyncConvert to finish.

Reimplemented in XmlTransformerProc.

Definition at line 116 of file filterproc.cpp.

bool KttsFilterProc::wasModified ( )
virtual

Did this filter do anything? If the filter returns the input as output unmolested, it should return False when this method is called.

Reimplemented in XmlTransformerProc, and StringReplacerProc.

Definition at line 143 of file filterproc.cpp.


The documentation for this class was generated from the following files:
  • filterproc.h
  • filterproc.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

jovie

Skip menu "jovie"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeaccessibility API Reference

Skip menu "kdeaccessibility API Reference"
  • jovie

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal