Fixed crash in iTween network
[yamf.git] / yamf / drawing / brushmanager.h
blob5ac217fcc65b06cb4592c887ae80fc664a18d585
1 /***************************************************************************
2 * Copyright (C) 2006 by David Cuadrado *
3 * krawek@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef YAMF_DRAWINGBRUSHMANAGER_H
22 #define YAMF_DRAWINGBRUSHMANAGER_H
24 #include <QObject>
25 #include <QPen>
26 #include <QBrush>
28 #include <yamf/common/yamf_exports.h>
30 class QGraphicsItem;
32 namespace YAMF {
33 namespace Drawing {
35 /**
36 * @ingroup drawing
37 * @~spanish
38 * @brief Esta clase permite modificar la brocha de relleno, la brocha del contorno y el estilo de linea, con las cuales se crearán los graficos dentro del area de dibujo.
39 * @author David Cuadrado <krawek@gmail.com>
41 class YAMF_EXPORT BrushManager : public QObject
43 Q_OBJECT;
44 public:
45 BrushManager(QObject * parent = 0);
46 BrushManager(const QPen &pen, const QBrush &brush, QObject * parent = 0);
47 ~BrushManager();
49 QPen pen() const;
50 QBrush brush() const;
51 int penWidth() const;
52 QColor penColor() const;
53 QBrush penBrush() const;
55 QColor brushColor() const;
57 void apply(QGraphicsItem *item);
58 void map(QGraphicsItem *item);
60 QBrush mapBrush(const QRectF &rect, const QBrush &brush);
63 public slots:
64 void setPenBrush(const QBrush &brush);
65 void setPen(const QPen &pen);
66 void setBrush(const QBrush &brush);
68 signals:
69 void penChanged(const QPen &pen);
70 void brushChanged(const QBrush &brush);
72 private:
73 struct Private;
74 Private *const d;
81 #endif