1 /* This file is part of the KDE project
2 * Copyright (c) 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 FILTERREGIONEDITSTRATEGY_H
21 #define FILTERREGIONEDITSTRATEGY_H
22 
23 #include <KoInteractionStrategy.h>
24 #include "KarbonFilterEffectsTool.h"
25 
26 #include <QRectF>
27 
28 class KoShape;
29 class KoFilterEffect;
30 
31 class FilterRegionEditStrategy : public KoInteractionStrategy
32 {
33 public:
34     FilterRegionEditStrategy(KoToolBase* parent, KoShape * shape, KoFilterEffect *effect, KarbonFilterEffectsTool::EditMode mode);
35 
36     // reimplemented from KoInteractionStrategy
37     void handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override;
38     // reimplemented from KoInteractionStrategy
39     KUndo2Command *createCommand() override;
40     // reimplemented from KoInteractionStrategy
41     void finishInteraction(Qt::KeyboardModifiers modifiers) override;
42     // reimplemented from KoInteractionStrategy
43     void paint(QPainter &painter, const KoViewConverter &converter) override;
44 
45 private:
46     KoFilterEffect * m_effect;
47     KoShape * m_shape;
48     QRectF m_sizeRect;
49     QRectF m_filterRect;
50     KarbonFilterEffectsTool::EditMode m_editMode;
51     QPointF m_lastPosition;
52 };
53 
54 #endif // FILTERREGIONEDITSTRATEGY_H
55