2007-08-07 15:09:41 +00:00
|
|
|
/* This file is part of Mapnik (c++ mapping toolkit)
|
2011-10-23 14:09:12 +00:00
|
|
|
*
|
2011-10-23 13:04:25 +00:00
|
|
|
* Copyright (C) 2011 Artem Pavlenko
|
2007-08-07 15:09:41 +00:00
|
|
|
*
|
|
|
|
* Mapnik 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 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
//$Id$
|
|
|
|
|
|
|
|
#ifndef MAINWINDOW_HPP
|
|
|
|
#define MAINWINDOW_HPP
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QPrinter>
|
|
|
|
#include <QList>
|
|
|
|
#include <QActionGroup>
|
|
|
|
#include <QStatusBar>
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
|
|
|
|
#include "mapwidget.hpp"
|
|
|
|
|
|
|
|
//using namespace mapnik;
|
|
|
|
|
|
|
|
class LayerTab;
|
|
|
|
class StyleTab;
|
|
|
|
class QSlider;
|
2012-05-03 14:21:17 +00:00
|
|
|
class QComboBox;
|
2007-08-07 15:09:41 +00:00
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
2010-06-15 12:28:30 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MainWindow();
|
|
|
|
virtual ~MainWindow();
|
|
|
|
void set_default_extent(double x0,double y0,double x1, double y1);
|
2010-06-17 08:26:08 +00:00
|
|
|
void set_scaling_factor(double scaling_factor);
|
2010-06-15 12:28:30 +00:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent* event);
|
2007-08-07 15:09:41 +00:00
|
|
|
public slots:
|
2010-06-15 12:28:30 +00:00
|
|
|
void zoom_all();
|
|
|
|
void zoom_to_box();
|
|
|
|
void pan();
|
|
|
|
void info();
|
|
|
|
void export_as();
|
2012-06-08 12:24:15 +00:00
|
|
|
void export_as_pdf();
|
|
|
|
void export_as_meta();
|
2010-06-15 12:28:30 +00:00
|
|
|
void open(QString const& path = QString());
|
|
|
|
void reload();
|
|
|
|
void save();
|
|
|
|
void print();
|
|
|
|
void about();
|
|
|
|
void pan_left();
|
|
|
|
void pan_right();
|
|
|
|
void pan_up();
|
|
|
|
void pan_down();
|
|
|
|
private:
|
|
|
|
void createActions();
|
|
|
|
void createMenus();
|
|
|
|
void createToolBars();
|
|
|
|
void createContextMenu();
|
|
|
|
void load_map_file(QString const& filename);
|
2011-10-23 14:09:12 +00:00
|
|
|
|
2007-08-07 15:09:41 +00:00
|
|
|
|
2010-06-15 12:28:30 +00:00
|
|
|
QString currentPath;
|
|
|
|
QString filename_;
|
|
|
|
QAbstractItemModel *model;
|
|
|
|
LayerTab *layerTab_;
|
|
|
|
StyleTab * styleTab_;
|
|
|
|
MapWidget * mapWidget_;
|
|
|
|
QPrinter printer;
|
|
|
|
//actions
|
|
|
|
QList<QAction *> exportAsActs;
|
|
|
|
QActionGroup *toolsGroup;
|
2007-08-07 15:09:41 +00:00
|
|
|
|
2010-06-15 12:28:30 +00:00
|
|
|
QAction *zoomAllAct;
|
|
|
|
QAction *zoomBoxAct;
|
|
|
|
QAction *panAct;
|
|
|
|
QAction *infoAct;
|
|
|
|
QAction *openAct;
|
|
|
|
QAction *saveAct;
|
2012-06-08 12:24:15 +00:00
|
|
|
QAction *exportPdfAction;
|
|
|
|
QAction *exportMetaAction;
|
2010-06-15 12:28:30 +00:00
|
|
|
QAction *printAct;
|
|
|
|
QAction *exitAct;
|
|
|
|
QAction *aboutAct;
|
|
|
|
QAction *panLeftAct;
|
|
|
|
QAction *panRightAct;
|
|
|
|
QAction *panUpAct;
|
|
|
|
QAction *panDownAct;
|
|
|
|
QAction *reloadAct;
|
|
|
|
QAction *layerInfo;
|
|
|
|
//toolbars
|
|
|
|
QToolBar *fileToolBar;
|
|
|
|
QToolBar *editToolBar;
|
|
|
|
//menus
|
|
|
|
QMenu *exportMenu;
|
|
|
|
QMenu *fileMenu;
|
|
|
|
QMenu *helpMenu;
|
|
|
|
//status bar
|
|
|
|
QStatusBar *status;
|
|
|
|
QSlider * slider_;
|
2012-05-03 14:21:17 +00:00
|
|
|
QComboBox * renderer_selector_;
|
2010-06-15 12:28:30 +00:00
|
|
|
mapnik::box2d<double> default_extent_;
|
2007-08-07 15:09:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //MAINWINDOW_HPP
|