• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • spellcheck
spellcheckdialog.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2009-2010 by Michel Ludwig <michel.ludwig@kdemail.net>
4  * Copyright (C) 2008 Mirko Stocker <me@misto.ch>
5  * Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
6  * Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
7  * Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
8  * Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
9  * Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public License
22  * along with this library; see the file COPYING.LIB. If not, write to
23  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA 02110-1301, USA.
25  */
26 
27 #ifndef __KATE_SPELLCHECKDIALOG_H__
28 #define __KATE_SPELLCHECKDIALOG_H__
29 
30 #include <QtCore/QObject>
31 
32 class KateView;
33 
34 class KAction;
35 class KActionCollection;
36 class KProgressDialog;
37 namespace Sonnet {
38  class Dialog;
39  class BackgroundChecker;
40  class Speller;
41 }
42 
43 #include "ktexteditor/range.h"
44 
45 namespace KTextEditor {
46  class MovingRange;
47 }
48 
49 class KateSpellCheckDialog : public QObject
50 {
51  Q_OBJECT
52 
53  public:
54  explicit KateSpellCheckDialog( KateView* );
55  ~KateSpellCheckDialog();
56 
57  void createActions( KActionCollection* );
58 
59  void updateActions ();
60 
61  // spellcheck from cursor, selection
62  private Q_SLOTS:
63  void spellcheckFromCursor();
64 
65  // defined here in anticipation of per view selections ;)
66  void spellcheckSelection();
67 
68  void spellcheck();
69 
76  void spellcheck( const KTextEditor::Cursor &from, const KTextEditor::Cursor &to=KTextEditor::Cursor() );
77 
78  void misspelling( const QString&, int );
79  void corrected ( const QString&, int, const QString&);
80 
81  void performSpellCheck(const KTextEditor::Range& range);
82  void installNextSpellCheckRange();
83 
84  void cancelClicked();
85 
86  void objectDestroyed(QObject *object);
87 
88  void languageChanged(const QString &language);
89 
90  private:
91  KTextEditor::Cursor locatePosition( int pos );
92 
93  KateView *m_view;
94  KAction *m_spellcheckSelection;
95 
96  Sonnet::Speller *m_speller;
97  Sonnet::BackgroundChecker *m_backgroundChecker;
98  Sonnet::Dialog *m_sonnetDialog;
99 
100  // define the part of the text that is to be checked
101  KTextEditor::Range m_currentSpellCheckRange;
102  KTextEditor::MovingRange *m_globalSpellCheckRange;
103 
104  QList<QPair<int, int> > m_currentDecToEncOffsetList;
105 
106  QList<QPair<KTextEditor::Range, QString> > m_languagesInSpellCheckRange;
107  QList<QPair<KTextEditor::Range, QString> >::iterator m_currentLanguageRangeIterator;
108 
109  // keep track of where we are.
110  KTextEditor::Cursor m_spellPosCursor;
111  uint m_spellLastPos;
112 
113  bool m_spellCheckCancelledByUser;
114 
115  QString m_userSpellCheckLanguage, m_previousGivenSpellCheckLanguage;
116 
117  void spellCheckDone();
118 };
119 
120 #endif
121 
122 // kate: space-indent on; indent-width 2; replace-tabs on;
KateSpellCheckDialog::updateActions
void updateActions()
Definition: spellcheckdialog.cpp:79
KateSpellCheckDialog::KateSpellCheckDialog
KateSpellCheckDialog(KateView *)
Definition: spellcheckdialog.cpp:43
KateSpellCheckDialog
Definition: spellcheckdialog.h:49
KateSpellCheckDialog::createActions
void createActions(KActionCollection *)
Definition: spellcheckdialog.cpp:62
QObject
KateSpellCheckDialog::~KateSpellCheckDialog
~KateSpellCheckDialog()
Definition: spellcheckdialog.cpp:54
QString
QList
KateView
Definition: kateview.h:77
KAction
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal