SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / ksayit / src / ksayitviewimpl.cpp
blob2966d2d46883df7ece110b55b3fb1efacaeadf15
1 /***************************************************************************
2 ksayitviewimpl.cpp - description
3 -------------------
4 begin : Son Aug 10 2003
5 copyright : (C) 2003 by Robert Vogl
6 email : voglrobe@saphir
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
19 #include <iostream>
20 using namespace std;
22 // QT includes
23 #include <QRadioButton>
24 #include <QTextStream>
25 #include <QString>
27 // KDE includes
28 #include <kdebug.h>
29 #include <klocale.h>
30 #include <ktextedit.h>
31 #include <kmessagebox.h>
33 // App specific includes
34 #include "ksayitviewimpl.h"
36 KSayItViewImpl::KSayItViewImpl(QWidget *parent, const char *name ) : KSayItView(parent,name) {
38 // some presets
41 KSayItViewImpl::~KSayItViewImpl(){
44 QString& KSayItViewImpl::getText(){
45 t = TextEdit->text();
46 return t;
50 void KSayItViewImpl::enableTextedit( bool enable )
52 // if enable==true, we are in Edit Mode => RTF-Mode off.
53 if ( enable ){
54 TextEdit->setTextFormat( Qt::PlainText);
55 } else {
56 TextEdit->setTextFormat( Qt::RichText);
58 TextEdit->setReadOnly( !enable );
62 void KSayItViewImpl::slotTextChanged()
64 int length = TextEdit->length();
65 if ( length > 2 ){
66 emit signalTextChanged(false);
67 } else {
68 emit signalTextChanged(true);
72 void KSayItViewImpl::slotCopyAvailable(bool available)
74 // enable/disable copy/cut-action in the menubar
75 if (available)
76 emit signalEnableCopyCut(true);
77 else
78 emit signalEnableCopyCut(false);
81 void KSayItViewImpl::slotCopy()
83 // copy selected text to the clipboard
84 TextEdit->copy();
88 void KSayItViewImpl::slotCut()
90 // copy selected text to the clipboard and delete it
91 TextEdit->cut();
95 void KSayItViewImpl::slotPaste()
97 // paste text from the clipboard to the texteditor
98 TextEdit->paste();
101 void KSayItViewImpl::textClear()
103 // deletes the entire text of the texteditor
104 TextEdit->clear();
107 void KSayItViewImpl::setText(const QString &text)
109 // set text to text
110 TextEdit->setText( text );
115 #include "ksayitviewimpl.moc"