/usr/include/sonnet/speller.h is in kdelibs5-dev 4:4.14.38-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
/*
*
* Copyright (C) 2007 Zack Rusin <zack@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef SONNET_SPELLER_H
#define SONNET_SPELLER_H
#include <QtCore/QStringList>
#include <QtCore/QString>
#include <kdecore_export.h>
class KConfig;
namespace Sonnet
{
/**
* Spell checker object.
*
* @short class used for actuall spell checking
*/
class KDECORE_EXPORT Speller
{
public:
Speller(const QString &lang=QString());
~Speller();
Speller(const Speller &speller);
Speller &operator=(const Speller &speller);
/**
* Returns true if the speller supports currently selected
* language.
*/
bool isValid() const;
/**
* Sets the language supported by this speller.
*/
void setLanguage(const QString &lang);
/**
* Returns language supported by this speller.
*/
QString language() const;
/**
* Checks the given word.
* @return false if the word is misspelled. true otherwise
*/
bool isCorrect(const QString &word) const;
/**
* Checks the given word.
* @return true if the word is misspelled. false otherwise
*/
bool isMisspelled(const QString &word) const;
/**
* Fetches suggestions for the word.
*
* @return list of all suggestions for the word
*/
QStringList suggest(const QString &word) const;
/**
* Convience method calling isCorrect() and suggest()
* if the word isn't correct.
*/
bool checkAndSuggest(const QString &word,
QStringList &suggestions) const;
/**
* Stores user defined good replacement for the bad word.
* @returns true on success
*/
bool storeReplacement(const QString &bad,
const QString &good);
/**
* Adds word to the list of of personal words.
* @return true on success
*/
bool addToPersonal(const QString &word);
/**
* Adds word to the words recognizable in the current session.
* @return true on success
*/
bool addToSession(const QString &word);
public: // Configuration API
enum Attribute {
CheckUppercase,
SkipRunTogether
};
void save(KConfig *config);
void restore(KConfig *config);
/**
* Returns names of all supported backends (e.g. ISpell, ASpell)
*/
QStringList availableBackends() const;
/**
* Returns a list of supported languages.
*
* Note: use availableDictionaries
*/
QStringList availableLanguages() const;
/**
* Returns a localized list of names of supported languages.
*
* Note: use availableDictionaries
*/
QStringList availableLanguageNames() const;
/**
* Returns a map of all available language descriptions and their
* codes
*/
QMap<QString, QString> availableDictionaries() const;
void setDefaultLanguage(const QString &lang);
QString defaultLanguage() const;
void setDefaultClient(const QString &client);
QString defaultClient() const;
void setAttribute(Attribute attr, bool b = true);
bool testAttribute(Attribute attr) const;
private:
class Private;
Private *const d;
};
}
#endif
|