Warning, file /office/calligra/libs/widgets/KoStrokeConfigWidget.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) 2002 Tomislav Lukman <tomislav.lukman@ck.t-com.hr>
0004  * Copyright (C) 2002 Rob Buis <buis@kde.org>
0005  * Copyright (C) 2004 Laurent Montel <montel@kde.org>
0006  * Copyright (C) 2005-2006 Tim Beaulen <tbscope@gmail.com>
0007  * Copyright (C) 2005 Inge Wallin <inge@lysator.liu.se>
0008  * Copyright (C) 2005, 2011 Thomas Zander <zander@kde.org>
0009  * Copyright (C) 2005-2008 Jan Hambrecht <jaham@gmx.net>
0010  * Copyright (C) 2006 C. Boemann <cbo@boemann.dk>
0011  * Copyright (C) 2011 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
0012  * Copyright (C) 2011 Thorsten Zachmann <zachmann@kde.com>
0013  *
0014  * This library is free software; you can redistribute it and/or
0015  * modify it under the terms of the GNU Library General Public
0016  * License as published by the Free Software Foundation; either
0017  * version 2 of the License, or (at your option) any later version.
0018  *
0019  * This library is distributed in the hope that it will be useful,
0020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0022  * Library General Public License for more details.
0023  *
0024  * You should have received a copy of the GNU Library General Public License
0025  * along with this library; see the file COPYING.LIB.  If not, write to
0026  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0027  * Boston, MA 02110-1301, USA.
0028  */
0029 
0030 #ifndef STROKECONFIGWIDGET_H
0031 #define STROKECONFIGWIDGET_H
0032 
0033 #include "kowidgets_export.h"
0034 
0035 #include <QWidget>
0036 #include <KoMarkerData.h>
0037 
0038 class KoUnit;
0039 class KoShapeStrokeModel;
0040 class KoMarker;
0041 class KoCanvasBase;
0042 class KoShapeStroke;
0043 
0044 /// A widget for configuring the stroke of a shape
0045 class KOWIDGETS_EXPORT KoStrokeConfigWidget : public QWidget
0046 {
0047     Q_OBJECT
0048 public:
0049     explicit KoStrokeConfigWidget(QWidget *parent);
0050     ~KoStrokeConfigWidget() override;
0051 
0052     // Getters
0053     Qt::PenStyle lineStyle() const;
0054     QVector<qreal> lineDashes() const;
0055     qreal lineWidth() const;
0056     QColor color() const;
0057     qreal miterLimit() const;
0058     KoMarker *startMarker() const;
0059     KoMarker *endMarker() const;
0060     Qt::PenCapStyle capStyle() const;
0061     Qt::PenJoinStyle joinStyle() const;
0062 
0063     /**
0064      * Creates KoShapeStroke object filled with the options
0065      * configured by the widget. The caller is in charge of
0066      * deletion of the returned object
0067      */
0068     KoShapeStroke* createShapeStroke() const;
0069 
0070     void setCanvas(KoCanvasBase *canvas);
0071     void setActive(bool active);
0072 
0073 private Q_SLOTS:
0074     void updateControls(KoShapeStrokeModel *stroke, KoMarker *startMarker, KoMarker *endMarker);
0075 
0076     void updateMarkers(const QList<KoMarker*> &markers);
0077 
0078     /// start marker has changed
0079     void startMarkerChanged();
0080     /// end marker has changed
0081     void endMarkerChanged();
0082 
0083     void canvasResourceChanged(int key, const QVariant &value);
0084 
0085     /// selection has changed
0086     void selectionChanged();
0087 
0088     /// apply line changes to the selected shape
0089     void applyChanges();
0090 
0091 private:
0092     void setUnit(const KoUnit &unit);
0093 
0094     /// apply marker changes to the selected shape
0095     void applyMarkerChanges(KoMarkerData::MarkerPosition position);
0096 
0097     void blockChildSignals(bool block);
0098 
0099 private:
0100     class Private;
0101     Private * const d;
0102 };
0103 
0104 #endif // SHADOWCONFIGWIDGET_H