Stellarium 0.12.3
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 
42 class SatellitesListModel : public QAbstractTableModel
43 {
44  Q_OBJECT
45 public:
46  SatellitesListModel(QList<SatelliteP>* satellites, QObject *parent = 0);
47 
48  void setSatelliteList(QList<SatelliteP>* satellites);
49 
51 
52  Qt::ItemFlags flags(const QModelIndex& index) const;
53  QVariant data(const QModelIndex& index, int role) const;
54  bool setData(const QModelIndex& index, const QVariant& value, int role);
55  int rowCount(const QModelIndex& parent) const;
56  int columnCount(const QModelIndex& parent) const;
58 
59 signals:
60 
61 public slots:
67  void beginSatellitesChange();
74  void endSatellitesChange();
75  void enableColoredNames(bool enable = true);
76 
77 private:
81  QList<SatelliteP>* satelliteList;
82 
84  bool coloredNames;
85 };
86 
87 #endif // SATELLITESLISTMODEL_HPP