1 /* This file is part of the KDE project
2 * Copyright (C) 2007 Thomas Zander <zander@kde.org>
3 * Copyright (C) 2008 Fredy Yanardi <fyanardi@gmail.com>
4 * Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22 #include "KoFind.h"
23 #include "KoFind_p.h"
24
25 #include <KoCanvasResourceManager.h>
26 #include <kactioncollection.h>
27 #include <QAction>
28
29
KoFind(QWidget * parent,KoCanvasResourceManager * canvasResourceManager,KActionCollection * ac)30 KoFind::KoFind(QWidget *parent, KoCanvasResourceManager *canvasResourceManager, KActionCollection *ac)
31 : QObject(parent)
32 , d(new KoFindPrivate(this, canvasResourceManager, parent))
33 {
34 connect(canvasResourceManager, SIGNAL(canvasResourceChanged(int,QVariant)), this, SLOT(resourceChanged(int,QVariant)));
35 ac->addAction(KStandardAction::Find, "edit_find", this, SLOT(findActivated()));
36 d->findNext = ac->addAction(KStandardAction::FindNext, "edit_findnext", this, SLOT(findNextActivated()));
37 d->findNext->setEnabled(false);
38 d->findPrev = ac->addAction(KStandardAction::FindPrev, "edit_findprevious", this, SLOT(findPreviousActivated()));
39 d->findPrev->setEnabled(false);
40 ac->addAction(KStandardAction::Replace, "edit_replace", this, SLOT(replaceActivated()));
41 }
42
~KoFind()43 KoFind::~KoFind()
44 {
45 delete d;
46 }
47
48 //have to include this because of Q_PRIVATE_SLOT
49 #include "moc_KoFind.cpp"
50