2014-10-25 21:21:52 +00:00
|
|
|
/*
|
|
|
|
Copyright 2006-2012 Xavier Guerrin
|
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef ELEMENT_TEXTS_MOVER_H
|
|
|
|
#define ELEMENT_TEXTS_MOVER_H
|
2015-08-07 19:45:00 +00:00
|
|
|
|
|
|
|
#include <QSet>
|
|
|
|
#include <QPointF>
|
|
|
|
|
|
|
|
class QGraphicsItem;
|
2017-08-03 17:36:08 +00:00
|
|
|
class DiagramTextItem;
|
2014-10-25 21:21:52 +00:00
|
|
|
class Diagram;
|
2015-08-07 19:45:00 +00:00
|
|
|
|
2014-10-25 21:21:52 +00:00
|
|
|
/**
|
|
|
|
This class manages the interactive movement of element text items on a
|
|
|
|
particular diagram.
|
|
|
|
*/
|
2015-08-07 19:45:00 +00:00
|
|
|
class ElementTextsMover
|
|
|
|
{
|
2014-10-25 21:21:52 +00:00
|
|
|
public:
|
2015-08-07 19:45:00 +00:00
|
|
|
ElementTextsMover();
|
2014-10-25 21:21:52 +00:00
|
|
|
private:
|
2015-08-07 19:45:00 +00:00
|
|
|
ElementTextsMover(const ElementTextsMover &);
|
2014-10-25 21:21:52 +00:00
|
|
|
|
|
|
|
public:
|
2015-08-07 19:45:00 +00:00
|
|
|
bool isReady() const;
|
2017-08-03 17:36:08 +00:00
|
|
|
int beginMovement(Diagram *diagram, QGraphicsItem *driver_item = nullptr);
|
2015-08-07 19:45:00 +00:00
|
|
|
void continueMovement(const QPointF &);
|
|
|
|
void endMovement();
|
2014-10-25 21:21:52 +00:00
|
|
|
|
|
|
|
private:
|
2017-08-03 17:36:08 +00:00
|
|
|
bool m_movement_running = false;
|
|
|
|
Diagram *m_diagram = nullptr;
|
|
|
|
QGraphicsItem *m_movement_driver = nullptr;
|
|
|
|
QHash <DiagramTextItem *, QPointF> m_texts_item_H;
|
2014-10-25 21:21:52 +00:00
|
|
|
};
|
|
|
|
#endif
|