Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef MAPPROJECT_H
00028 #define MAPPROJECT_H
00029
00030 #include <QtGui>
00031
00032 #include <QGpCoreTools.h>
00033
00034 #include "DrawScene.h"
00035
00036 class MapView;
00037
00038 class MapProject : public QObject, public XMLClass
00039 {
00040 Q_OBJECT
00041 Q_PROPERTY(QString script READ script WRITE setScript SCRIPTABLE true)
00042 public:
00043 MapProject();
00044 ~MapProject();
00045
00046 virtual const QString& xml_tagName() const {return xmlMapProjectTag;}
00047 static const QString xmlMapProjectTag;
00048
00049 void setName(const QString& name);
00050 QString name() const {return _name;}
00051 QString fileName() const {return _fileName;}
00052
00053 bool isModified() const {return _modified;}
00054
00055 bool open(QString fileName=QString::null);
00056 bool save();
00057 bool saveAs(QString fileName=QString::null);
00058 bool isClosable();
00059
00060 const QString& script() const {return _script;}
00061 void setScript(const QString& s);
00062
00063 void addConsoleCommand(const QString& cmd);
00064 void addCommand(const QString& cmd);
00065
00066 QPointF currentPoint() const {return _scene->currentPoint();}
00067
00068 void addView(MapView * v);
00069 bool removeView(MapView * v);
00070 int viewCount() const {return _views.count();}
00071 MapView * view(int index) {return _views.at(index);}
00072
00073 void print(int dpi=300);
00074 void exportImage(QString fileName=QString::null, QString imageFormat=QString::null, int dpi=300);
00075 void print(QPrinter& printer);
00076 QPixmap image(int dpi);
00077
00078 DrawScene * scene() const {return _scene;}
00079
00080 static const QString pixelImageFilter;
00081 static const QString vectorialImageFilter;
00082 static const QString allImageFilter;
00083 signals:
00084 void newCommand(const QString& cmd);
00085 protected:
00086 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const {qobject_writeProperties(this, this, s, context);}
00087 virtual XMLMember xml_member(XML_MEMBER_ARGS) {return qobject_member(this, tag, attributes, context);}
00088 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS) {return qobject_setProperty(this, memberID, tag, attributes, content, context);}
00089 private:
00090 void setFileName(const QString& fileName);
00091 void setModified(bool m);
00092 void setWindowTitle();
00093
00094 bool _modified;
00095 QString _script;
00096 DrawScene * _scene;
00097 QList<MapView *> _views;
00098 QString _name;
00099 QString _fileName;
00100 };
00101
00102 #endif // MAPPROJECT_H