summaryrefslogtreecommitdiffstats
path: root/ksayit/src/ksayitviewimpl.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit00bb99ac80741fc50ef8a289719373032f2391eb (patch)
tree3a5a9bf72f942784b38bf77dd66c534662fab5f2 /ksayit/src/ksayitviewimpl.cpp
downloadtdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz
tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksayit/src/ksayitviewimpl.cpp')
-rw-r--r--ksayit/src/ksayitviewimpl.cpp115
1 files changed, 115 insertions, 0 deletions
diff --git a/ksayit/src/ksayitviewimpl.cpp b/ksayit/src/ksayitviewimpl.cpp
new file mode 100644
index 0000000..e619f8c
--- /dev/null
+++ b/ksayit/src/ksayitviewimpl.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+ ksayitviewimpl.cpp - description
+ -------------------
+ begin : Son Aug 10 2003
+ copyright : (C) 2003 by Robert Vogl
+ email : voglrobe@saphir
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include <iostream>
+using namespace std;
+
+ // QT includes
+#include <qradiobutton.h>
+#include <qtextstream.h>
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <ktextedit.h>
+#include <kmessagebox.h>
+
+// App specific includes
+#include "ksayitviewimpl.h"
+
+KSayItViewImpl::KSayItViewImpl(QWidget *parent, const char *name ) : KSayItView(parent,name) {
+
+ // some presets
+
+}
+KSayItViewImpl::~KSayItViewImpl(){
+}
+
+QString& KSayItViewImpl::getText(){
+ t = TextEdit->text();
+ return t;
+}
+
+
+void KSayItViewImpl::enableTextedit( bool enable )
+{
+ // if enable==true, we are in Edit Mode => RTF-Mode off.
+ if ( enable ){
+ TextEdit->setTextFormat( Qt::PlainText);
+ } else {
+ TextEdit->setTextFormat( Qt::RichText);
+ }
+ TextEdit->setReadOnly( !enable );
+}
+
+
+void KSayItViewImpl::slotTextChanged()
+{
+ int length = TextEdit->length();
+ if ( length > 2 ){
+ emit signalTextChanged(false);
+ } else {
+ emit signalTextChanged(true);
+ }
+}
+
+void KSayItViewImpl::slotCopyAvailable(bool available)
+{
+ // enable/disable copy/cut-action in the menubar
+ if (available)
+ emit signalEnableCopyCut(true);
+ else
+ emit signalEnableCopyCut(false);
+}
+
+void KSayItViewImpl::slotCopy()
+{
+ // copy selected text to the clipboard
+ TextEdit->copy();
+}
+
+
+void KSayItViewImpl::slotCut()
+{
+ // copy selected text to the clipboard and delete it
+ TextEdit->cut();
+}
+
+
+void KSayItViewImpl::slotPaste()
+{
+ // paste text from the clipboard to the texteditor
+ TextEdit->paste();
+}
+
+void KSayItViewImpl::textClear()
+{
+ // deletes the entire text of the texteditor
+ TextEdit->clear();
+}
+
+void KSayItViewImpl::setText(const QString &text)
+{
+ // set text to text
+ TextEdit->setText( text );
+}
+
+
+
+#include "ksayitviewimpl.moc"