home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kspeechsink.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  7.7 KB  |  165 lines

  1. /***************************************************** vim:set ts=4 sw=4 sts=4:
  2.   kspeechsink.h
  3.   KTTSD DCOP Signal Sink Interface
  4.   --------------------------------
  5.   Copyright:
  6.   (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
  7.   -------------------
  8.   Original author: Gary Cramblitt <garycramblitt@comcast.net>
  9.  ******************************************************************************/
  10.  
  11. /***************************************************************************
  12.  *                                                                         *
  13.  *   This program is free software; you can redistribute it and/or modify  *
  14.  *   it under the terms of the GNU General Public License as published by  *
  15.  *   the Free Software Foundation; version 2 of the License.               *
  16.  *                                                                         *
  17.  ***************************************************************************/
  18.  
  19. /**
  20.  * @interface KSpeechSink
  21.  *
  22.  * KTTSD DCOP Signal Sink
  23.  *
  24.  * @since KDE 3.4
  25.  *
  26.  * This defines the interface to sink signals emitted by KTTSD, the KDE Text-to-speech Deamon.
  27.  * The DCOP IDL Compiler generates a skeleton file from this interface definition that will
  28.  * marshal the arguments for you.
  29.  *
  30.  * @section Usage
  31.  *
  32.  * See the Signals section of kspeech.h for instructions.
  33.  *
  34.  * @warning The KSpeechSink interface is still being developed and is likely to change in the future.
  35. */
  36.  
  37. #ifndef _KSPEECHSINK_H_
  38. #define _KSPEECHSINK_H_
  39.  
  40. #include <dcopobject.h>
  41.  
  42. class KSpeechSink : virtual public DCOPObject {
  43.     K_DCOP
  44.  
  45.     public:
  46.         /**
  47.         * @enum kttsdJobState
  48.         * Job states returned by method getTextJobState.
  49.         */
  50.         enum kttsdJobState
  51.         {
  52.             jsQueued = 0,                /**< Job has been queued but is not yet speakable. */
  53.             jsSpeakable = 1,             /**< Job is speakable, but is not speaking. */
  54.             jsSpeaking = 2,              /**< Job is currently speaking. */
  55.             jsPaused = 3,                /**< Job has been paused. */
  56.             jsFinished = 4               /**< Job is finished and is deleteable. */
  57.         };
  58.  
  59.         /**
  60.         * @enum kttsdMarkupType
  61.         * %Speech markup language types.
  62.         */
  63.         enum kttsdMarkupType
  64.         {
  65.             mtPlain = 0,                 /**< Plain text */
  66.             mtJsml = 1,                  /**< Java %Speech Markup Language */
  67.             mtSmml = 2,                  /**< %Speech Markup Meta-language */
  68.             mtSable = 3                  /**< Sable 2.0 */
  69.         };
  70.  
  71.     k_dcop:
  72.         /**
  73.         * This signal is emitted when KTTSD starts or restarts after a call to reinit.
  74.         */
  75.         virtual ASYNC kttsdStarted() { };
  76.         /**
  77.         * This signal is emitted just before KTTSD exits.
  78.         */
  79.         virtual ASYNC kttsdExiting() { };
  80.  
  81.         /**
  82.          * This signal is emitted when the speech engine/plugin encounters a marker in the text.
  83.          * @param appId          DCOP application ID of the application that queued the text.
  84.          * @param markerName     The name of the marker seen.
  85.          * @see markers
  86.          */
  87.         virtual ASYNC markerSeen(const QCString& appId, const QString& markerName) { Q_UNUSED(appId); Q_UNUSED(markerName); };
  88.         /**
  89.          * This signal is emitted whenever a sentence begins speaking.
  90.          * @param appId          DCOP application ID of the application that queued the text.
  91.          * @param jobNum         Job number of the text job.
  92.          * @param seq            Sequence number of the text.
  93.          * @see getTextCount
  94.          */
  95.         virtual ASYNC sentenceStarted(const QCString& appId, uint jobNum, uint seq) { Q_UNUSED(appId); Q_UNUSED(jobNum); Q_UNUSED(seq); };
  96.         /**
  97.          * This signal is emitted when a sentence has finished speaking.
  98.          * @param appId          DCOP application ID of the application that queued the text.
  99.          * @param jobNum         Job number of the text job.
  100.          * @param seq            Sequence number of the text.
  101.          * @see getTextCount
  102.          */
  103.         virtual ASYNC sentenceFinished(const QCString& appId, uint jobNum, uint seq) { Q_UNUSED(appId); Q_UNUSED(jobNum); Q_UNUSED(seq); };
  104.  
  105.         /**
  106.          * This signal is emitted whenever a new text job is added to the queue.
  107.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  108.          * @param jobNum         Job number of the text job.
  109.          */
  110.         virtual ASYNC textSet(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  111.  
  112.         /**
  113.         * This signal is emitted whenever a new part is appended to a text job.
  114.         * @param appId          The DCOP senderId of the application that created the job.
  115.         * @param jobNum         Job number of the text job.
  116.         * @param partNum        Part number of the new part.  Parts are numbered starting
  117.         *                       at 1.
  118.         */
  119.         virtual ASYNC textAppended(const QCString& appId, uint jobNum, int partNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); Q_UNUSED(partNum); };
  120.  
  121.         /**
  122.          * This signal is emitted whenever speaking of a text job begins.
  123.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  124.          * @param jobNum         Job number of the text job.
  125.          */
  126.         virtual ASYNC textStarted(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  127.         /**
  128.          * This signal is emitted whenever a text job is finished.  The job has
  129.          * been marked for deletion from the queue and will be deleted when another
  130.          * job reaches the Finished state. (Only one job in the text queue may be
  131.          * in state Finished at one time.)  If startText or resumeText is
  132.          * called before the job is deleted, it will remain in the queue for speaking.
  133.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  134.          * @param jobNum         Job number of the text job.
  135.          */
  136.         virtual ASYNC textFinished(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  137.         /**
  138.          * This signal is emitted whenever a speaking text job stops speaking.
  139.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  140.          * @param jobNum         Job number of the text job.
  141.          */
  142.         virtual ASYNC textStopped(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  143.         /**
  144.          * This signal is emitted whenever a speaking text job is paused.
  145.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  146.          * @param jobNum         Job number of the text job.
  147.          */
  148.         virtual ASYNC textPaused(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  149.         /**
  150.          * This signal is emitted when a text job, that was previously paused, resumes speaking.
  151.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  152.          * @param jobNum         Job number of the text job.
  153.          */
  154.         virtual ASYNC textResumed(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  155.         /**
  156.          * This signal is emitted whenever a text job is deleted from the queue.
  157.          * The job is no longer in the queue when this signal is emitted.
  158.          * @param appId          The DCOP senderId of the application that created the job.  NULL if kttsd.
  159.          * @param jobNum         Job number of the text job.
  160.          */
  161.         virtual ASYNC textRemoved(const QCString& appId, uint jobNum) { Q_UNUSED(appId); Q_UNUSED(jobNum); };
  162. };
  163.  
  164. #endif // _KSPEECHSINK_H_
  165.