AspellPluginImpl Class Reference
Implementation of plugin. GUI part is derived from AspellPluginBase class, as aspellpluginbase.{cpp,h} get overwritten by uic. Interface to aspell uses Speller::Aspell::Suggest. More...
#include <aspellpluginimpl.h>

Public Slots | |
| void | on_fcloseBtn_clicked () |
| Slot: Called when the "Close" button is clicked. Makes any pending replacements, and closes spell-check window. | |
| void | on_fchangeBtn_clicked () |
| Slot: Called when the "Change" button is clicked. Replaces the word being checked with the currently selected replacement. | |
| void | on_fchangeAllBtn_clicked () |
| Slot: Called when the "Change All" button is clicked. Replaces all occurrences of the word being checked with the currently selected replacement. | |
| void | on_fskipBtn_clicked () |
| Slot: Called when the "Skip" button is clicked. Skips the word currently being spell-checked. | |
| void | on_fskipAllBtn_clicked () |
| Slot: Called when the "Skip All" button is clicked. Skips all occurences of the word currently being spell-checked. | |
| void | on_faddWordBtn_clicked () |
| Slot: Called when the "Add word" button is clicked. Adds current suggestion to user's personal directory. | |
| void | on_flistReplacements_itemActivated () |
| void | on_flistDicts_activated () |
Public Member Functions | |
| AspellPluginImpl (ScribusDoc *doc, QWidget *parent=NULL) | |
| ~AspellPluginImpl () | |
| Destructor for spell-checking plugin implementation. | |
Protected Slots | |
| void | languageChange () |
Protected Member Functions | |
| void | checkText () |
| Model for list of dictionaries. | |
| void | nextWord () |
| Skips to the beginning of the next word in 'fcontent', the text being spell-checked. | |
| void | setPreferences (const QString &lang, const QString &jargon, const QString &encoding=Speller::Aspell::Suggest::kDEF_ENCODING, const QString &entry=kDEF_ASPELL_ENTRY) |
| void | getPreferences () |
| Retrieve saved user preferences: language, jargon, encoding. | |
| void | activateSpellGUI () |
| Activates spell-checking GUI elements in spell-checking tab, i.e., everything except combo box at top. | |
| void | deactivateSpellGUI () |
| Deactivates spell-checking GUI elements in spell-checking tab, i.e., everything except combo box at top. | |
| void | parseItem () |
| Base method to spell-check text in current frame. | |
| void | parseSelection () |
| Spell-check selected frames in the page. | |
| void | spellCheckDone () |
| Called when spell-checking is completed. Pops up an information dialog. | |
Private Attributes | |
| Speller::Aspell::Suggest * | fsuggest |
| Aspell interface object. | |
| PrefsContext * | fprefs |
| Scribus preferences object. | |
| QString | flang |
| Language for aspell dictionary. | |
| QString | fjargon |
| Jargon for aspell dictionary. | |
| QString | fencoding |
| Character encoding for words. | |
| QString | fentry |
| Formatted string for aspell dictionary entry: Form of <name>--<lang>--<jargon>--<size>. | |
| ScribusDoc * | fdoc |
| Pointer to current document. | |
| struct AspellPluginImpl::Changes | fnchanges |
| QString | fcontent |
| Extracted string of text from one frame. | |
| uint | fpos |
| Position in 'fcontent' of word being spell-checked. | |
| QHash< QString, QString > | rememberedWords |
| int | fidx |
| Index in 'fcontent' of word being spell-checked. | |
| QStringList | fwordlist |
| Word currently being spell-checked. | |
| PageItem * | fFrame |
| Pointer to current frame. | |
Static Private Attributes | |
| static const char * | kDEF_CONTEXT = "AspellPlugin" |
| Context name for storing preferences. | |
| static const QString | kDEF_ASPELL_ENTRY |
Classes | |
| struct | Changes |
| Structure to keep track of number of changes made. More... | |
Detailed Description
Implementation of plugin. GUI part is derived from AspellPluginBase class, as aspellpluginbase.{cpp,h} get overwritten by uic. Interface to aspell uses Speller::Aspell::Suggest.
Definition at line 34 of file aspellpluginimpl.h.
Constructor & Destructor Documentation
| AspellPluginImpl::AspellPluginImpl | ( | ScribusDoc * | doc, | |
| QWidget * | parent = NULL | |||
| ) |
Definition at line 19 of file aspellpluginimpl.cpp.
References activateSpellGUI(), deactivateSpellGUI(), fencoding, fentry, fjargon, flang, fprefs, fsuggest, PrefsFile::getPluginContext(), getPreferences(), PrefsManager::instance(), kDEF_ASPELL_ENTRY, kDEF_CONTEXT, Speller::Aspell::Suggest::listDicts(), parseSelection(), PrefsManager::prefsFile, rememberedWords, ScribusDoc::scMW(), setCurrentComboItem(), ScribusMainWindow::setStatusBarInfoText(), and tr().
| AspellPluginImpl::~AspellPluginImpl | ( | ) |
Destructor for spell-checking plugin implementation.
- Parameters:
-
None
- Return values:
-
None
Definition at line 71 of file aspellpluginimpl.cpp.
References fsuggest, and Speller::Aspell::Suggest::saveLists().
Member Function Documentation
| AspellPluginImpl::checkText | ( | ) | [protected] |
Model for list of dictionaries.
- Parameters:
-
None
- Return values:
-
None
Definition at line 144 of file aspellpluginimpl.cpp.
References Speller::Aspell::Suggest::checkWord(), fcontent, fFrame, fpos, fsuggest, StoryText::insertChars(), PageItem::itemText, StoryText::length(), nextWord(), rememberedWords, StoryText::removeChars(), and StoryText::replaceChar().
Referenced by on_fchangeAllBtn_clicked(), on_fchangeBtn_clicked(), on_fskipAllBtn_clicked(), on_fskipBtn_clicked(), and parseItem().
| AspellPluginImpl::nextWord | ( | ) | [protected] |
Skips to the beginning of the next word in 'fcontent', the text being spell-checked.
- Parameters:
-
None
- Return values:
-
None
Definition at line 125 of file aspellpluginimpl.cpp.
References fcontent, fFrame, fpos, PageItem::itemText, StoryText::length(), StoryText::text(), and wordBoundaries().
Referenced by checkText(), on_fchangeAllBtn_clicked(), on_fchangeBtn_clicked(), on_fskipAllBtn_clicked(), on_fskipBtn_clicked(), and parseItem().
| void AspellPluginImpl::setPreferences | ( | const QString & | lang, | |
| const QString & | jargon, | |||
| const QString & | encoding = Speller::Aspell::Suggest::kDEF_ENCODING, |
|||
| const QString & | entry = kDEF_ASPELL_ENTRY | |||
| ) | [protected] |
Definition at line 397 of file aspellpluginimpl.cpp.
References fprefs, Speller::Aspell::Suggest::kEMPTY, and PrefsContext::set().
Referenced by on_flistDicts_activated().
| AspellPluginImpl::getPreferences | ( | ) | [protected] |
Retrieve saved user preferences: language, jargon, encoding.
- Parameters:
-
None
- Return values:
-
None
Definition at line 386 of file aspellpluginimpl.cpp.
References fencoding, fentry, fjargon, flang, fprefs, PrefsContext::get(), kDEF_ASPELL_ENTRY, Speller::Aspell::Suggest::kDEF_ENCODING, Speller::Aspell::Suggest::kDEF_JARGON, and Speller::Aspell::Suggest::kDEF_LANG.
Referenced by AspellPluginImpl().
| AspellPluginImpl::activateSpellGUI | ( | ) | [protected] |
Activates spell-checking GUI elements in spell-checking tab, i.e., everything except combo box at top.
- Parameters:
-
None
- Return values:
-
None
Definition at line 87 of file aspellpluginimpl.cpp.
Referenced by AspellPluginImpl().
| AspellPluginImpl::deactivateSpellGUI | ( | ) | [protected] |
Deactivates spell-checking GUI elements in spell-checking tab, i.e., everything except combo box at top.
- Parameters:
-
None
- Return values:
-
None
Definition at line 106 of file aspellpluginimpl.cpp.
Referenced by AspellPluginImpl().
| AspellPluginImpl::parseItem | ( | ) | [protected] |
Base method to spell-check text in current frame.
- Parameters:
-
None
- Return values:
-
None
Definition at line 415 of file aspellpluginimpl.cpp.
References PageItem::asTextFrame(), checkText(), fFrame, and nextWord().
Referenced by parseSelection().
| AspellPluginImpl::parseSelection | ( | ) | [protected] |
Spell-check selected frames in the page.
- Parameters:
-
None
- Return values:
-
None
Definition at line 426 of file aspellpluginimpl.cpp.
References Selection::count(), fcontent, fdoc, fFrame, Selection::itemAt(), ScribusDoc::m_Selection, and parseItem().
Referenced by AspellPluginImpl().
| AspellPluginImpl::spellCheckDone | ( | ) | [protected] |
Called when spell-checking is completed. Pops up an information dialog.
- Parameters:
-
None
- Return values:
-
None
Definition at line 207 of file aspellpluginimpl.cpp.
References PageItem::asTextFrame(), ScribusDoc::changed(), ScribusView::DrawNew(), fdoc, fFrame, fnchanges, AspellPluginImpl::Changes::fntot, PageItem_TextFrame::invalidateLayout(), ScribusMainWindow::mainWindowProgressBar, ScribusDoc::scMW(), ScribusMainWindow::setStatusBarInfoText(), tr(), and ScribusDoc::view().
Referenced by on_fcloseBtn_clicked().
| AspellPluginImpl::on_fcloseBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Close" button is clicked. Makes any pending replacements, and closes spell-check window.
- Parameters:
-
None
- Return values:
-
None
Definition at line 227 of file aspellpluginimpl.cpp.
References spellCheckDone().
| AspellPluginImpl::on_fchangeBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Change" button is clicked. Replaces the word being checked with the currently selected replacement.
- Parameters:
-
None
- Return values:
-
None
Definition at line 234 of file aspellpluginimpl.cpp.
References checkText(), fcontent, fFrame, fpos, StoryText::insertChars(), PageItem::itemText, nextWord(), StoryText::removeChars(), and StoryText::replaceChar().
| AspellPluginImpl::on_fchangeAllBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Change All" button is clicked. Replaces all occurrences of the word being checked with the currently selected replacement.
- Parameters:
-
None
- Return values:
-
None
Definition at line 267 of file aspellpluginimpl.cpp.
References checkText(), fcontent, fFrame, fpos, StoryText::insertChars(), PageItem::itemText, nextWord(), rememberedWords, StoryText::removeChars(), and StoryText::replaceChar().
| AspellPluginImpl::on_fskipBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Skip" button is clicked. Skips the word currently being spell-checked.
- Parameters:
-
None
- Return values:
-
None
Definition at line 302 of file aspellpluginimpl.cpp.
References checkText(), fcontent, fpos, and nextWord().
| AspellPluginImpl::on_fskipAllBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Skip All" button is clicked. Skips all occurences of the word currently being spell-checked.
- Parameters:
-
None
- Return values:
-
None
Definition at line 311 of file aspellpluginimpl.cpp.
References checkText(), fcontent, fidx, fpos, fsuggest, fwordlist, Speller::Aspell::Suggest::ignoreWord(), nextWord(), and tr().
| AspellPluginImpl::on_faddWordBtn_clicked | ( | ) | [slot] |
Slot: Called when the "Add word" button is clicked. Adds current suggestion to user's personal directory.
- Parameters:
-
None
- Return values:
-
None
Definition at line 338 of file aspellpluginimpl.cpp.
References Speller::Aspell::Suggest::addPersonalList(), fsuggest, and tr().
| void AspellPluginImpl::on_flistReplacements_itemActivated | ( | ) | [slot] |
Definition at line 357 of file aspellpluginimpl.cpp.
| void AspellPluginImpl::on_flistDicts_activated | ( | ) | [slot] |
Definition at line 365 of file aspellpluginimpl.cpp.
References data, fsuggest, Speller::Aspell::Suggest::kDEF_ENCODING, Speller::Aspell::Suggest::kDICT_DELIM, Speller::Aspell::Suggest::resetConfig(), setPreferences(), and value.
| void AspellPluginImpl::languageChange | ( | ) | [protected, slot] |
Definition at line 410 of file aspellpluginimpl.cpp.
Member Data Documentation
const char * AspellPluginImpl::kDEF_CONTEXT = "AspellPlugin" [static, private] |
Context name for storing preferences.
Definition at line 39 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl().
const QString AspellPluginImpl::kDEF_ASPELL_ENTRY [static, private] |
Initial value:
QString( "en" ) + Speller::Aspell::Suggest::kDICT_DELIM +
QString( "en" ) + Speller::Aspell::Suggest::kDICT_DELIM +
QString( "*" ) + Speller::Aspell::Suggest::kDICT_DELIM +
QString( "60" )
Definition at line 41 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), and getPreferences().
Aspell interface object.
Definition at line 43 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), checkText(), on_faddWordBtn_clicked(), on_flistDicts_activated(), on_fskipAllBtn_clicked(), and ~AspellPluginImpl().
PrefsContext* AspellPluginImpl::fprefs [private] |
Scribus preferences object.
Definition at line 45 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), getPreferences(), and setPreferences().
QString AspellPluginImpl::flang [private] |
Language for aspell dictionary.
Definition at line 47 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), and getPreferences().
QString AspellPluginImpl::fjargon [private] |
Jargon for aspell dictionary.
Definition at line 49 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), and getPreferences().
QString AspellPluginImpl::fencoding [private] |
Character encoding for words.
Definition at line 51 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), and getPreferences().
QString AspellPluginImpl::fentry [private] |
Formatted string for aspell dictionary entry: Form of <name>--<lang>--<jargon>--<size>.
Definition at line 53 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), and getPreferences().
ScribusDoc* AspellPluginImpl::fdoc [private] |
Pointer to current document.
Definition at line 55 of file aspellpluginimpl.h.
Referenced by parseSelection(), and spellCheckDone().
struct AspellPluginImpl::Changes AspellPluginImpl::fnchanges [private] |
Referenced by spellCheckDone().
QString AspellPluginImpl::fcontent [private] |
Extracted string of text from one frame.
Definition at line 78 of file aspellpluginimpl.h.
Referenced by checkText(), nextWord(), on_fchangeAllBtn_clicked(), on_fchangeBtn_clicked(), on_fskipAllBtn_clicked(), on_fskipBtn_clicked(), and parseSelection().
uint AspellPluginImpl::fpos [private] |
Position in 'fcontent' of word being spell-checked.
Definition at line 80 of file aspellpluginimpl.h.
Referenced by checkText(), nextWord(), on_fchangeAllBtn_clicked(), on_fchangeBtn_clicked(), on_fskipAllBtn_clicked(), and on_fskipBtn_clicked().
QHash<QString, QString> AspellPluginImpl::rememberedWords [private] |
Definition at line 81 of file aspellpluginimpl.h.
Referenced by AspellPluginImpl(), checkText(), and on_fchangeAllBtn_clicked().
int AspellPluginImpl::fidx [private] |
Index in 'fcontent' of word being spell-checked.
Definition at line 83 of file aspellpluginimpl.h.
Referenced by on_fskipAllBtn_clicked().
QStringList AspellPluginImpl::fwordlist [private] |
Word currently being spell-checked.
Definition at line 85 of file aspellpluginimpl.h.
Referenced by on_fskipAllBtn_clicked().
PageItem* AspellPluginImpl::fFrame [private] |
Pointer to current frame.
Definition at line 87 of file aspellpluginimpl.h.
Referenced by checkText(), nextWord(), on_fchangeAllBtn_clicked(), on_fchangeBtn_clicked(), parseItem(), parseSelection(), and spellCheckDone().
The documentation for this class was generated from the following files:
