/*
* Tiled QML plugin
* Copyright (C) 2010 Thorbjørn Lindeijer
* Copyright (C) 2010 Nokia Corporation
*
* This file is part of the Tiled QML plugin.
*
* 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 2 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 .
*/
#ifndef MAPITEM_H
#define MAPITEM_H
#include
#include
#include
namespace Tiled {
class Map;
class MapRenderer;
} // namespace Tiled
/**
* A graphics item that displays a Map.
*/
class MapItem : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
public:
MapItem(QQuickItem *parent = 0);
QString source() const { return mSource; }
void setSource(const QString &source);
QRectF boundingRect() const;
void paint(QPainter *) {}
signals:
void sourceChanged(const QUrl &source);
private:
QString mSource;
Tiled::Map *mMap;
Tiled::MapRenderer *mRenderer;
};
QML_DECLARE_TYPE(MapItem)
#endif // MAPITEM_H