Warning, file /office/calligra/libs/widgets/KoFillConfigWidget.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
0003  * Copyright (C) 2012 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef FILLCONFIGWIDGET_H
0022 #define FILLCONFIGWIDGET_H
0023 
0024 #include "kowidgets_export.h"
0025 
0026 #include <QWidget>
0027 #include <QSharedPointer>
0028 
0029 class KoCanvasBase;
0030 class KoShapeBackground;
0031 class KoShape;
0032 
0033 /// A widget for configuring the fill of a shape
0034 class KOWIDGETS_EXPORT KoFillConfigWidget : public QWidget
0035 {
0036     Q_OBJECT
0037     enum StyleButton {
0038         None,
0039         Solid,
0040         Gradient,
0041         Pattern
0042     };
0043 public:
0044     explicit KoFillConfigWidget(QWidget *parent);
0045     ~KoFillConfigWidget() override;
0046 
0047     void setCanvas(KoCanvasBase *canvas);
0048 
0049     KoCanvasBase *canvas();
0050 
0051     /// Returns the list of the selected shape
0052     /// If you need to use only one shape, call currentShape()
0053     virtual QList<KoShape*> currentShapes();
0054 
0055     /// Returns the first selected shape of the resource
0056     virtual KoShape *currentShape();
0057 
0058 private Q_SLOTS:
0059     void styleButtonPressed(int buttonId);
0060 
0061     void noColorSelected();
0062 
0063     /// apply color changes to the selected shape
0064     void colorChanged();
0065 
0066     /// the gradient of the fill changed, apply the changes
0067     void gradientChanged(QSharedPointer<KoShapeBackground> background);
0068 
0069     /// the pattern of the fill changed, apply the changes
0070     void patternChanged(QSharedPointer<KoShapeBackground> background);
0071 
0072     virtual void shapeChanged();
0073 private:
0074     /// update the widget with the KoShape background
0075     void updateWidget(KoShape *shape);
0076 
0077     class Private;
0078     Private * const d;
0079 };
0080 
0081 #endif // FILLCONFIGWIDGET_H