modify abstracttool iface
[yamf.git] / yamf / drawing / abstracttool.cpp
blob23ca2e373a47074ec36414f327be1c6183ac5669
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 #include "abstracttool.h"
23 #include <QGraphicsView>
25 #include "photogram.h"
27 #include <dcore/debug.h>
30 namespace YAMF {
31 namespace Drawing {
33 struct AbstractTool::Private
35 Private() : paintArea(0) {}
36 PaintArea *paintArea;
39 /**
40 * @~spanish
41 * Constructor
43 AbstractTool::AbstractTool(QObject * parent) : QObject(parent), d(new Private)
48 /**
49 * Destructor
51 AbstractTool::~AbstractTool()
53 delete d;
56 void AbstractTool::setPaintArea(PaintArea *const paintArea)
58 d->paintArea = paintArea;
61 PaintArea *AbstractTool::paintArea() const
63 return d->paintArea;
67 /**
68 * @~spanish
69 * Se ejecuta en el momento que se selecciona la herramienta.
71 void AbstractTool::init(Photogram *photogram)
73 Q_UNUSED(photogram);
76 /**
77 * TODO:
79 void AbstractTool::updatePhotogram(Photogram *photogram)
81 Q_UNUSED(photogram);
84 /**
85 * @~spanish
86 * Se ejecuta en un evento de doble click sobre el area de dibujo.
88 void AbstractTool::doubleClick(const QGraphicsSceneMouseEvent *)
92 /**
93 * @~spanish
94 * Se ejecuta cuando se esta cambiando de herramienta.
96 void AbstractTool::aboutToChangePhotogram(Photogram *const photogram)
98 Q_UNUSED(photogram);
102 * @~spanish
103 * Se ejecuta cuando se cambia de fotograma.
105 void AbstractTool::photogramChanged(Photogram *const photogram)
107 Q_UNUSED(photogram);
111 * @~spanish
112 * Se ejecuta cuando se presiona una tecla.
114 void AbstractTool::keyPressEvent(QKeyEvent *event)
116 Q_UNUSED(event);
120 * TODO:
123 QMenu *AbstractTool::menu() const
125 return 0;
129 * @~spanish
130 * Permite configurar el toobar para configurar la herramienta, en la barra de herramientas @p toolbar se espera que se provea una interfaz grafica para la configuracion de la herramienta.
132 void AbstractTool::setupConfigBar(QToolBar *configBar)
134 Q_UNUSED(configBar);