Stellarium  0.90.0
SatellitesListModel.hpp
1 /*
2  * Copyright (C) 2013 Bogdan Marinov
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef SATELLITESLISTMODEL_HPP
20 #define SATELLITESLISTMODEL_HPP
21 
22 #include <QAbstractTableModel>
23 #include <QList>
24 #include <QSharedPointer>
25 
26 #include "Satellite.hpp"
27 
43 class SatellitesListModel : public QAbstractTableModel
44 {
45  Q_OBJECT
46 public:
47  SatellitesListModel(QList<SatelliteP>* satellites, QObject *parent = Q_NULLPTR);
48 
49  void setSatelliteList(QList<SatelliteP>* satellites);
50 
52 
53  Qt::ItemFlags flags(const QModelIndex& index) const;
54  QVariant data(const QModelIndex& index, int role) const;
55  bool setData(const QModelIndex& index, const QVariant& value, int role);
56  int rowCount(const QModelIndex& parent) const;
57  int columnCount(const QModelIndex& parent) const;
59 
60 signals:
61 
62 public slots:
68  void beginSatellitesChange();
75  void endSatellitesChange();
76  void enableColoredNames(bool enable = true);
77 
78 private:
82  QList<SatelliteP>* satelliteList;
83 
85  bool coloredNames;
86 };
87 
88 #endif // SATELLITESLISTMODEL_HPP
void beginSatellitesChange()
Tell the model that its internal data structure is about to be modified.
void endSatellitesChange()
Tell the model that its internal data has been modified.
A model encapsulating a satellite list.