9 #include "kmlineeditspell.h" 11 #define REALLY_WANT_KMCOMPOSEWIN_H 12 #include "kmcomposewin.h" 13 #undef REALLY_WANT_KMCOMPOSEWIN_H 14 #include "kmmsgdict.h" 16 #include "kmcommands.h" 18 #include <maillistdrag.h> 19 using KPIM::MailListDrag;
21 #include <libtdepim/tdefileio.h> 22 #include <libemailfunctions/email.h> 27 #include <tdepopupmenu.h> 29 #include <tdemessagebox.h> 32 #include <tdetempfile.h> 33 #include <tdelocale.h> 34 #include <tdeapplication.h> 35 #include <kdirwatch.h> 36 #include <kiconloader.h> 38 #include "globalsettings.h" 39 #include "replyphrases.h" 42 #include <tdespelldlg.h> 43 #include <spellingfilter.h> 44 #include <ksyntaxhighlighter.h> 51 #include <sys/types.h> 59 void KMEdit::contentsDragEnterEvent(TQDragEnterEvent *e)
61 if (e->provides(MailListDrag::format()))
63 else if (e->provides(
"image/png"))
66 return KEdit::contentsDragEnterEvent(e);
69 void KMEdit::contentsDragMoveEvent(TQDragMoveEvent *e)
71 if (e->provides(MailListDrag::format()))
73 else if (e->provides(
"image/png"))
76 return KEdit::contentsDragMoveEvent(e);
79 void KMEdit::keyPressEvent( TQKeyEvent* e )
81 if( e->key() == Key_Return ) {
83 getCursorPosition( &line, &col );
84 TQString lineText = text( line );
86 lineText.truncate( lineText.length() - 1 );
89 if( ( col > 0 ) && ( col < int( lineText.length() ) ) ) {
90 bool isQuotedLine =
false;
92 while( bot < lineText.length() ) {
93 if( ( lineText[bot] ==
'>' ) || ( lineText[bot] ==
'|' ) ) {
97 else if( lineText[bot].isSpace() ) {
105 KEdit::keyPressEvent( e );
111 && ( bot != lineText.length() )
112 && ( col >=
int( bot ) ) ) {
116 getCursorPosition( &line, &col );
117 TQString newLine = text( line );
120 unsigned int leadingWhiteSpaceCount = 0;
121 while( ( leadingWhiteSpaceCount < newLine.length() )
122 && newLine[leadingWhiteSpaceCount].isSpace() ) {
123 ++leadingWhiteSpaceCount;
125 newLine = newLine.replace( 0, leadingWhiteSpaceCount,
126 lineText.left( bot ) );
127 removeParagraph( line );
128 insertParagraph( newLine, line );
132 setCursorPosition( line, 0 );
136 KEdit::keyPressEvent( e );
139 KEdit::keyPressEvent( e );
142 void KMEdit::contentsDropEvent(TQDropEvent *e)
144 if (e->provides(MailListDrag::format())) {
147 MailListDrag::decode( e, serNums );
148 TQBuffer serNumBuffer(serNums);
149 serNumBuffer.open(IO_ReadOnly);
150 TQDataStream serNumStream(&serNumBuffer);
154 TQPtrList<KMMsgBase> messageList;
155 while (!serNumStream.atEnd()) {
156 KMMsgBase *msgBase = 0;
157 serNumStream >> serNum;
162 messageList.append( msgBase );
164 serNumBuffer.close();
165 uint identity = folder ? folder->identity() : 0;
167 new KMForwardAttachedCommand(mComposer, messageList,
168 identity, mComposer);
171 else if( e->provides(
"image/png") ) {
172 emit attachPNGImageData(e->encodedData(
"image/png"));
174 else if( KURLDrag::canDecode( e ) ) {
176 if( KURLDrag::decode( e, urlList ) ) {
178 p.insertItem( i18n(
"Add as Text"), 0 );
179 p.insertItem( i18n(
"Add as Attachment"), 1 );
180 int id = p.exec( mapToGlobal( e->pos() ) );
183 for ( KURL::List::Iterator it = urlList.begin();
184 it != urlList.end(); ++it ) {
185 insert( (*it).url() );
189 for ( KURL::List::Iterator it = urlList.begin();
190 it != urlList.end(); ++it ) {
191 mComposer->addAttach( *it );
196 else if ( TQTextDrag::canDecode( e ) ) {
198 if ( TQTextDrag::decode( e, s ) )
202 kdDebug(5006) <<
"KMEdit::contentsDropEvent, unable to add dropped object" << endl;
204 else if( e->provides(
"text/x-textsnippet") ) {
205 emit insertSnippet();
208 KEdit::contentsDropEvent(e);
212 KMEdit::KMEdit(TQWidget *parent, KMComposeWin* composer,
213 KSpellConfig* autoSpellConfig,
215 : KEdit( parent, name ),
216 mComposer( composer ),
217 mKSpellForDialog( 0 ),
219 mSpellConfig( autoSpellConfig ),
220 mSpellingFilter( 0 ),
221 mExtEditorTempFile( 0 ),
222 mExtEditorTempFileWatcher( 0 ),
223 mExtEditorProcess( 0 ),
224 mUseExtEditor( false ),
225 mWasModifiedBeforeSpellCheck( false ),
227 mSpellLineEdit( false ),
228 mPasteMode( TQClipboard::Clipboard )
230 connect(
this, TQT_SIGNAL(selectionChanged()),
this, TQT_SLOT(slotSelectionChanged()) );
231 installEventFilter(
this);
232 KCursor::setAutoHideCursor(
this,
true,
true );
233 setOverwriteEnabled(
true );
235 connect( mSpellConfig, TQT_SIGNAL( configChanged() ),
236 this, TQT_SLOT( createSpellers() ) );
237 connect( mSpeller, TQT_SIGNAL( death() ),
238 this, TQT_SLOT( spellerDied() ) );
241 void KMEdit::createSpellers()
244 mSpeller =
new KMSpell( TQT_TQOBJECT(
this), TQT_SLOT( spellerReady( KSpell * ) ), mSpellConfig );
247 void KMEdit::initializeAutoSpellChecking()
251 TQColor defaultColor1( 0x00, 0x80, 0x00 );
252 TQColor defaultColor2( 0x00, 0x70, 0x00 );
253 TQColor defaultColor3( 0x00, 0x60, 0x00 );
254 TQColor defaultForeground( kapp->palette().active().text() );
256 TQColor c = TQt::red;
257 TDEConfigGroup readerConfig( KMKernel::config(),
"Reader" );
259 if ( !readerConfig.readBoolEntry(
"defaultColors",
true ) )
260 col1 = readerConfig.readColorEntry(
"ForegroundColor", &defaultForeground );
262 col1 = defaultForeground;
263 TQColor col2 = readerConfig.readColorEntry(
"QuotedText3", &defaultColor3 );
264 TQColor col3 = readerConfig.readColorEntry(
"QuotedText2", &defaultColor2 );
265 TQColor col4 = readerConfig.readColorEntry(
"QuotedText1", &defaultColor1 );
266 TQColor misspelled = readerConfig.readColorEntry(
"MisspelledColor", &c );
271 col1, col2, col3, col4,
274 connect( mHighlighter, TQT_SIGNAL(newSuggestions(
const TQString&,
const TQStringList&,
unsigned int)),
275 this, TQT_SLOT(addSuggestion(
const TQString&,
const TQStringList&,
unsigned int)) );
279 TQPopupMenu *KMEdit::createPopupMenu(
const TQPoint& pos )
281 enum { IdUndo, IdRedo, IdSep1, IdCut, IdCopy, IdPaste, IdClear, IdSep2, IdSelectAll };
283 TQPopupMenu *menu = KEdit::createPopupMenu( pos );
284 if ( !TQApplication::clipboard()->image().isNull() ) {
285 int id = menu->idAt(0);
286 menu->setItemEnabled(
id - IdPaste,
true);
292 void KMEdit::deleteAutoSpellChecking()
298 void KMEdit::addSuggestion(
const TQString& text,
const TQStringList& lst,
unsigned int )
300 mReplacements[text] = lst;
303 void KMEdit::setSpellCheckingActive(
bool spellCheckingActive)
305 if ( mHighlighter ) {
306 mHighlighter->setActive(spellCheckingActive);
313 removeEventFilter(
this);
317 mSpeller->setAutoDelete(
true );
322 delete mKSpellForDialog;
329 TQString KMEdit::brokenText()
333 int num_lines = numLines();
334 for (
int i = 0; i < num_lines; ++i)
338 for (
int j = 0; j < (int)line.length(); ++j)
340 if (lineOfChar(i, j) > lastLine)
342 lastLine = lineOfChar(i, j);
347 if (i + 1 < num_lines) temp +=
'\n';
354 unsigned int KMEdit::lineBreakColumn()
const 356 unsigned int lineBreakColumn = 0;
357 unsigned int numlines = numLines();
358 while ( numlines-- ) {
359 lineBreakColumn = TQMAX( lineBreakColumn, textLine( numlines ).length() );
361 return lineBreakColumn;
364 KMSpell::KMSpell( TQObject *receiver,
const char *slot, KSpellConfig *spellConfig )
365 : KSpell( 0, TQString(), receiver, slot, spellConfig )
369 KMSyntaxHighter::KMSyntaxHighter( TQTextEdit *textEdit,
370 bool spellCheckingActive,
372 const TQColor& spellColor,
374 const TQColor& QuoteColor0,
375 const TQColor& QuoteColor1,
376 const TQColor& QuoteColor2,
377 const TQColor& QuoteColor3,
378 KSpellConfig *spellConfig )
379 : KDictSpellingHighlighter( textEdit, spellCheckingActive, autoEnable, spellColor, colorQuoting,
380 QuoteColor0, QuoteColor1, QuoteColor2, QuoteColor3, spellConfig )
386 if ( mIgnoredWords.contains( word ) ) {
390 return KDictSpellingHighlighter::isMisspelled( word );
394 void KMSyntaxHighter::ignoreWord(
const TQString &word )
396 mIgnoredWords << word;
399 TQStringList KMSyntaxHighter::ignoredWords()
const 401 return mIgnoredWords;
404 void KMEdit::spellerDied()
409 void KMEdit::spellerReady( KSpell *spell )
411 Q_ASSERT( mSpeller == spell );
414 bool KMEdit::eventFilter(TQObject*o, TQEvent* e)
416 if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(
this))
417 KCursor::autoHideEventFilter(o, e);
419 if (e->type() == TQEvent::KeyPress)
421 TQKeyEvent *k = (TQKeyEvent*)e;
424 if (k->key() == Key_Up)
431 if ( (k->key() == Key_Shift) || (k->key() == Key_Control) ||
432 (k->key() == Key_Meta) || (k->key() == Key_Alt) )
434 if (mExtEditorTempFile)
return true;
435 TQString sysLine = mExtEditor;
436 mExtEditorTempFile =
new KTempFile();
438 mExtEditorTempFile->setAutoDelete(
true);
440 (*mExtEditorTempFile->textStream()) << text();
442 mExtEditorTempFile->close();
444 sysLine.replace(
"%f", mExtEditorTempFile->name() );
445 mExtEditorProcess =
new TDEProcess();
446 mExtEditorProcess->setUseShell(
true );
448 while (!sysLine.isEmpty())
450 *mExtEditorProcess << sysLine.left(sysLine.find(
" ")).local8Bit();
451 sysLine.remove(0, sysLine.find(
" ") + 1);
453 connect(mExtEditorProcess, TQT_SIGNAL(processExited(TDEProcess*)),
454 TQT_SLOT(slotExternalEditorDone(TDEProcess*)));
455 if (!mExtEditorProcess->start())
457 KMessageBox::error( topLevelWidget(),
458 i18n(
"Unable to start external editor.") );
459 killExternalEditor();
461 mExtEditorTempFileWatcher =
new KDirWatch( TQT_TQOBJECT(
this),
"mExtEditorTempFileWatcher" );
462 connect( mExtEditorTempFileWatcher, TQT_SIGNAL(dirty(
const TQString&)),
463 TQT_SLOT(slotExternalEditorTempFileChanged(
const TQString&)) );
464 mExtEditorTempFileWatcher->addFile( mExtEditorTempFile->name() );
470 if (k->key() == Key_Up && k->state() != ShiftButton && currentLine() == 0
471 && lineOfChar(0, currentColumn()) == 0)
479 if (k->key() == Key_Backtab && k->state() == ShiftButton)
487 }
else if ( e->type() == TQEvent::ContextMenu ) {
488 TQContextMenuEvent *
event = (TQContextMenuEvent*) e;
490 int para = 1, charPos, firstSpace, lastSpace;
493 charPos = charAt( viewportToContents(event->pos()), ¶ );
494 TQString paraText = text( para );
496 if( !paraText.at(charPos).isSpace() )
499 const TQRegExp wordBoundary(
"[\\s\\W]" );
500 firstSpace = paraText.findRev( wordBoundary, charPos ) + 1;
501 lastSpace = paraText.find( wordBoundary, charPos );
502 if( lastSpace == -1 )
503 lastSpace = paraText.length();
504 TQString word = paraText.mid( firstSpace, lastSpace - firstSpace );
506 if( !word.isEmpty() && mReplacements.contains( word ) )
511 TQStringList reps = mReplacements[word];
512 if( reps.count() > 0 )
515 for ( TQStringList::Iterator it = reps.begin(); it != reps.end(); ++it ) {
516 p.insertItem( *it, listPos );
522 p.setItemEnabled( p.insertItem( i18n(
"No Suggestions" ), -2 ), false );
525 int addToDictionaryId = -42;
527 if ( mSpeller && mSpeller->status() == KSpell::Running ) {
529 addToDictionaryId = p.insertItem( i18n(
"Add to Dictionary" ) );
530 ignoreId = p.insertItem( i18n(
"Ignore All" ) );
534 const int id = p.exec( mapToGlobal( event->pos() ) );
536 if (
id == ignoreId ) {
537 mHighlighter->ignoreWord( word );
538 mHighlighter->rehighlight();
540 if (
id == addToDictionaryId ) {
541 mSpeller->addPersonal( word );
542 mSpeller->writePersonalDictionary();
543 if ( mHighlighter ) {
546 TQTimer::singleShot( 200, mHighlighter, TQT_SLOT( slotLocalSpellConfigChanged() ) );
552 int parIdx = 1, txtIdx = 1;
553 getCursorPosition(&parIdx, &txtIdx);
554 setSelection(para, firstSpace, para, lastSpace);
555 insert(mReplacements[word][
id]);
558 if ( para == parIdx && txtIdx >= lastSpace )
559 txtIdx += mReplacements[word][id].length() - word.length();
560 setCursorPosition(parIdx, txtIdx);
563 if (
id == addToDictionaryId ||
id == ignoreId ) {
565 mReplacements.remove( word );
572 }
else if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) {
573 TQFocusEvent *fe = TQT_TQFOCUSEVENT(e);
574 if(! (fe->reason() == TQFocusEvent::ActiveWindow || fe->reason() == TQFocusEvent::Popup) )
575 emit focusChanged( fe->gotFocus() );
578 return KEdit::eventFilter(o, e);
582 int KMEdit::autoSpellChecking(
bool on )
584 if ( textFormat() == TQt::RichText ) {
587 KMessageBox::sorry(
this, i18n(
"Automatic spellchecking is not possible on text with markup."));
590 if ( mHighlighter ) {
592 mHighlighter->setAutomatic( on );
593 mHighlighter->setActive( on );
599 void KMEdit::slotExternalEditorTempFileChanged(
const TQString & fileName ) {
600 if ( !mExtEditorTempFile )
602 if ( fileName != mExtEditorTempFile->name() )
605 setAutoUpdate(
false);
608 insertLine(TQString::fromLocal8Bit(KPIM::kFileToString( fileName,
true,
false )), -1);
613 void KMEdit::slotExternalEditorDone( TDEProcess * proc ) {
614 assert(proc == mExtEditorProcess);
616 slotExternalEditorTempFileChanged( mExtEditorTempFile->name() );
617 killExternalEditor();
620 void KMEdit::killExternalEditor() {
621 delete mExtEditorTempFileWatcher; mExtEditorTempFileWatcher = 0;
622 delete mExtEditorTempFile; mExtEditorTempFile = 0;
623 delete mExtEditorProcess; mExtEditorProcess = 0;
627 bool KMEdit::checkExternalEditorFinished() {
628 if ( !mExtEditorProcess )
630 switch ( KMessageBox::warningYesNoCancel( topLevelWidget(),
631 i18n(
"The external editor is still running.\n" 632 "Abort the external editor or leave it open?"),
633 i18n(
"External Editor"),
634 i18n(
"Abort Editor"), i18n(
"Leave Editor Open") ) ) {
635 case KMessageBox::Yes:
636 killExternalEditor();
638 case KMessageBox::No:
645 void KMEdit::spellcheck()
647 if ( mKSpellForDialog )
649 mWasModifiedBeforeSpellCheck = isModified();
650 mSpellLineEdit = !mSpellLineEdit;
661 mKSpellForDialog =
new KSpell( TQT_TQWIDGET(
this), i18n(
"Spellcheck - KMail"), TQT_TQOBJECT(
this),
662 TQT_SLOT(slotSpellcheck2(KSpell*)) );
665 TQStringList l = KSpellingHighlighter::personalWords();
666 for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
667 mKSpellForDialog->addPersonal( *it );
669 connect (mKSpellForDialog, TQT_SIGNAL( death()),
670 this, TQT_SLOT (slotSpellDone()));
671 connect (mKSpellForDialog, TQT_SIGNAL (misspelling (
const TQString &,
const TQStringList &,
unsigned int)),
672 this, TQT_SLOT (slotMisspelling (
const TQString &,
const TQStringList &,
unsigned int)));
673 connect (mKSpellForDialog, TQT_SIGNAL (corrected (
const TQString &,
const TQString &,
unsigned int)),
674 this, TQT_SLOT (slotCorrected (
const TQString &,
const TQString &,
unsigned int)));
675 connect (mKSpellForDialog, TQT_SIGNAL (done(
const TQString &)),
676 this, TQT_SLOT (slotSpellResult (
const TQString&)));
682 if ( textFormat() != TQt::RichText && mHighlighter )
683 mHighlighter->restartBackgroundSpellCheck();
689 if ( textFormat() != TQt::RichText && mHighlighter )
690 mHighlighter->restartBackgroundSpellCheck();
696 if ( textFormat() != TQt::RichText && mHighlighter )
697 mHighlighter->restartBackgroundSpellCheck();
702 mComposer->paste( mPasteMode );
710 void KMEdit::contentsMouseReleaseEvent( TQMouseEvent * e )
712 if( e->button() != Qt::MidButton )
713 return KEdit::contentsMouseReleaseEvent( e );
714 mPasteMode = TQClipboard::Selection;
715 KEdit::contentsMouseReleaseEvent( e );
716 mPasteMode = TQClipboard::Clipboard;
719 void KMEdit::contentsMouseDoubleClickEvent( TQMouseEvent *e )
721 bool handled =
false;
722 if ( e->button() == Qt::LeftButton ) {
726 int charPos = charAt ( e->pos(), ¶graphPos );
727 TQString paraText = text( paragraphPos );
730 if ( charPos >= 0 && static_cast<unsigned int>( charPos ) <= paraText.length() ) {
734 unsigned int end = charPos;
738 if ( ( start - 1 ) < 0 )
740 TQChar charToTheLeft = paraText.at( start - 1 );
741 if ( charToTheLeft.isLetter() || charToTheLeft.isDigit() )
749 if ( ( end + 1 ) >= paraText.length() )
751 TQChar charToTheRight = paraText.at( end + 1 );
752 if ( charToTheRight.isLetter() || charToTheRight.isDigit() )
758 setSelection( paragraphPos, start, paragraphPos, end + 1 );
764 return KEdit::contentsMouseDoubleClickEvent( e );
767 void KMEdit::slotMisspelling(
const TQString &text,
const TQStringList &lst,
unsigned int pos)
769 kdDebug(5006)<<
"void KMEdit::slotMisspelling(const TQString &text, const TQStringList &lst, unsigned int pos) : "<<text <<endl;
771 mComposer->sujectLineWidget()->spellCheckerMisspelling( text, lst, pos);
773 misspelling(text, lst, pos);
776 void KMEdit::slotCorrected (
const TQString &oldWord,
const TQString &newWord,
unsigned int pos)
778 kdDebug(5006)<<
"slotCorrected (const TQString &oldWord, const TQString &newWord, unsigned int pos) : "<<oldWord<<endl;
780 mComposer->sujectLineWidget()->spellCheckerCorrected( oldWord, newWord, pos);
783 unsigned int cnt = 0;
784 bool _bold,_underline,_italic;
787 posToRowCol (pos, l, cnt);
788 setCursorPosition(l, cnt+1);
790 _underline = underline();
793 _font = currentFont();
794 corrected(oldWord, newWord, pos);
795 setSelection (l, cnt, l, cnt+newWord.length());
798 setUnderline(_underline);
800 setCurrentFont(_font);
805 void KMEdit::slotSpellcheck2(KSpell*)
808 if ( mHighlighter ) {
809 for ( uint i = 0; i < mHighlighter->ignoredWords().size(); i++ )
810 mKSpellForDialog->ignore( mHighlighter->ignoredWords()[i] );
817 TQString quotePrefix;
818 if(mComposer && mComposer->msg())
820 int languageNr = GlobalSettings::self()->replyCurrentLanguage();
821 ReplyPhrases replyPhrases( TQString::number(languageNr) );
822 replyPhrases.readConfig();
824 quotePrefix = mComposer->msg()->formatString(
825 replyPhrases.indentPrefix() );
828 kdDebug(5006) <<
"spelling: new SpellingFilter with prefix=\"" << quotePrefix <<
"\"" << endl;
829 TQTextEdit plaintext;
830 plaintext.setText(text());
831 plaintext.setTextFormat(TQt::PlainText);
832 mSpellingFilter =
new SpellingFilter(plaintext.text(), quotePrefix, SpellingFilter::FilterUrls,
833 SpellingFilter::FilterEmailAddresses);
835 mKSpellForDialog->check(mSpellingFilter->filteredText());
838 mKSpellForDialog->check( mComposer->sujectLineWidget()->text());
841 void KMEdit::slotSpellResult(
const TQString &s)
846 int dlgResult = mKSpellForDialog->dlgResult();
847 if ( dlgResult == KS_CANCEL )
852 mSpellLineEdit =
false;
853 TQString tmpText( s );
854 tmpText = tmpText.remove(
'\n');
856 if( tmpText != mComposer->sujectLineWidget()->text() )
857 mComposer->sujectLineWidget()->setText( tmpText );
864 mKSpellForDialog->cleanUp();
865 KDictSpellingHighlighter::dictionaryChanged();
867 emit spellcheck_done( dlgResult );
870 void KMEdit::slotSpellDone()
872 kdDebug(5006)<<
" void KMEdit::slotSpellDone()\n";
873 KSpell::spellStatus status = mKSpellForDialog->status();
874 delete mKSpellForDialog;
875 mKSpellForDialog = 0;
877 kdDebug(5006) <<
"spelling: delete SpellingFilter" << endl;
878 delete mSpellingFilter;
880 mComposer->sujectLineWidget()->deselect();
881 if (status == KSpell::Error)
883 KMessageBox::sorry( topLevelWidget(),
884 i18n(
"ISpell/Aspell could not be started. Please " 885 "make sure you have ISpell or Aspell properly " 886 "configured and in your PATH.") );
887 emit spellcheck_done( KS_CANCEL );
889 else if (status == KSpell::Crashed)
892 KMessageBox::sorry( topLevelWidget(),
893 i18n(
"ISpell/Aspell seems to have crashed.") );
894 emit spellcheck_done( KS_CANCEL );
900 else if( !mComposer->subjectTextWasSpellChecked() && status == KSpell::FinishedNoMisspellingsEncountered )
901 KMessageBox::information( topLevelWidget(),
902 i18n(
"No misspellings encountered.") );
906 void KMEdit::setCursorPositionFromStart(
unsigned int pos ) {
909 posToRowCol( pos, l, c );
912 setCursorPosition( l, c );
913 ensureCursorVisible();
916 int KMEdit::indexOfCurrentLineStart(
int paragraph,
int index )
918 Q_ASSERT( paragraph >= 0 && paragraph < paragraphs() );
919 Q_ASSERT( index >= 0 && ( index == 0 || index < paragraphLength( paragraph ) ) );
921 const int startLine = lineOfChar( paragraph, index );
922 Q_ASSERT( startLine >= 0 && startLine < linesOfParagraph( paragraph ) );
923 for (
int curIndex = index; curIndex >= 0; curIndex-- ) {
924 const int line = lineOfChar( paragraph, curIndex );
925 if ( line != startLine ) {
932 #include "kmedit.moc" const KMMsgBase * getMsgBase(int idx) const
Provides access to the basic message fields that are also stored in the index.
static const KMMsgDict * instance()
Access the globally unique MessageDict.
void getLocation(unsigned long key, KMFolder **retFolder, int *retIndex) const
Returns the folder the message represented by the serial number key is in and the index in that folde...
void clear()
Clears the hash table, removing all items.
Reimplemented to add support for ignored words.
void insert(long key, KMDictItem *item)
Inserts an item without replacing ones with the same key.
Reimplemented to make writePersonalDictionary() public, which we call everytime after adding a word t...
virtual bool isMisspelled(const TQString &word)
Reimplemented.