fix i18nc typo in last commit
[kdeaccessibility.git] / ksayit / src / ksayitviewimpl.cpp
blob52410d3b265e63c5598bb4438dfe461c541cb868
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 ***************************************************************************/
18 #include <iostream>
19 using namespace std;
21 // QT includes
22 #include <QtGui/QRadioButton>
23 #include <QtCore/QTextStream>
25 // KDE includes
26 #include <kdebug.h>
27 #include <klocale.h>
28 #include <ktextedit.h>
29 #include <kmessagebox.h>
31 // App specific includes
32 #include "ksayitviewimpl.h"
34 KSayItViewImpl::KSayItViewImpl(QWidget *parent, const char *name ) : KSayItView(parent,name) {
36 // some presets
39 KSayItViewImpl::~KSayItViewImpl(){
42 QString& KSayItViewImpl::getText(){
43 t = TextEdit->text();
44 return t;
48 void KSayItViewImpl::enableTextedit( bool enable )
50 // if enable==true, we are in Edit Mode => RTF-Mode off.
51 if ( enable ){
52 TextEdit->setTextFormat( Qt::PlainText);
53 } else {
54 TextEdit->setTextFormat( Qt::RichText);
56 TextEdit->setReadOnly( !enable );
60 void KSayItViewImpl::slotTextChanged()
62 int length = TextEdit->length();
63 if ( length > 2 ){
64 emit signalTextChanged(false);
65 } else {
66 emit signalTextChanged(true);
70 void KSayItViewImpl::slotCopyAvailable(bool available)
72 // enable/disable copy/cut-action in the menubar
73 if (available)
74 emit signalEnableCopyCut(true);
75 else
76 emit signalEnableCopyCut(false);
79 void KSayItViewImpl::slotCopy()
81 // copy selected text to the clipboard
82 TextEdit->copy();
86 void KSayItViewImpl::slotCut()
88 // copy selected text to the clipboard and delete it
89 TextEdit->cut();
93 void KSayItViewImpl::slotPaste()
95 // paste text from the clipboard to the texteditor
96 TextEdit->paste();
99 void KSayItViewImpl::textClear()
101 // deletes the entire text of the texteditor
102 TextEdit->clear();
105 void KSayItViewImpl::setText(const QString &text)
107 // set text to text
108 TextEdit->setText( text );
113 #include "ksayitviewimpl.moc"