2
* Copyright 2015 Canonical Ltd.
4
* This file is part of webbrowser-app.
6
* webbrowser-app is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* webbrowser-app is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef __HISTORY_LASTVISITDATE_MODEL_H__
20
#define __HISTORY_LASTVISITDATE_MODEL_H__
23
#include <QtCore/QDate>
24
#include <QtCore/QSortFilterProxyModel>
25
#include <QtCore/QString>
26
#include <QtCore/QUrl>
28
class HistoryTimeframeModel;
30
class HistoryLastVisitDateModel : public QSortFilterProxyModel
34
Q_PROPERTY(HistoryTimeframeModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
35
Q_PROPERTY(QDate lastVisitDate READ lastVisitDate WRITE setLastVisitDate NOTIFY lastVisitDateChanged)
38
HistoryLastVisitDateModel(QObject* parent=0);
40
HistoryTimeframeModel* sourceModel() const;
41
void setSourceModel(HistoryTimeframeModel* sourceModel);
43
const QDate& lastVisitDate() const;
44
Q_INVOKABLE void setLastVisitDate(const QDate& lastVisitDate);
46
Q_INVOKABLE QVariantMap get(int index) const;
49
void sourceModelChanged() const;
50
void lastVisitDateChanged() const;
53
// reimplemented from QSortFilterProxyModel
54
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
57
QDate m_lastVisitDate;
60
#endif // __HISTORY_LASTVISITDATE_MODEL_H__