modify abstracttool iface
[yamf.git] / yamf / tools / polyline / polyline.h
blob2a456e156e8a6f395aadc43359cb994f87edf06f
1 /***************************************************************************
2 * Copyright (C) 2007 by Jorge Cuadrado *
3 * kuadrosxx@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 POLYLINE_H
22 #define POLYLINE_H
23 #include <QObject>
24 #include <yamf/drawing/abstracttool.h>
25 #include <yamf/common/yamf_exports.h>
27 namespace YAMF {
29 namespace Drawing {
30 class BrushManager;
32 namespace Tool {
34 /**
35 * @ingroup tools
36 * @~spanish
37 * @brief Esta clase provee de una herramienta para dibujar trazos rectos y curvilíneos.
38 * @author Jorge Cuadrado <kuadrosxx@gmail.com>
40 class YAMF_EXPORT PolyLine : public Drawing::AbstractTool
42 Q_OBJECT;
43 public:
44 PolyLine(QObject *parent = 0);
45 ~PolyLine();
47 virtual void init(Photogram *photogram);
49 virtual QString id() const;
50 virtual void press(const QGraphicsSceneMouseEvent *input);
51 virtual void move(const QGraphicsSceneMouseEvent *input);
52 virtual void release(const QGraphicsSceneMouseEvent *input);
53 virtual void doubleClick(const QGraphicsSceneMouseEvent *input);
54 void keyPressEvent(QKeyEvent *event);
56 virtual DGui::Action *action() const;
57 int type() const;
58 virtual void aboutToChangeTool();
59 virtual void photogramChanged(Photogram *const photogram);
61 private:
62 void endItem();
64 private slots:
65 void nodeChanged();
67 private:
68 struct Private;
69 Private * const d;
76 #endif