File indexing completed on 2024-05-05 05:40:59

0001 /***************************************************************************
0002  *      Copyright (C) 2010 by Renaud Guezennec                             *
0003  *                                                                         *
0004  *                                                                         *
0005  *   rolisteam is free software; you can redistribute it and/or modify     *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
0019  ***************************************************************************/
0020 #ifndef MAPWIZZARDDIALOG_H
0021 #define MAPWIZZARDDIALOG_H
0022 
0023 #include <QColor>
0024 #include <QDialog>
0025 
0026 #include "customs/vmap.h"
0027 #include "model/patternmodel.h"
0028 #include "rwidgets_global.h"
0029 
0030 namespace Ui
0031 {
0032 class MapWizzardDialog;
0033 }
0034 
0035 class PreferencesManager;
0036 /**
0037  * @brief set values to create a map with appropriate value.
0038  */
0039 class RWIDGET_EXPORT MapWizzardDialog : public QDialog
0040 {
0041     Q_OBJECT
0042 public:
0043     /**
0044      * @brief constructor
0045      * @param parent, pointer to the parent widget.
0046      */
0047     MapWizzardDialog(QWidget* parent= nullptr);
0048     /**
0049      * @brief destructor
0050      */
0051     ~MapWizzardDialog();
0052     QString name() const;
0053     QColor backgroundColor() const;
0054     int gridSize() const;
0055     QColor gridColor() const;
0056     Core::GridPattern pattern() const;
0057     Core::PermissionMode permission() const;
0058     Core::VisibilityMode visibility() const;
0059     Core::ScaleUnit unit() const;
0060     qreal scale() const;
0061 
0062     void updateUI();
0063 
0064 protected:
0065     /**
0066      * @brief overwritting the changeevent: create by Qtcreator
0067      * @param event describe the context of the event.
0068      */
0069     void changeEvent(QEvent* e);
0070 
0071 private slots:
0072     /**
0073      * @brief slot called when user changed the shape of the future map.
0074      */
0075     // void selectedShapeChanged();
0076 
0077 private:
0078     /**
0079      * @brief pointer to the user interface Qt designer
0080      */
0081     Ui::MapWizzardDialog* ui;
0082     /**
0083      * @brief pointer to the unique instance of preference manager.
0084      */
0085     PreferencesManager* m_options;
0086 
0087     /**
0088      * @brief model gathering all grid patterns.
0089      */
0090     PatternModel* m_model;
0091     /**
0092      * @brief m_permissionData
0093      */
0094     QStringList m_permissionData;
0095     QStringList m_visibilityData;
0096 };
0097 
0098 #endif // MAPWIZZARDDIALOG_H