• 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
spellingmenu.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) 2008-2009 by Michel Ludwig <michel.ludwig@kdemail.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SPELLINGMENU_H
22 #define SPELLINGMENU_H
23 
24 #include <QObject>
25 #include <QSignalMapper>
26 
27 #include <kactioncollection.h>
28 #include <kactionmenu.h>
29 #include <kmenu.h>
30 #include <ktexteditor/movingrange.h>
31 #include <ktexteditor/movingrangefeedback.h>
32 #include <ktexteditor/range.h>
33 #include <ktexteditor/view.h>
34 
35 class KateDocument;
36 class KateView;
37 
38 class KateOnTheFlyChecker;
39 
40 class KateSpellingMenu : public QObject {
41  Q_OBJECT
42  friend class KateOnTheFlyChecker;
43 
44  public:
45  KateSpellingMenu(KateView *view);
46  virtual ~KateSpellingMenu();
47 
48  bool isEnabled() const;
49 
50  void createActions(KActionCollection *ac);
51 
57  void setUseMouseForMisspelledRange(bool b);
58 
59  public Q_SLOTS:
60  void setEnabled(bool b);
61  void setVisible(bool b);
62 
63  protected:
64  KateView *m_view;
65  KActionMenu *m_spellingMenuAction;
66  KAction *m_ignoreWordAction, *m_addToDictionaryAction;
67  KMenu *m_spellingMenu;
68  KTextEditor::MovingRange *m_currentMisspelledRange;
69  KTextEditor::MovingRange *m_currentMouseMisspelledRange;
70  KTextEditor::MovingRange *m_currentCaretMisspelledRange;
71  bool m_useMouseForMisspelledRange;
72  QStringList m_currentSuggestions;
73  QSignalMapper *m_suggestionsSignalMapper;
74 
75  // These methods are called from KateOnTheFlyChecker to inform about events involving
76  // moving ranges.
77  void rangeDeleted(KTextEditor::MovingRange *range);
78  void caretEnteredMisspelledRange(KTextEditor::MovingRange *range);
79  void caretExitedMisspelledRange(KTextEditor::MovingRange *range);
80  void mouseEnteredMisspelledRange(KTextEditor::MovingRange *range);
81  void mouseExitedMisspelledRange(KTextEditor::MovingRange *range);
82 
83  protected Q_SLOTS:
84  void populateSuggestionsMenu();
85  void replaceWordBySuggestion(const QString& suggestion);
86 
87  void addCurrentWordToDictionary();
88  void ignoreCurrentWord();
89 };
90 
91 #endif
92 
93 // kate: space-indent on; indent-width 2; replace-tabs on;
KateSpellingMenu::addCurrentWordToDictionary
void addCurrentWordToDictionary()
Definition: spellingmenu.cpp:205
KateSpellingMenu::m_currentMisspelledRange
KTextEditor::MovingRange * m_currentMisspelledRange
Definition: spellingmenu.h:68
KateSpellingMenu::createActions
void createActions(KActionCollection *ac)
Definition: spellingmenu.cpp:95
KateSpellingMenu::rangeDeleted
void rangeDeleted(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:147
KateSpellingMenu::m_addToDictionaryAction
KAction * m_addToDictionaryAction
Definition: spellingmenu.h:66
KateSpellingMenu::m_currentMouseMisspelledRange
KTextEditor::MovingRange * m_currentMouseMisspelledRange
Definition: spellingmenu.h:69
KateSpellingMenu::setEnabled
void setEnabled(bool b)
Definition: spellingmenu.cpp:69
KateSpellingMenu::m_suggestionsSignalMapper
QSignalMapper * m_suggestionsSignalMapper
Definition: spellingmenu.h:73
KateSpellingMenu::populateSuggestionsMenu
void populateSuggestionsMenu()
Definition: spellingmenu.cpp:172
KateSpellingMenu::m_spellingMenu
KMenu * m_spellingMenu
Definition: spellingmenu.h:67
KateSpellingMenu::KateSpellingMenu
KateSpellingMenu(KateView *view)
Definition: spellingmenu.cpp:31
KateSpellingMenu::isEnabled
bool isEnabled() const
Definition: spellingmenu.cpp:61
QObject
KateSpellingMenu::setVisible
void setVisible(bool b)
Definition: spellingmenu.cpp:82
KateSpellingMenu::ignoreCurrentWord
void ignoreCurrentWord()
Definition: spellingmenu.cpp:216
KateSpellingMenu::m_useMouseForMisspelledRange
bool m_useMouseForMisspelledRange
Definition: spellingmenu.h:71
KateSpellingMenu
Definition: spellingmenu.h:40
QString
KateSpellingMenu::m_currentSuggestions
QStringList m_currentSuggestions
Definition: spellingmenu.h:72
KateSpellingMenu::caretEnteredMisspelledRange
void caretEnteredMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:112
KateSpellingMenu::m_view
KateView * m_view
Definition: spellingmenu.h:64
QStringList
KateView
Definition: kateview.h:77
KateSpellingMenu::m_currentCaretMisspelledRange
KTextEditor::MovingRange * m_currentCaretMisspelledRange
Definition: spellingmenu.h:70
KateDocument
Definition: katedocument.h:74
KateSpellingMenu::mouseExitedMisspelledRange
void mouseExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:139
KateSpellingMenu::m_spellingMenuAction
KActionMenu * m_spellingMenuAction
Definition: spellingmenu.h:65
KActionMenu
KateSpellingMenu::m_ignoreWordAction
KAction * m_ignoreWordAction
Definition: spellingmenu.h:66
KateSpellingMenu::caretExitedMisspelledRange
void caretExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:122
KateSpellingMenu::setUseMouseForMisspelledRange
void setUseMouseForMisspelledRange(bool b)
This method has to be called before the menu is shown in response to a context menu event...
Definition: spellingmenu.cpp:161
KAction
KateSpellingMenu::replaceWordBySuggestion
void replaceWordBySuggestion(const QString &suggestion)
Definition: spellingmenu.cpp:199
KateSpellingMenu::mouseEnteredMisspelledRange
void mouseEnteredMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:131
KateSpellingMenu::~KateSpellingMenu
virtual ~KateSpellingMenu()
Definition: spellingmenu.cpp:51
QSignalMapper
KateOnTheFlyChecker
Definition: ontheflycheck.h:40
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