krita/ui

kis_autogradient_resource.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00003  *                2004 Sven Langkamp <sven.langkamp@gmail.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program 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
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 
00029 #ifndef _KIS_AUTOGRADIENT_RESOURCE_H_
00030 #define _KIS_AUTOGRADIENT_RESOURCE_H_
00031 
00032 #include <QList>
00033 
00034 #include <KoSegmentGradient.h>
00035 #include <krita_export.h>
00036 
00037 class QColor;
00038 
00047 class KRITAUI_EXPORT KisAutogradientResource
00048         : public KoSegmentGradient
00049 {
00050 
00051 public:
00052     KisAutogradientResource() : KoSegmentGradient("") {}
00053 
00054 public:
00068     void createSegment(int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, const QColor & left, const QColor & right);
00069 
00077     const QList<double> getHandlePositions() const;
00078 
00084     const QList<double> getMiddleHandlePositions() const;
00085 
00100     void moveSegmentStartOffset(KoGradientSegment* segment, double t);
00101 
00116     void moveSegmentEndOffset(KoGradientSegment* segment, double t);
00117 
00129     void moveSegmentMiddleOffset(KoGradientSegment* segment, double t);
00130 
00136     void splitSegment(KoGradientSegment* segment);
00137 
00143     void duplicateSegment(KoGradientSegment* segment);
00144 
00150     void mirrorSegment(KoGradientSegment* segment);
00151 
00159     KoGradientSegment* removeSegment(KoGradientSegment* segment);
00160 
00166     bool removeSegmentPossible() const;
00167 
00168 public:
00169     virtual bool load() {
00170         return false;
00171     }
00172 };
00173 
00174 #endif // _KIS_AUTOGRADIENT_RESOURCE_H_