LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
ispellcheckprovider.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <memory>
12 #include <QtPlugin>
13 
23 {
24 public:
27  virtual ~ISpellChecker () {}
28 
44  virtual bool IsCorrect (const QString& word) const = 0;
45 
57  virtual QStringList GetPropositions (const QString& word) const = 0;
58 
70  virtual void LearnWord (const QString& word) = 0;
71 };
72 
75 using ISpellChecker_ptr = std::shared_ptr<ISpellChecker>;
76 
90 {
91 protected:
92  virtual ~ISpellCheckProvider () {}
93 public:
100  virtual ISpellChecker_ptr CreateSpellchecker () = 0;
101 };
102 
103 Q_DECLARE_INTERFACE (ISpellChecker, "org.LeechCraft.ISpellChecker/1.0")
104 Q_DECLARE_INTERFACE (ISpellCheckProvider, "org.LeechCraft.ISpellCheckProvider/1.0")
ISpellChecker::GetPropositions
virtual QStringList GetPropositions(const QString &word) const =0
Returns the list of propositions for the word.
ISpellChecker::IsCorrect
virtual bool IsCorrect(const QString &word) const =0
Returns if the given word is correct.
ISpellCheckProvider::~ISpellCheckProvider
virtual ~ISpellCheckProvider()
Definition: ispellcheckprovider.h:92
ISpellCheckProvider
Interface for plugins providing spell checker capabilities.
Definition: ispellcheckprovider.h:89
ISpellChecker::~ISpellChecker
virtual ~ISpellChecker()
Destroys the spell checker instance.
Definition: ispellcheckprovider.h:33
ISpellChecker
An instance of a spell checker.
Definition: ispellcheckprovider.h:22
ISpellCheckProvider::CreateSpellchecker
virtual ISpellChecker_ptr CreateSpellchecker()=0
Requests a new spellchecker.
ISpellChecker::LearnWord
virtual void LearnWord(const QString &word)=0
Asks the spell checker to learn the given word.
ISpellChecker_ptr
std::shared_ptr< ISpellChecker > ISpellChecker_ptr
A shared pointer to an ISpellChecker instance.
Definition: ispellcheckprovider.h:75