kword

KWBgSpellCheck.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 David Faure <faure@kde.org>
00003                  2002 Laurent Montel <lmontel@mandrakesoft.com>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 
00022 #include "KWBgSpellCheck.h"
00023 
00024 #include "KWDocument.h"
00025 #include "KWTextFrameSet.h"
00026 
00027 #include "KoTextIterator.h"
00028 #include "KoTextObject.h"
00029 
00030 #include <kspell2/broker.h>
00031 using namespace KSpell2;
00032 
00033 #include <kdebug.h>
00034 #include <kconfig.h>
00035 #include <klocale.h>
00036 
00037 
00038 KWBgSpellCheck::KWBgSpellCheck(KWDocument *_doc)
00039     : KoBgSpellCheck( Broker::openBroker( KSharedConfig::openConfig( "kwordrc" ) ),
00040                       _doc )
00041 {
00042     m_doc=_doc;
00043     m_currentFrame=0L;
00044 }
00045 
00046 KWBgSpellCheck::~KWBgSpellCheck()
00047 {
00048 }
00049 
00050 KoTextIterator *KWBgSpellCheck::createWholeDocIterator() const
00051 {
00052     QValueList<KoTextObject *> objects = m_doc->visibleTextObjects( 0 );
00053 
00054     kdDebug()<<"Number of visible text objects = "<< objects.count() << endl;
00055 
00056     if ( objects.isEmpty() )
00057         return 0;
00058 
00059     return new KoTextIterator( objects, 0, 0 );
00060 }
KDE Home | KDE Accessibility Home | Description of Access Keys