kpresenter

KPrFindReplace.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2001, 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 #include <kdebug.h>
00022 #include "KPrFindReplace.h"
00023 #include "KPrCanvas.h"
00024 #include "KPrView.h"
00025 #include "KPrDocument.h"
00026 #include "KPrTextObject.h"
00027 #include <KoTextObject.h>
00028 #include <kcommand.h>
00029 #include <KoSearchDia.h>
00030 #include "KPrTextDocument.h"
00031 
00032 KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoSearchDia * dialog,
00033                                 const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView)
00034     : KoFindReplace( parent, dialog, lstObjects, textView )
00035 {
00036     m_canvas = canvas;
00037 }
00038 
00039 KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoReplaceDia * dialog,
00040                                 const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView )
00041     : KoFindReplace( parent, dialog, lstObjects, textView )
00042 {
00043     m_canvas = canvas;
00044 }
00045 
00046 KPrFindReplace::~KPrFindReplace()
00047 {
00048     //kdDebug(33001)() << "KPrFindReplace::~KPrFindReplace m_destroying=" << m_destroying << endl;
00049 }
00050 
00051 void KPrFindReplace::emitNewCommand(KCommand *cmd)
00052 {
00053     m_canvas->getView()->kPresenterDoc()->addCommand(cmd);
00054 }
00055 
00056 void KPrFindReplace::highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *_textdoc, KDialogBase* dialog)
00057 {
00058     bool repaint = isReplace() ? options() & KReplaceDialog::PromptOnReplace : true;
00059     KPrTextDocument *textdoc = static_cast<KPrTextDocument *>(_textdoc);
00060     KPrTextObject* textobj = textdoc->textObject();
00061     textobj->highlightPortion( parag, index, length, m_canvas, repaint, dialog );
00062 }
00063 
00064 #include "KPrFindReplace.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys