1 /*
2  *  Copyright (c) 2016 Jouni Pentikäinen <joupent@gmail.com>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program 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
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 
20 #ifndef __KIS_ANIMATED_TRANSFORM_MASK_PARAMETERS_H
21 #define __KIS_ANIMATED_TRANSFORM_MASK_PARAMETERS_H
22 
23 #include "kis_transform_mask_adapter.h"
24 #include "kritatooltransform_export.h"
25 
26 class KisKeyframeChannel;
27 
28 class KRITATOOLTRANSFORM_EXPORT KisAnimatedTransformMaskParameters : public KisTransformMaskAdapter, public KisAnimatedTransformParamsInterface
29 {
30 public:
31     KisAnimatedTransformMaskParameters();
32     KisAnimatedTransformMaskParameters(const KisTransformMaskAdapter *staticTransform);
33     ~KisAnimatedTransformMaskParameters() override;
34 
35     const ToolTransformArgs& transformArgs() const override;
36 
37     QString id() const override;
38     void toXML(QDomElement *e) const override;
39     static KisTransformMaskParamsInterfaceSP fromXML(const QDomElement &e);
40     static KisTransformMaskParamsInterfaceSP animate(KisTransformMaskParamsInterfaceSP params);
41 
42     void translate(const QPointF &offset) override;
43 
44     KisKeyframeChannel *getKeyframeChannel(const QString &id, KisNodeSP defaultBounds) override;
45 
46     bool isHidden() const override;
47     void setHidden(bool hidden);
48 
49     void clearChangedFlag() override;
50     bool hasChanged() const override;
51     bool isAnimated() const;
52 
53     static void addKeyframes(KisTransformMaskSP mask, int time, KisTransformMaskParamsInterfaceSP params, KUndo2Command *parentCommand);
54 
55 
56 private:
57     struct Private;
58     const QScopedPointer<Private> m_d;
59 };
60 
61 #endif
62