From 00bb99ac80741fc50ef8a289719373032f2391eb Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- ksayit/src/ksayitviewimpl.cpp | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 ksayit/src/ksayitviewimpl.cpp (limited to 'ksayit/src/ksayitviewimpl.cpp') 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 +using namespace std; + + // QT includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// 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" -- cgit v1.2.1