[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [pykde5] /: Added sonnet support.
From:       Simon Edwards <simon () simonzone ! com>
Date:       2014-03-31 18:12:05
Message-ID: E1WUggn-00078o-AZ () scm ! kde ! org
[Download RAW message or body]

Git commit 92be485db4ace198c90ca54003ffda7556c4f90e by Simon Edwards.
Committed on 31/03/2014 at 18:09.
Pushed by sedwards into branch 'master'.

Added sonnet support.

M  +9    -5    CMakeLists.txt
A  +53   -0    sip/sonnet/backgroundchecker.sip
A  +70   -0    sip/sonnet/configdialog.sip
A  +70   -0    sip/sonnet/configwidget.sip
A  +61   -0    sip/sonnet/dialog.sip
A  +51   -0    sip/sonnet/dictionarycombobox.sip
A  +34   -0    sip/sonnet/guesslanguage.sip
A  +69   -0    sip/sonnet/highlighter.sip
A  +39   -0    sip/sonnet/sonnetmod.sip
A  +37   -0    sip/sonnet/spellcheckdecorator.sip
A  +62   -0    sip/sonnet/speller.sip

http://commits.kde.org/pykde5/92be485db4ace198c90ca54003ffda7556c4f90e

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c0f8802..13bf9c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,12 +88,17 @@ get_property(qt5widgets_include TARGET Qt5::Widgets PROPERTY INTERFACE_INCLUDE_D
 get_property(solid_include TARGET KF5::Solid PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
 # Soild is being difficult. Lets set it here explicitly.
 
+get_property(kf5sonnetcore_include TARGET KF5::SonnetCore PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+get_property(kf5sonnetui_include TARGET KF5::SonnetUi PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+
 include_directories(
     ${SIP_INCLUDE_DIR}
     ${qt5core_include}
     ${qt5gui_include}
     ${qt5widgets_include}
     ${solid_include}/solid
+    ${kf5sonnetcore_include}/SonnetCore/sonnet
+    ${kf5sonnetcore_include}/SonnetUi/sonnet
 )
 
 add_definitions(-D_REENTRANT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public)
@@ -138,12 +143,11 @@ set(SIP_EXTRA_FILES_DEPEND ${kcoreaddons_files_sip})
 add_sip_python_module(PyKDE5.kcoreaddons sip/kcoreaddons/kcoreaddonsmod.sip KF5::CoreAddons)
 
 # sonnet
-#file(GLOB sonnet_files_sip sip/sonnet/*.sip)
-#set(SIP_EXTRA_FILES_DEPEND ${sonnet_files_sip})
-#add_sip_python_module(PyKDE5.sonnet sip/sonnet/sonnetmod.sip KF5::SonnetCore KF5::SonnetUi)
-
+file(GLOB sonnet_files_sip sip/sonnet/*.sip)
+set(SIP_EXTRA_FILES_DEPEND ${sonnet_files_sip})
+add_sip_python_module(PyKDE5.sonnet sip/sonnet/sonnetmod.sip KF5::SonnetCore KF5::SonnetUi)
 
-set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoreaddons")
+set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoreaddons sonnet")
 
 ###############################################################################
 
diff --git a/sip/sonnet/backgroundchecker.sip b/sip/sonnet/backgroundchecker.sip
new file mode 100644
index 0000000..0639bb5
--- /dev/null
+++ b/sip/sonnet/backgroundchecker.sip
@@ -0,0 +1,53 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class BackgroundChecker : QObject
+{
+%TypeHeaderCode
+#include <backgroundchecker.h>
+%End
+
+public:
+    explicit                BackgroundChecker (QObject* parent = 0);
+    explicit                BackgroundChecker (const Sonnet::Speller& speller, QObject* parent = 0);
+    ~BackgroundChecker ();
+    void                    setText (const QString& text);
+    QString                 text () const;
+    QString                 currentContext () const;
+    Sonnet::Speller         speller () const;
+    void                    setSpeller (const Sonnet::Speller& speller);
+    bool                    checkWord (const QString& word);
+    QStringList             suggest (const QString& word) const;
+    bool                    addWordToPersonal (const QString& word);
+    virtual void            start ();
+    virtual void            stop ();
+    void                    replace (int start, const QString& oldText, const QString& newText);
+    void                    changeLanguage (const QString& lang);
+    virtual void            continueChecking ();
+signals:
+    void                    misspelling (const QString& word, int start);
+    void                    done ();
+protected:
+    virtual QString         fetchMoreText ();
+    virtual void            finishedCurrentFeed ();
+    void                    slotEngineDone ();
+};
+};
diff --git a/sip/sonnet/configdialog.sip b/sip/sonnet/configdialog.sip
new file mode 100644
index 0000000..f360858
--- /dev/null
+++ b/sip/sonnet/configdialog.sip
@@ -0,0 +1,70 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class ConfigDialog : QDialog
+{
+%TypeHeaderCode
+#include <configdialog.h>
+%End
+
+public:
+    explicit                ConfigDialog (QWidget* parent);
+    ~ConfigDialog ();
+    void                    setLanguage (const QString& language);
+    QString                 language () const;
+protected:
+    virtual void            slotOk ();
+    virtual void            slotApply ();
+signals:
+    void                    languageChanged (const QString& language);
+    void                    configChanged ();
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'QObject'
+    sipType = NULL;
+
+    if (dynamic_cast<Sonnet::Highlighter*>(sipCpp))
+        sipType = sipType_Sonnet_Highlighter;
+    else if (dynamic_cast<Sonnet::DictionaryComboBox*>(sipCpp))
+        sipType = sipType_Sonnet_DictionaryComboBox;
+    else if (dynamic_cast<Sonnet::ConfigDialog*>(sipCpp))
+        sipType = sipType_Sonnet_ConfigDialog;
+    else if (dynamic_cast<Sonnet::Dialog*>(sipCpp))
+        sipType = sipType_Sonnet_Dialog;
+    else if (dynamic_cast<Sonnet::ConfigWidget*>(sipCpp))
+        sipType = sipType_Sonnet_ConfigWidget;
+    else if (dynamic_cast<Sonnet::BackgroundChecker*>(sipCpp))
+        sipType = sipType_Sonnet_BackgroundChecker;
+    else if (dynamic_cast<Sonnet::SpellCheckDecorator*>(sipCpp))
+        sipType = sipType_Sonnet_SpellCheckDecorator;
+%End
+};
+};
+%ModuleHeaderCode
+//ctscc
+#include <backgroundchecker.h>
+#include <configdialog.h>
+#include <configwidget.h>
+#include <dialog.h>
+#include <dictionarycombobox.h>
+#include <highlighter.h>
+#include <qobject.h>
+#include <spellcheckdecorator.h>
+%End
diff --git a/sip/sonnet/configwidget.sip b/sip/sonnet/configwidget.sip
new file mode 100644
index 0000000..cedd770
--- /dev/null
+++ b/sip/sonnet/configwidget.sip
@@ -0,0 +1,70 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class ConfigWidget : QWidget
+{
+%TypeHeaderCode
+#include <configwidget.h>
+%End
+
+public:
+    explicit                ConfigWidget (QWidget* parent);
+    ~ConfigWidget ();
+    bool                    backgroundCheckingButtonShown () const;
+    void                    setLanguage (const QString& language);
+    QString                 language () const;
+    void                    save ();
+    void                    setBackgroundCheckingButtonShown (bool);
+    void                    slotDefault ();
+protected:
+    void                    slotIgnoreWordRemoved ();
+    void                    slotIgnoreWordAdded ();
+signals:
+    void                    configChanged ();
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'QObject'
+    sipType = NULL;
+
+    if (dynamic_cast<Sonnet::Highlighter*>(sipCpp))
+        sipType = sipType_Sonnet_Highlighter;
+    else if (dynamic_cast<Sonnet::DictionaryComboBox*>(sipCpp))
+        sipType = sipType_Sonnet_DictionaryComboBox;
+    else if (dynamic_cast<Sonnet::ConfigDialog*>(sipCpp))
+        sipType = sipType_Sonnet_ConfigDialog;
+    else if (dynamic_cast<Sonnet::Dialog*>(sipCpp))
+        sipType = sipType_Sonnet_Dialog;
+    else if (dynamic_cast<Sonnet::ConfigWidget*>(sipCpp))
+        sipType = sipType_Sonnet_ConfigWidget;
+    else if (dynamic_cast<Sonnet::SpellCheckDecorator*>(sipCpp))
+        sipType = sipType_Sonnet_SpellCheckDecorator;
+%End
+};
+};
+%ModuleHeaderCode
+//ctscc
+#include <configdialog.h>
+#include <configwidget.h>
+#include <dialog.h>
+#include <dictionarycombobox.h>
+#include <highlighter.h>
+#include <qobject.h>
+#include <spellcheckdecorator.h>
+%End
diff --git a/sip/sonnet/dialog.sip b/sip/sonnet/dialog.sip
new file mode 100644
index 0000000..b40c8a8
--- /dev/null
+++ b/sip/sonnet/dialog.sip
@@ -0,0 +1,61 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class Dialog : QDialog
+{
+%TypeHeaderCode
+#include <dialog.h>
+%End
+
+public:
+    ~Dialog ();
+    QString                 originalBuffer () const;
+    QString                 buffer () const;
+    void                    show ();
+    void                    activeAutoCorrect (bool _active);
+    void                    showProgressDialog (int timeout = 500);
+    void                    showSpellCheckCompletionMessage (bool b = 1);
+    void                    setSpellCheckContinuedAfterReplacement (bool b);
+    void                    setBuffer (const QString&);
+signals:
+    void                    done (const QString& newBuffer);
+    void                    misspelling (const QString& word, int start);
+    void                    replace (const QString& oldWord, int start, const QString& newWord);
+    void                    stop ();
+    void                    cancel ();
+    void                    autoCorrect (const QString& currentWord, const QString& replaceWord);
+    void                    spellCheckStatus (const QString&);
+    void                    languageChanged (const QString& language);
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'Dialog'
+    sipType = NULL;
+
+    if (dynamic_cast<Sonnet::Dialog*>(sipCpp))
+        sipType = sipType_Sonnet_Dialog;
+%End
+public:
+                            Dialog (Sonnet::BackgroundChecker* checker, QWidget* parent);
+};
+};
+%ModuleHeaderCode
+//ctscc
+#include <dialog.h>
+%End
diff --git a/sip/sonnet/dictionarycombobox.sip b/sip/sonnet/dictionarycombobox.sip
new file mode 100644
index 0000000..967b860
--- /dev/null
+++ b/sip/sonnet/dictionarycombobox.sip
@@ -0,0 +1,51 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class DictionaryComboBox : QComboBox
+{
+%TypeHeaderCode
+#include <dictionarycombobox.h>
+%End
+
+public:
+    explicit                DictionaryComboBox (QWidget* parent = 0);
+    ~DictionaryComboBox ();
+    void                    reloadCombo ();
+    QString                 currentDictionaryName () const;
+    QString                 currentDictionary () const;
+    void                    setCurrentByDictionaryName (const QString& dictionaryName);
+    void                    setCurrentByDictionary (const QString& dictionary);
+signals:
+    void                    dictionaryChanged (const QString& dictionary);
+    void                    dictionaryNameChanged (const QString& dictionaryName);
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'DictionaryComboBox'
+    sipType = NULL;
+
+    if (dynamic_cast<Sonnet::DictionaryComboBox*>(sipCpp))
+        sipType = sipType_Sonnet_DictionaryComboBox;
+%End
+};
+};
+%ModuleHeaderCode
+//ctscc
+#include <dictionarycombobox.h>
+%End
diff --git a/sip/sonnet/guesslanguage.sip b/sip/sonnet/guesslanguage.sip
new file mode 100644
index 0000000..d11f0f3
--- /dev/null
+++ b/sip/sonnet/guesslanguage.sip
@@ -0,0 +1,34 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class GuessLanguage /NoDefaultCtors/
+{
+%TypeHeaderCode
+#include <guesslanguage.h>
+%End
+
+public:
+                            GuessLanguage ();
+    ~GuessLanguage ();
+    void                    setLimits (int maxItems, double minConfidence);
+    QString                 identify (const QString& text, const QStringList& suggestions = QStringList()) const;
+};
+};
diff --git a/sip/sonnet/highlighter.sip b/sip/sonnet/highlighter.sip
new file mode 100644
index 0000000..3489c8a
--- /dev/null
+++ b/sip/sonnet/highlighter.sip
@@ -0,0 +1,69 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class Highlighter : QSyntaxHighlighter
+{
+%TypeHeaderCode
+#include <highlighter.h>
+%End
+
+public:
+    explicit                Highlighter (QTextEdit* textEdit, const QColor& col = QColor());
+    ~Highlighter ();
+    bool                    spellCheckerFound () const;
+    QString                 currentLanguage () const;
+    void                    setActive (bool active);
+    bool                    isActive () const;
+    bool                    automatic () const;
+    void                    setAutomatic (bool automatic);
+    void                    addWordToDictionary (const QString& word);
+    void                    ignoreWord (const QString& word);
+    QStringList             suggestionsForWord (const QString& word, int max = 10);
+    bool                    isWordMisspelled (const QString& word);
+    void                    setMisspelledColor (const QColor& color);
+    bool                    checkerEnabledByDefault () const;
+signals:
+    void                    activeChanged (const QString& description);
+protected:
+    virtual void            highlightBlock (const QString& text);
+    virtual void            setMisspelled (int start, int count);
+    virtual void            unsetMisspelled (int start, int count);
+    bool                    eventFilter (QObject* o, QEvent* e);
+    bool                    intraWordEditing () const;
+    void                    setIntraWordEditing (bool editing);
+public:
+    void                    setCurrentLanguage (const QString& language);
+    void                    slotAutoDetection ();
+    void                    slotRehighlight ();
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'Highlighter'
+    sipType = NULL;
+
+    if (dynamic_cast<Sonnet::Highlighter*>(sipCpp))
+        sipType = sipType_Sonnet_Highlighter;
+%End
+    void                    setDocument (QTextDocument* document);
+};
+};
+%ModuleHeaderCode
+//ctscc
+#include <highlighter.h>
+%End
diff --git a/sip/sonnet/sonnetmod.sip b/sip/sonnet/sonnetmod.sip
new file mode 100644
index 0000000..c9a39cf
--- /dev/null
+++ b/sip/sonnet/sonnetmod.sip
@@ -0,0 +1,39 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+%Module PyKDE5.sonnet
+
+%ModuleHeaderCode
+#pragma GCC visibility push(default)
+%End
+
+%Import typedefs.sip
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+%Import QtWidgets/QtWidgetsmod.sip
+
+%Include backgroundchecker.sip
+%Include guesslanguage.sip
+%Include speller.sip
+%Include configdialog.sip
+%Include configwidget.sip
+%Include dialog.sip
+%Include dictionarycombobox.sip
+%Include highlighter.sip
+%Include spellcheckdecorator.sip
diff --git a/sip/sonnet/spellcheckdecorator.sip b/sip/sonnet/spellcheckdecorator.sip
new file mode 100644
index 0000000..6284ba2
--- /dev/null
+++ b/sip/sonnet/spellcheckdecorator.sip
@@ -0,0 +1,37 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class SpellCheckDecorator : QObject
+{
+%TypeHeaderCode
+#include <spellcheckdecorator.h>
+%End
+
+public:
+    explicit                SpellCheckDecorator (QTextEdit* textEdit);
+    ~SpellCheckDecorator ();
+    void                    setHighlighter (Sonnet::Highlighter* highlighter);
+    Sonnet::Highlighter*    highlighter () const;
+protected:
+    bool                    eventFilter (QObject* obj, QEvent* event);
+    virtual bool            isSpellCheckingEnabledForBlock (const QString& textBlock) const;
+};
+};
diff --git a/sip/sonnet/speller.sip b/sip/sonnet/speller.sip
new file mode 100644
index 0000000..98f2eac
--- /dev/null
+++ b/sip/sonnet/speller.sip
@@ -0,0 +1,62 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program 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 General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+namespace Sonnet
+{
+class Speller
+{
+%TypeHeaderCode
+#include <speller.h>
+%End
+
+public:
+    explicit                Speller (const QString& lang = QString());
+    ~Speller ();
+                            Speller (const Sonnet::Speller& speller);
+//ig    Sonnet::Speller&        operator= (const Sonnet::Speller& speller);
+    bool                    isValid () const;
+    void                    setLanguage (const QString& lang);
+    QString                 language () const;
+    bool                    isCorrect (const QString& word) const;
+    bool                    isMisspelled (const QString& word) const;
+    QStringList             suggest (const QString& word) const;
+    bool                    checkAndSuggest (const QString& word, QStringList& suggestions) const;
+    bool                    storeReplacement (const QString& bad, const QString& good);
+    bool                    addToPersonal (const QString& word);
+    bool                    addToSession (const QString& word);
+    enum Attribute
+    {
+        CheckUppercase,
+        SkipRunTogether,
+        AutoDetectLanguage
+    };
+    void                    save ();
+    void                    restore ();
+    QStringList             availableBackends () const;
+    QStringList             availableLanguages () const;
+    QStringList             availableLanguageNames () const;
+    QMap<QString,QString>   availableDictionaries () const;
+    void                    setDefaultLanguage (const QString& lang);
+    QString                 defaultLanguage () const;
+    void                    setDefaultClient (const QString& client);
+    QString                 defaultClient () const;
+    void                    setAttribute (Sonnet::Speller::Attribute attr, bool b = 1);
+    bool                    testAttribute (Sonnet::Speller::Attribute attr) const;
+};
+};
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic