summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/MapItem.h
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/widgets/MapItem.h')
-rw-r--r--sigmodr/widgets/MapItem.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/sigmodr/widgets/MapItem.h b/sigmodr/widgets/MapItem.h
new file mode 100644
index 00000000..4595546f
--- /dev/null
+++ b/sigmodr/widgets/MapItem.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SIGMODRWIDGETS_MAPITEM
+#define SIGMODRWIDGETS_MAPITEM
+
+// Sigmodr widget includes
+#include "Global.h"
+
+// Qt includes
+#include <QtCore/QObject>
+#include <QtGui/QGraphicsItem>
+
+// Forward declarations
+class QGraphicsScene;
+
+namespace Sigmodr
+{
+namespace Widgets
+{
+class SIGMODRWIDGETS_NO_EXPORT MapItem : public QObject, public QGraphicsItem
+{
+ Q_OBJECT
+
+ public:
+ MapItem(const bool resizable, QGraphicsScene* parent);
+
+ virtual QRectF boundingRect() const = 0;
+
+ virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
+ signals:
+ void changed();
+ protected:
+ virtual void focusInEvent(QFocusEvent* event);
+ virtual void focusOutEvent(QFocusEvent* event);
+ virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
+
+ virtual void resize(const QPointF& size);
+
+ const bool m_resizable;
+};
+}
+}
+
+#endif