KSpell2::Broker Class Reference

Class used to deal with dictionaries. More...

#include <broker.h>

Inheritance diagram for KSpell2::Broker:
QObject

List of all members.

Public Types

typedef KSharedPtr< BrokerPtr

Signals

void configurationChanged ()

Public Member Functions

DefaultDictionary * defaultDictionary () const
Dictionarydictionary (const QString &language=QString::null, const QString &client=QString::null) const
QStringList clients () const
QStringList languages () const
Settings * settings () const

Static Public Member Functions

static BrokeropenBroker (KSharedConfig *config=0)

Protected Member Functions

void changed ()

Friends

class Settings

Detailed Description

Class used to deal with dictionaries.

This class manages all dictionaries. It's the top level KSpell2 class, you can think of it as the kernel or manager of the KSpell2 architecture.

Definition at line 48 of file broker.h.


Member Function Documentation

QStringList KSpell2::Broker::clients (  )  const

Returns names of all supported clients (e.g.

ISpell, ASpell)

Definition at line 159 of file broker.cpp.

void KSpell2::Broker::configurationChanged (  )  [signal]

Signal is emitted whenever the Settings object associated with this Broker changes.

DefaultDictionary * KSpell2::Broker::defaultDictionary (  )  const

Function returns the so-called DefaultDictionary.

It's a special form a dictionary which automatically mutates according to changes tot the KSpell2::Settings object. You also can't delete it like other dictionaries since it's owned by the Broker and it will take care of it.

Definition at line 109 of file broker.cpp.

Dictionary * KSpell2::Broker::dictionary ( const QString language = QString::null,
const QString client = QString::null 
) const

Returns dictionary for the given language and preferred client.

Parameters:
language specifies the language of the dictionary. If an empty string will be passed the default language will be used. Has to be one of the values returned by languages()
client specifies the preferred client. If no client is specified a client which supports the given language is picked. If a few clients supports the same language the one with the biggest reliability value is returned.

Definition at line 114 of file broker.cpp.

QStringList KSpell2::Broker::languages (  )  const

Returns a list of supported languages.

Definition at line 164 of file broker.cpp.

Broker * KSpell2::Broker::openBroker ( KSharedConfig *  config = 0  )  [static]

Constructs the broker.

It's very important that you assign it to Broker::Ptr as soon as possible. Broker is reference counted so if you don't want to have it deleted under you simply have to hold it in a Broker::Ptr for as long as you're using it.

Parameters:
config is the name of config file which broker should use to read default language and default client values. If no value will be passed Broker will use global kspellrc file.

Definition at line 59 of file broker.cpp.

Settings * KSpell2::Broker::settings (  )  const

Returns the Settings object used by the broker.

Definition at line 169 of file broker.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys