summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KSpell.java
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit90825e2392b2d70e43c7a25b8a3752299a933894 (patch)
treee33aa27f02b74604afbfd0ea4f1cfca8833d882a /kdejava/koala/org/kde/koala/KSpell.java
downloadtdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz
tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdejava/koala/org/kde/koala/KSpell.java')
-rw-r--r--kdejava/koala/org/kde/koala/KSpell.java390
1 files changed, 390 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KSpell.java b/kdejava/koala/org/kde/koala/KSpell.java
new file mode 100644
index 00000000..2e7edb47
--- /dev/null
+++ b/kdejava/koala/org/kde/koala/KSpell.java
@@ -0,0 +1,390 @@
+//Auto-generated by kalyptus. DO NOT EDIT.
+package org.kde.koala;
+
+import org.kde.qt.Qt;
+import org.kde.qt.QMetaObject;
+import org.kde.qt.QtSupport;
+import org.kde.qt.QObject;
+import java.util.ArrayList;
+import org.kde.qt.QWidget;
+import org.kde.qt.QObject;
+
+/**
+
+ %KDE Spellchecker
+ A %KDE programmer's interface to International ISpell 3.1, ASpell,
+ HSpell and ZPSpell..
+ A static method, modalCheck() is provided for convenient
+ access to the spellchecker.
+ See {@link KSpellSignals} for signals emitted by KSpell
+ @author David Sweet <dsweet@kde.org>
+
+ @short %KDE Spellchecker
+ @see KSpellConfig
+ @see KSyntaxHighlighter
+
+*/
+public class KSpell extends QObject {
+ protected KSpell(Class dummy){super((Class) null);}
+ /**
+ Possible states of the spell checker.
+
+ <li>
+ <code>Starting</code> - After creation of KSpell.
+ </li>
+
+ <li>
+ <code>Running</code> - After the ready signal has been emitted.
+ </li>
+
+ <li>
+ <code>Cleaning</code> - After cleanUp() has been called.
+ </li>
+
+ <li>
+ <code>Finished</code> - After cleanUp() has been completed.
+ </li>
+ The following error states exist:
+
+ <li>
+ <code>Error</code> - An error occurred in the <code>Starting</code> state.
+ </li>
+
+ <li>
+ <code>Crashed</code> - An error occurred in the <code>Running</code> state.
+ </li>
+ @short Possible states of the spell checker.
+ */
+ public static final int Starting = 0;
+ public static final int Running = 1;
+ public static final int Cleaning = 2;
+ public static final int Finished = 3;
+ public static final int Error = 4;
+ public static final int Crashed = 5;
+ public static final int FinishedNoMisspellingsEncountered = 6;
+
+ /**
+ These are possible types of documents which the spell checker can check.
+
+ <li>
+ <code>Text</code> - The default type, checks every word
+ </li>
+
+ <li>
+ <code>HTML</code> - For HTML/SGML/XML documents, will skip the tags,
+ </li>
+
+ <li>
+ <code>TeX</code> - For TeX/LaTeX documents, will skip commands,
+ </li>
+
+ <li>
+ <code>Nroff</code> - For nroff/troff documents.
+ </li>
+ Please note that not every option is supported on every type of
+ checker (e.g. ASpell doesn't support Nroff). In case a type
+ of a document is not supported the default Text option will
+ be used.
+ @short These are possible types of documents which the spell checker can check.
+ */
+ public static final int Text = 0;
+ public static final int HTML = 1;
+ public static final int TeX = 2;
+ public static final int Nroff = 3;
+
+ public native QMetaObject metaObject();
+ public native String className();
+ /**
+ Starts the spellchecker.
+ KSpell emits ready() when it has verified that
+ ISpell/ASpell is working properly. Pass the name of a slot -- do not pass zero!
+ Be sure to call cleanUp() when you are done with KSpell.
+ If KSpell could not be started correctly, death() is emitted.
+ @param parent Parent of KSpellConfig dialog..
+ @param caption Caption of KSpellConfig dialog.
+ @param receiver Receiver object for the ready(KSpell ) signal.
+ @param slot Receiver's slot, will be connected to the ready(KSpell ) signal.
+ @param kcs Configuration for KSpell.
+ @param progressbar Indicates if progress bar should be shown.
+ @param modal Indicates modal or non-modal dialog.
+ @short Starts the spellchecker.
+ */
+ public KSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar, boolean modal) {
+ super((Class) null);
+ newKSpell(parent,caption,receiver,slot,kcs,progressbar,modal);
+ }
+ private native void newKSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar, boolean modal);
+ public KSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar) {
+ super((Class) null);
+ newKSpell(parent,caption,receiver,slot,kcs,progressbar);
+ }
+ private native void newKSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar);
+ public KSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs) {
+ super((Class) null);
+ newKSpell(parent,caption,receiver,slot,kcs);
+ }
+ private native void newKSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs);
+ public KSpell(QWidget parent, String caption, QObject receiver, String slot) {
+ super((Class) null);
+ newKSpell(parent,caption,receiver,slot);
+ }
+ private native void newKSpell(QWidget parent, String caption, QObject receiver, String slot);
+ /**
+ Starts the spellchecker.
+ KSpell emits ready() when it has verified that
+ ISpell/ASpell is working properly. Pass the name of a slot -- do not pass zero!
+ Be sure to call cleanUp() when you are done with KSpell.
+ If KSpell could not be started correctly, death() is emitted.
+ @param parent Parent of KSpellConfig dialog..
+ @param caption Caption of KSpellConfig dialog.
+ @param receiver Receiver object for the ready(KSpell ) signal.
+ @param slot Receiver's slot, will be connected to the ready(KSpell ) signal.
+ @param kcs Configuration for KSpell.
+ @param progressbar Indicates if progress bar should be shown.
+ @param modal Indicates modal or non-modal dialog.
+ @param type Type of the document to check
+ @short Starts the spellchecker.
+ */
+ public KSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar, boolean modal, int type) {
+ super((Class) null);
+ newKSpell(parent,caption,receiver,slot,kcs,progressbar,modal,type);
+ }
+ private native void newKSpell(QWidget parent, String caption, QObject receiver, String slot, KSpellConfig kcs, boolean progressbar, boolean modal, int type);
+ /**
+ Returns the status of KSpell.
+ @short Returns the status of KSpell.
+ @see #spellStatus
+ */
+ public native int status();
+ /**
+ Cleans up ISpell.
+ Write out the personal dictionary and close ISpell's
+ stdin. A death() signal will be emitted when the cleanup is
+ complete, but this method will return immediately.
+ @short Cleans up ISpell.
+ */
+ public native void cleanUp();
+ /**
+ Sets the auto-delete flag. If this is set, the KSpell object
+ is automatically deleted after emitting death().
+ @short Sets the auto-delete flag.
+ */
+ public native void setAutoDelete(boolean _autoDelete);
+ /**
+ Spellchecks a buffer of many words in plain text
+ format.
+ The <code>_buffer</code> is not modified. The signal done() will be
+ sent when check() is finished and the argument will be a
+ spell-corrected version of <code>_buffer.</code>
+ The spell check may be stopped by the user before the entire buffer
+ has been checked. You can check lastPosition() to see how far
+ in <code>_buffer</code> check() reached before stopping.
+ @short Spellchecks a buffer of many words in plain text format.
+ */
+ public native boolean check(String _buffer, boolean usedialog);
+ public native boolean check(String _buffer);
+ /**
+ Returns the position (when using check()) or word
+ number (when using checkList()) of
+ the last word checked.
+ @short Returns the position (when using check()) or word number (when using checkList()) of the last word checked.
+ */
+ public native int lastPosition();
+ /**
+ Spellchecks a list of words.
+ checkList() is more flexible than check(). You could parse
+ any type
+ of document (HTML, TeX, etc.) into a list of spell-checkable words
+ and send the list to checkList(). Sending a marked-up document
+ to check() would result in the mark-up tags being
+ spell checked.
+ @short Spellchecks a list of words.
+ */
+ public native boolean checkList(String[] _wordlist, boolean usedialog);
+ public native boolean checkList(String[] _wordlist);
+ /**
+ Spellchecks a single word.
+ checkWord() is the most flexible function. Some applications
+ might need this flexibility but will sacrifice speed when
+ checking large numbers of words. Consider checkList() for
+ checking many words.
+ Use this method for implementing "online" spellchecking (i.e.,
+ spellcheck as-you-type).
+ checkWord() returns <code>false</code> if <code>buffer</code> is not a single word (e.g.
+ if it contains white space), otherwise it returns <code>true</code>;
+ If <code>usedialog</code> is set to <code>true</code>, KSpell will open the standard
+ dialog if the word is not found. The dialog results can be queried
+ by using dlgResult() and replacement().
+ The signal corrected() is emitted when the check is
+ complete. You can look at suggestions() to see what the
+ suggested replacements were.
+ @short Spellchecks a single word.
+ */
+ public native boolean checkWord(String _buffer, boolean usedialog);
+ public native boolean checkWord(String _buffer);
+ public native boolean checkWord(String buffer, boolean _usedialog, boolean suggest);
+ /**
+ Hides the dialog box.
+ You'll need to do this when you are done with checkWord();
+ @short Hides the dialog box.
+ */
+ public native void hide();
+ /**
+ Returns list of suggested word replacements.
+ After calling checkWord() (an in response to
+ a misspelled() signal you can
+ use this to get the list of
+ suggestions (if any were available).
+ @short Returns list of suggested word replacements.
+ */
+ public native ArrayList suggestions();
+ /**
+ Gets the result code of the dialog box.
+ After calling checkWord, you can use this to get the dialog box's
+ result code.
+ The possible
+ values are (from kspelldlg.h):
+
+ <li>
+ KS_CANCEL
+ </li>
+
+ <li>
+ KS_REPLACE
+ </li>
+
+ <li>
+ KS_REPLACEALL
+ </li>
+
+ <li>
+ KS_IGNORE
+ </li>
+
+ <li>
+ KS_IGNOREALL
+ </li>
+
+ <li>
+ KS_ADD
+ </li>
+
+ <li>
+ KS_STOP
+ </li>
+ @short Gets the result code of the dialog box.
+ */
+ public native int dlgResult();
+ /**
+ Moves the dialog.
+ If the dialog is not currently visible, it will
+ be placed at this position when it becomes visible.
+ Use this to get the dialog out of the way of a highlighted
+ misspelled word in a document.
+ @short Moves the dialog.
+ */
+ public native void moveDlg(int x, int y);
+ /**
+ Returns the height of the dialog box.
+ @short Returns the height of the dialog box.
+ */
+ public native int heightDlg();
+ /**
+ Returns the width of the dialog box.
+ @short Returns the width of the dialog box.
+ */
+ public native int widthDlg();
+ /**
+ Returns the partially spellchecked buffer.
+ You might want the full buffer in its partially-checked state.
+ @short Returns the partially spellchecked buffer.
+ */
+ public native String intermediateBuffer();
+ /**
+ Tells ISpell/ASpell to ignore this word for the life of this KSpell instance.
+ @return false if <code>word</code> is not a word or there was an error
+ communicating with ISpell/ASpell.
+
+ @short Tells ISpell/ASpell to ignore this word for the life of this KSpell instance.
+ */
+ public native boolean ignore(String word);
+ /**
+ Adds a word to the user's personal dictionary.
+ @return false if <code>word</code>
+ is not a word or there was an error communicating with ISpell/ASpell.
+
+ @short Adds a word to the user's personal dictionary.
+ */
+ public native boolean addPersonal(String word);
+ /**
+ @return the KSpellConfig object being used by this KSpell instance.
+
+ @short
+ */
+ public native KSpellConfig ksConfig();
+ /**
+ Sets the resolution (in percent) of the progress() signals.
+ E.g. setProgressResolution (10) instructs KSpell to send progress
+ signals (at most) every 10% (10%, 20%, 30%...).
+ The default is 10%.
+ @short Sets the resolution (in percent) of the progress() signals.
+ */
+ public native void setProgressResolution(int res);
+ /**
+ Call setIgnoreUpperWords(true) to tell the spell-checker to ignore
+ words that are completely uppercase. They are spell-checked by default.
+ @short Call setIgnoreUpperWords(true) to tell the spell-checker to ignore words that are completely uppercase.
+ */
+ public native void setIgnoreUpperWords(boolean b);
+ /**
+ Call setIgnoreTitleCase(true) to tell the spell-checker to ignore
+ words with a 'title' case, i.e. starting with an uppercase letter.
+ They are spell-checked by default.
+ @short Call setIgnoreTitleCase(true) to tell the spell-checker to ignore words with a 'title' case, i.
+ */
+ public native void setIgnoreTitleCase(boolean b);
+ /**
+ Performs a synchronous spellcheck.
+ This method does not return until spellchecking is done or canceled.
+ Your application's GUI will still be updated, however.
+ This overloaded method uses the spell-check configuration passed as parameter.
+ @short Performs a synchronous spellcheck.
+ */
+ public static native int modalCheck(StringBuffer text, KSpellConfig kcs);
+ protected native int parseOneResponse(String _buffer, StringBuffer word, String[] sugg);
+ protected native String funnyWord(String word);
+ protected native void dialog(String word, String[] sugg, String _slot);
+ protected native String replacement();
+ protected native void setUpDialog(boolean reallyusedialogbox);
+ protected native void setUpDialog();
+ protected native void emitProgress();
+ protected native boolean cleanFputs(String s, boolean appendCR);
+ protected native boolean cleanFputs(String s);
+ protected native boolean cleanFputsWord(String s, boolean appendCR);
+ protected native boolean cleanFputsWord(String s);
+ protected native void startIspell();
+ protected native boolean writePersonalDictionary();
+ protected native void initialize(QWidget _parent, String _caption, QObject arg3, String slot, KSpellConfig _ksc, boolean _progressbar, boolean _modal, int type);
+ protected native void KSpell2(KProcIO arg1);
+ protected native void checkWord2(KProcIO arg1);
+ protected native void checkWord3();
+ protected native void check2(KProcIO arg1);
+ protected native void checkList2();
+ protected native void checkList3a(KProcIO arg1);
+ protected native void checkListReplaceCurrent();
+ protected native void checkList4();
+ protected native void dialog2(int dlgresult);
+ protected native void check3();
+ protected native void suggestWord(KProcIO arg1);
+ protected native void slotStopCancel(int arg1);
+ protected native void ispellExit(KProcess arg1);
+ protected native void emitDeath();
+ protected native void ispellErrors(KProcess arg1, String arg2, int arg3);
+ protected native void checkNext();
+ /** Deletes the wrapped C++ instance */
+ protected native void finalize() throws InternalError;
+ /** Delete the wrapped C++ instance ahead of finalize() */
+ public native void dispose();
+ /** Has the wrapped C++ instance been deleted? */
+ public native boolean isDisposed();
+}