1 /* This file is part of the KDE project
2  * Copyright (c) 2009-2010 Jan Hambrecht <jaham@gmx.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef KARBONFILTEREFFECTSTOOL_H
21 #define KARBONFILTEREFFECTSTOOL_H
22 
23 #include "KoInteractionTool.h"
24 
25 class KoResource;
26 class KoInteractionStrategy;
27 
28 class KarbonFilterEffectsTool : public KoInteractionTool
29 {
30     Q_OBJECT
31 public:
32     enum EditMode {
33         None,
34         MoveAll,
35         MoveLeft,
36         MoveRight,
37         MoveTop,
38         MoveBottom
39     };
40 
41     explicit KarbonFilterEffectsTool(KoCanvasBase *canvas);
42     ~KarbonFilterEffectsTool() override;
43 
44     /// reimplemented from KoToolBase
45     void paint(QPainter &painter, const KoViewConverter &converter) override;
46     /// reimplemented from KoToolBase
47     void repaintDecorations() override;
48     /// reimplemented from KoToolBase
49     void mouseMoveEvent(KoPointerEvent *event) override;
50 
51     /// reimplemented from KoToolBase
52     void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes) override;
53 
54 protected:
55     /// reimplemented from KoToolBase
56     QList<QPointer<QWidget> > createOptionWidgets() override;
57     /// reimplemented from KoToolBase
58     KoInteractionStrategy *createStrategy(KoPointerEvent *event) override;
59 private Q_SLOTS:
60     void editFilter();
61     void clearFilter();
62     void filterChanged();
63     void filterSelected(int index);
64     void selectionChanged();
65     void presetSelected(KoResource *resource);
66     void regionXChanged(double x);
67     void regionYChanged(double y);
68     void regionWidthChanged(double width);
69     void regionHeightChanged(double height);
70 private:
71     class Private;
72     Private * const d;
73 };
74 
75 #endif // KARBONFILTEREFFECTSTOOL_H
76