• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

ktextedit.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KTEXTEDIT_H
00021 #define KTEXTEDIT_H
00022 
00023 #include <kdeui_export.h>
00024 #include <sonnet/highlighter.h>
00025 #include <QtGui/QTextEdit>
00026 
00041 class KTextEditSpellInterface
00042 {
00043   public:
00044 
00048     virtual bool isSpellCheckingEnabled() const = 0;
00049 
00054     virtual void setSpellCheckingEnabled(bool enable) = 0;
00055 
00062     virtual bool shouldBlockBeSpellChecked(const QString& block) const = 0;
00063 
00064     virtual ~KTextEditSpellInterface() {}
00065 };
00066 
00084 class KDEUI_EXPORT KTextEdit : public QTextEdit //krazy:exclude=qclasses
00085 {
00086     Q_OBJECT
00087 
00088   public:
00093     explicit KTextEdit( const QString& text, QWidget *parent = 0 );
00094 
00099     explicit KTextEdit( QWidget *parent = 0 );
00100 
00104     ~KTextEdit();
00105 
00109     virtual void setReadOnly( bool readOnly );
00110 
00125     void setCheckSpellingEnabled( bool check );
00126 
00138     bool checkSpellingEnabled() const;
00139 
00148     void highlightWord( int length, int pos );
00149 
00163     void setSpellCheckingConfigFileName(const QString &fileName);
00164 
00179     virtual void createHighlighter();
00180 
00189     Sonnet::Highlighter* highlighter() const;
00190 
00204     void setHighlighter(Sonnet::Highlighter *_highLighter);
00205 
00210     QMenu *mousePopupMenu();
00211 
00216     void enableFindReplace( bool enabled);
00217 
00226     void setSpellInterface( KTextEditSpellInterface *spellInterface );
00227 
00234     const QString& spellCheckingLanguage() const;
00235 
00236   Q_SIGNALS:
00242      void checkSpellingChanged( bool );
00243 
00248      void spellCheckStatus(const QString &);
00249 
00257      void languageChanged(const QString &language);
00258 
00259   public Q_SLOTS:
00260 
00269     void setSpellCheckingLanguage(const QString &language);
00270 
00275     void checkSpelling();
00276 
00291     void showSpellConfigDialog(const QString &configFileName,
00292                                const QString &windowIcon = QString());
00293 
00298     void replace();
00299 
00300   protected Q_SLOTS:
00304     void slotDoReplace();
00305     void slotReplaceNext();
00306     void slotDoFind();
00307     void slotFind();
00308     void slotFindNext();
00309     void slotReplace();
00313     void slotSpeakText();
00314 
00315   protected:
00319     virtual bool event(QEvent*);
00320 
00324     virtual void keyPressEvent( QKeyEvent* );
00325 
00330     virtual void focusInEvent( QFocusEvent* );
00331 
00336     virtual void wheelEvent( QWheelEvent* );
00337 
00342     virtual void deleteWordBack();
00343 
00348     virtual void deleteWordForward();
00349 
00354     virtual void contextMenuEvent( QContextMenuEvent* );
00355 
00356     // TODO: KDE5: get rid of these as soon as BIC changes are allowed, they
00357     //             should be folded back into the normal public version, which
00358     //             should be made virtual.
00359     //             These methods just provide a way for derived classes to call
00360     //             the base class version of the normal methods.
00361 
00367     void setCheckSpellingEnabledInternal(bool check);
00368 
00374     bool checkSpellingEnabledInternal() const;
00375 
00376   private:
00377     class Private;
00378     Private *const d;
00379 
00380     Q_PRIVATE_SLOT( d, void spellCheckerMisspelling( const QString&, int ) )
00381     Q_PRIVATE_SLOT( d, void spellCheckerCorrected(const QString&, int,const QString&) )
00382     Q_PRIVATE_SLOT( d, void spellCheckerCanceled())
00383     Q_PRIVATE_SLOT( d, void spellCheckerAutoCorrect(const QString&,const QString&) )
00384     Q_PRIVATE_SLOT( d, void spellCheckerFinished() )
00385     Q_PRIVATE_SLOT( d, void undoableClear() )
00386     Q_PRIVATE_SLOT( d, void toggleAutoSpellCheck() )
00387     Q_PRIVATE_SLOT( d, void slotAllowTab() )
00388     Q_PRIVATE_SLOT( d, void menuActivated( QAction* ) )
00389     Q_PRIVATE_SLOT( d, void slotFindHighlight(const QString&, int, int))
00390     Q_PRIVATE_SLOT( d, void slotReplaceText(const QString &, int, int, int))
00391 };
00392 
00393 #endif // KTEXTEDIT_H

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal