1 /***************************************************************************
2 ksayitviewimpl.cpp - description
4 begin : Son Aug 10 2003
5 copyright : (C) 2003 by Robert Vogl
6 email : voglrobe@saphir
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
22 #include <QtGui/QRadioButton>
23 #include <QtCore/QTextStream>
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
) {
39 KSayItViewImpl::~KSayItViewImpl(){
42 QString
& KSayItViewImpl::getText(){
48 void KSayItViewImpl::enableTextedit( bool enable
)
50 // if enable==true, we are in Edit Mode => RTF-Mode off.
52 TextEdit
->setTextFormat( Qt::PlainText
);
54 TextEdit
->setTextFormat( Qt::RichText
);
56 TextEdit
->setReadOnly( !enable
);
60 void KSayItViewImpl::slotTextChanged()
62 int length
= TextEdit
->length();
64 emit
signalTextChanged(false);
66 emit
signalTextChanged(true);
70 void KSayItViewImpl::slotCopyAvailable(bool available
)
72 // enable/disable copy/cut-action in the menubar
74 emit
signalEnableCopyCut(true);
76 emit
signalEnableCopyCut(false);
79 void KSayItViewImpl::slotCopy()
81 // copy selected text to the clipboard
86 void KSayItViewImpl::slotCut()
88 // copy selected text to the clipboard and delete it
93 void KSayItViewImpl::slotPaste()
95 // paste text from the clipboard to the texteditor
99 void KSayItViewImpl::textClear()
101 // deletes the entire text of the texteditor
105 void KSayItViewImpl::setText(const QString
&text
)
108 TextEdit
->setText( text
);
113 #include "ksayitviewimpl.moc"