kword

KWFindReplace.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003    Copyright (C) 2001, S.R.Haque <srhaque@iee.org>
00004    Copyright (C) 2001, David Faure <faure@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include <kdebug.h>
00023 #include "KWFindReplace.h"
00024 #include "KWCanvas.h"
00025 #include "KWDocument.h"
00026 #include "KWTextFrameSet.h"
00027 #include <KoTextObject.h>
00028 #include <kcommand.h>
00029 #include <KoSearchDia.h>
00030 #include "KWTextDocument.h"
00031 //#include <KoTextDocument.h>
00032 
00033 KWFindReplace::KWFindReplace( KWCanvas * canvas, KoSearchDia * dialog, const QValueList<KoTextObject *> & lstObjects, KWTextFrameSetEdit *textView)
00034     : KoFindReplace( canvas, dialog, lstObjects, textView )
00035 {
00036     m_canvas = canvas;
00037 }
00038 
00039 KWFindReplace::KWFindReplace( KWCanvas * canvas, KoReplaceDia * dialog, const QValueList<KoTextObject *> & lstObjects, KWTextFrameSetEdit *textView )
00040     : KoFindReplace( canvas, dialog, lstObjects, textView )
00041 {
00042     m_canvas = canvas;
00043 }
00044 
00045 KWFindReplace::~KWFindReplace()
00046 {
00047     //kdDebug() << "KWFindReplace::~KWFindReplace m_destroying=" << m_destroying << endl;
00048 }
00049 
00050 void KWFindReplace::emitNewCommand(KCommand *cmd)
00051 {
00052     m_canvas->kWordDocument()->addCommand(cmd);
00053 }
00054 
00055 void KWFindReplace::highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *textdocument, KDialogBase* dialog)
00056 {
00057     KWTextDocument *textdoc=static_cast<KWTextDocument *>(textdocument);
00058     bool repaint = isReplace() ? options() & KReplaceDialog::PromptOnReplace : true;
00059     textdoc->textFrameSet()->highlightPortion( parag, index, length, m_canvas, repaint, dialog );
00060 }
00061 
00062 #include "KWFindReplace.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys