1 /***************************************************************************
2 * Copyright (C) 2006 by David Cuadrado *
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. *
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. *
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>
33 struct AbstractTool::Private
35 Private() : paintArea(0) {}
43 AbstractTool::AbstractTool(QObject
* parent
) : QObject(parent
), d(new Private
)
51 AbstractTool::~AbstractTool()
56 void AbstractTool::setPaintArea(PaintArea
*const paintArea
)
58 d
->paintArea
= paintArea
;
61 PaintArea
*AbstractTool::paintArea() const
69 * Se ejecuta en el momento que se selecciona la herramienta.
71 void AbstractTool::init(Photogram
*photogram
)
79 void AbstractTool::updatePhotogram(Photogram
*photogram
)
86 * Se ejecuta en un evento de doble click sobre el area de dibujo.
88 void AbstractTool::doubleClick(const QGraphicsSceneMouseEvent
*)
94 * Se ejecuta cuando se esta cambiando de herramienta.
96 void AbstractTool::aboutToChangePhotogram(Photogram
*const photogram
)
103 * Se ejecuta cuando se cambia de fotograma.
105 void AbstractTool::photogramChanged(Photogram
*const photogram
)
112 * Se ejecuta cuando se presiona una tecla.
114 void AbstractTool::keyPressEvent(QKeyEvent
*event
)
123 QMenu
*AbstractTool::menu() const
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
)