1 /**************************************************************************
4 Copyright (C) 2010 Heli Hyvättinen
6 This file is part of KitchenAlert.
8 Kitchen Alert is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 **************************************************************************/
27 #ifndef CURRENTALERTSTABLEMODEL_H
28 #define CURRENTALERTSTABLEMODEL_H
30 #include <QAbstractTableModel>
34 /*! Class that contains the model that holds the timers'
36 @author Heli Hyvättinen
40 Class that contains the model that holds the timers
45 class CurrentAlertsTableModel : public QAbstractTableModel
49 explicit CurrentAlertsTableModel(QObject *parent = 0);
51 int rowCount(const QModelIndex &parent) const;
53 int columnCount(const QModelIndex &parent) const;
55 QVariant data(const QModelIndex &index, int role) const;
57 QModelIndex giveIndexForTimer(Timer * ptimer);
63 void addTimers(QList <Timer *> timers);
65 void refreshTimeColumn ();
67 void startTimer(QModelIndex index);
68 void snoozeTimer(QModelIndex index);
69 void stopTimer(QModelIndex index);
72 QList <Timer * > currentTimers_;
74 static const int numberOfColumns_ = 3;
75 static const int alertTextColumnNumber_ = 0;
76 static const int timeRemainingColumnNumber_ = 1;
77 static const int statusColumnNumber_ = 2;
81 #endif // CURRENTALERTSTABLEMODEL_H