kword

KWBgSpellCheck.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 David Faure <faure@kde.org>
3 2002 Laurent Montel <lmontel@mandrakesoft.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21
22#include "KWBgSpellCheck.h"
23
24#include "KWDocument.h"
25#include "KWTextFrameSet.h"
26
27#include "KoTextIterator.h"
28#include "KoTextObject.h"
29
30#include <tdespell2/broker.h>
31using namespace KSpell2;
32
33#include <kdebug.h>
34#include <tdeconfig.h>
35#include <tdelocale.h>
36
37
38KWBgSpellCheck::KWBgSpellCheck(KWDocument *_doc)
39 : KoBgSpellCheck( Broker::openBroker( TDESharedConfig::openConfig( "kwordrc" ) ),
40 _doc )
41{
42 m_doc=_doc;
43 m_currentFrame=0L;
44}
45
46KWBgSpellCheck::~KWBgSpellCheck()
47{
48}
49
50KoTextIterator *KWBgSpellCheck::createWholeDocIterator() const
51{
52 TQValueList<KoTextObject *> objects = m_doc->visibleTextObjects( 0 );
53
54 kdDebug()<<"Number of visible text objects = "<< objects.count() << endl;
55
56 if ( objects.isEmpty() )
57 return 0;
58
59 return new KoTextIterator( objects, 0, 0 );
60}