2 ******************************************************************************
4 * @file subvehiclepage.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
8 * @addtogroup SubVehiclePage
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef SUBVEHICLEPAGEPAGE_H
29 #define SUBVEHICLEPAGEPAGE_H
31 #include <QtSvg/QGraphicsSvgItem>
32 #include <QtSvg/QSvgRenderer>
35 #include "abstractwizardpage.h"
43 SelectionItem(QString name
, QString description
, QString shapeId
, int id
, bool disabled
= false);
61 void setDisabled(bool disabled
)
63 m_disabled
= disabled
;
72 QString m_description
;
81 virtual void addItem(QString name
, QString description
, QString shapeId
, int id
, bool disabled
= false) = 0;
82 virtual void setTitle(QString title
) = 0;
83 virtual void setText(QString text
) = 0;
84 virtual void setItemDisabled(int id
, bool disabled
) = 0;
87 class SelectionPage
: public AbstractWizardPage
, public Selection
{
91 explicit SelectionPage(SetupWizard
*wizard
, QString shapeFile
, QWidget
*parent
= 0);
94 void initializePage();
96 void addItem(QString name
, QString description
, QString shapeId
, int id
, bool disabled
= false);
97 void setTitle(QString title
);
98 void setText(QString text
);
99 void setItemDisabled(int id
, bool disabled
);
100 void setSelectedItem(int id
);
101 SelectionItem
*getSelectedItem();
104 virtual void setupSelection(Selection
*selection
) = 0;
105 virtual void initializePage(VehicleConfigurationSource
*settings
) = 0;
106 virtual bool validatePage(SelectionItem
*selectedItem
) = 0;
107 void resizeEvent(QResizeEvent
*event
);
108 void showEvent(QShowEvent
*event
);
111 Ui::SelectionPage
*ui
;
112 QGraphicsSvgItem
*m_shape
;
113 QList
<SelectionItem
*> m_selectionItems
;
116 void selectionChanged(int index
);
120 #endif // SUBVEHICLEPAGEPAGE_H