summaryrefslogtreecommitdiffstats
path: root/examples/speech/hello_speak/mainwindow.h
diff options
context:
space:
mode:
authorVenugopal Shivashankar <venugopal.shivashankar@digia.com>2015-08-21 12:37:36 +0200
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-08-22 08:47:13 +0000
commitbc8a097b1ccfa7de31193b5dccb5a64f8bfd7551 (patch)
treec5682edc6c8d113703ad486f8cfb5dbe67b229f6 /examples/speech/hello_speak/mainwindow.h
parent2e95885ca368b2f3cdc1a258fd6567b2e0a7fe3b (diff)
Doc: Moved the examples to examples/speech
With the earlier directory structure of examples/widgets, the speech examples would end up in the widgets directory along with other Qt Widgets examples in the Qt binary pkg. Change-Id: Ib9ad0826e23c493a4fc5b1d1e7acf9addad3be65 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'examples/speech/hello_speak/mainwindow.h')
-rw-r--r--examples/speech/hello_speak/mainwindow.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/examples/speech/hello_speak/mainwindow.h b/examples/speech/hello_speak/mainwindow.h
new file mode 100644
index 0000000..7b89efc
--- /dev/null
+++ b/examples/speech/hello_speak/mainwindow.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtWidgets/qmainwindow.h>
+
+#include "ui_mainwindow.h"
+
+#include <QTextToSpeech>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ MainWindow(QWidget *parent = 0);
+
+public slots:
+ void speak();
+ void stop();
+
+ void setRate(int);
+ void setPitch(int);
+
+ void stateChanged(QTextToSpeech::State state);
+ void languageSelected(int language);
+ void voiceSelected(int index);
+
+ void localeChanged(const QLocale &locale);
+
+private:
+ Ui::MainWindow ui;
+ QTextToSpeech m_speech;
+ QVector<QVoice> m_voices;
+};
+
+#endif