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 ***************************************************************************/
23 #include <QRadioButton>
24 #include <QTextStream>
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
) {
41 KSayItViewImpl::~KSayItViewImpl(){
44 QString
& KSayItViewImpl::getText(){
50 void KSayItViewImpl::enableTextedit( bool enable
)
52 // if enable==true, we are in Edit Mode => RTF-Mode off.
54 TextEdit
->setTextFormat( Qt::PlainText
);
56 TextEdit
->setTextFormat( Qt::RichText
);
58 TextEdit
->setReadOnly( !enable
);
62 void KSayItViewImpl::slotTextChanged()
64 int length
= TextEdit
->length();
66 emit
signalTextChanged(false);
68 emit
signalTextChanged(true);
72 void KSayItViewImpl::slotCopyAvailable(bool available
)
74 // enable/disable copy/cut-action in the menubar
76 emit
signalEnableCopyCut(true);
78 emit
signalEnableCopyCut(false);
81 void KSayItViewImpl::slotCopy()
83 // copy selected text to the clipboard
88 void KSayItViewImpl::slotCut()
90 // copy selected text to the clipboard and delete it
95 void KSayItViewImpl::slotPaste()
97 // paste text from the clipboard to the texteditor
101 void KSayItViewImpl::textClear()
103 // deletes the entire text of the texteditor
107 void KSayItViewImpl::setText(const QString
&text
)
110 TextEdit
->setText( text
);
115 #include "ksayitviewimpl.moc"