TDE core libraries
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Slávek Banko 8a859540c3
Use system libdir when searching for dynamically loaded libraries.
2 месяцев назад
..
plugins Use system libdir when searching for dynamically loaded libraries. This prevents finding an incorrect architecture on multi-arch systems. 2 месяцев назад
tests qt -> tqt conversion: QT_NO_ASCII_CAST -> TQT_NO_ASCII_CAST QT_NO_STL -> TQT_NO_STL QT_NO_COMPAT -> TQT_NO_COMPAT QT_NO_TRANSLATION -> TQT_NO_TRANSLATION 7 месяцев назад
ui qt -> tqt conversion: QT_NO_ASCII_CAST -> TQT_NO_ASCII_CAST QT_NO_STL -> TQT_NO_STL QT_NO_COMPAT -> TQT_NO_COMPAT QT_NO_TRANSLATION -> TQT_NO_TRANSLATION 7 месяцев назад
CMakeLists.txt Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
Makefile.am qt -> tqt conversion: QT_NO_ASCII_CAST -> TQT_NO_ASCII_CAST QT_NO_STL -> TQT_NO_STL QT_NO_COMPAT -> TQT_NO_COMPAT QT_NO_TRANSLATION -> TQT_NO_TRANSLATION 7 месяцев назад
README Rename KShared 6 лет назад
backgroundchecker.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
backgroundchecker.h Additional k => tde renaming and fixes 5 лет назад
backgroundengine.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
backgroundengine.h Additional k => tde renaming and fixes 5 лет назад
backgroundthread.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
backgroundthread.h Additional k => tde renaming and fixes 5 лет назад
broker.cpp Rename KLock and KTrader to avoid conflicts with KDE4 6 лет назад
broker.h Additional k => tde renaming and fixes 5 лет назад
client.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
client.h Additional k => tde renaming and fixes 5 лет назад
defaultdictionary.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
defaultdictionary.h Additional k => tde renaming and fixes 5 лет назад
dictionary.h Additional k => tde renaming and fixes 5 лет назад
filter.cpp Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
filter.h Additional k => tde renaming and fixes 5 лет назад
settings.cpp Rename additional header files to avoid conflicts with KDE4 6 лет назад
settings.h Additional k => tde renaming and fixes 5 лет назад
tdespellclient.desktop Rename a number of libraries and executables to avoid conflicts with KDE4 6 лет назад
threadevents.h Additional k => tde renaming and fixes 5 лет назад

README

This is KSpell 2 beta implementation. KSpell 2 is completely in
process and is plugin based.

The main class in the KSpell 2 is the KSpell::Broker. Broker is
responsible for loading all the plugins and creating the actual
dictionaries.

Dictionaries are abstracted in the KSpell::Dictionary object which
encapsulates all spell-checking functionality.

You'll notice that the Broker is being created via the
Broker::Ptr Broker::openBroker( TDESharedConfig *config =0 );
call. The Broker is a shared object and the reason for this construct
is very simple:
- most application would need to have a few Broker objects (one for
the dialog dictionaries, one for the background spell checking, one
for the suggestion dictionaries) and because Broker loads plugins on
creation it would be ineffective to have a few redundant Broker
objects in one application,
- each Broker maps to a configuration file. If one Broker would change
in the application, all others would have to reparse and repopulate
the options, which would be really inefficient.

Due to the above you deal with the broker via the Broker::Ptr
interface.

Once you have the Broker object in your application, you can ask it
for a Dictionary of some language. If such a dictionary is available
you get it back as a Dictionary class and you use that class to do the
actual spell checking.

Broker on construction checks for available KSpell::Client's which are
loaded as dynamic plugins. It's the actual KSpell::Client that gives
the broker the KSpell::Dictionary.
One can specify a default client and the default language for a Broker
theough the settings() method and the KSpell::Settings class which it
returns.

Also note that you can have dictionaries for multiple languages in
your application.
And most importantly the interface to KSpell::Dictionary is
synchronous so once you pass a word to check you don't have to wait
for any signals - you get corrections right back.
Sample usage of KSpell 2 looks like follows:

#include <tdespell_broker.h>
#include <tdespell_dictionary.h>
using namespace KSpell;


Broker::Ptr broker = Broker::openBroker( someKSettingsObject );
Dictionary *enDict = broker->dictionary( "en_US" );
Dictionary *deDict = broker->dictionary( "de_DE" );

void someFunc( const QString& word )
{
if ( enDict->check( word ) ) {
kdDebug()<<"Word \""<<word<<"\" is misspelled." <<endl;
QStringList suggestion = enDict->suggest( word );
kdDebug()<<"Suggestions: "<< suggestions <<endl;
}

QStringList suggestions;
if ( deDict->checkAndSuggest( word, suggestions ) ) {
kdDebug()<<"Wort \""<<word<<"\" ist fehlbuchstabiert." <<endl;
kdDebug()<<"Vorschlage: "<< suggestions <<endl;
}
}

delete enDict;
delete deDict;