~uriboni/webbrowser-app/tab-context-menu

« back to all changes in this revision

Viewing changes to src/app/webbrowser/history-lastvisitdate-model.h

  • Committer: CI Train Bot
  • Author(s): Arthur Mello, Ugo Riboni, Olivier Tilloy
  • Date: 2015-08-12 19:53:13 UTC
  • mfrom: (1126.1.5 wide-views-newtab-history)
  • Revision ID: ci-train-bot@canonical.com-20150812195313-u5v7kzrj8hfiacsj
Wide screen versions of the history view and new tab view, per design specification.
This adds a build dependency on qml-module-qt-labs-settings (for unit tests). Fixes: #1351157, #1481647

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2015 Canonical Ltd.
 
3
 *
 
4
 * This file is part of webbrowser-app.
 
5
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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/>.
 
17
 */
 
18
 
 
19
#ifndef __HISTORY_LASTVISITDATE_MODEL_H__
 
20
#define __HISTORY_LASTVISITDATE_MODEL_H__
 
21
 
 
22
// Qt
 
23
#include <QtCore/QDate>
 
24
#include <QtCore/QSortFilterProxyModel>
 
25
#include <QtCore/QString>
 
26
#include <QtCore/QUrl>
 
27
 
 
28
class HistoryTimeframeModel;
 
29
 
 
30
class HistoryLastVisitDateModel : public QSortFilterProxyModel
 
31
{
 
32
    Q_OBJECT
 
33
 
 
34
    Q_PROPERTY(HistoryTimeframeModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
 
35
    Q_PROPERTY(QDate lastVisitDate READ lastVisitDate WRITE setLastVisitDate NOTIFY lastVisitDateChanged)
 
36
 
 
37
public:
 
38
    HistoryLastVisitDateModel(QObject* parent=0);
 
39
 
 
40
    HistoryTimeframeModel* sourceModel() const;
 
41
    void setSourceModel(HistoryTimeframeModel* sourceModel);
 
42
 
 
43
    const QDate& lastVisitDate() const;
 
44
    Q_INVOKABLE void setLastVisitDate(const QDate& lastVisitDate);
 
45
 
 
46
    Q_INVOKABLE QVariantMap get(int index) const;
 
47
 
 
48
Q_SIGNALS:
 
49
    void sourceModelChanged() const;
 
50
    void lastVisitDateChanged() const;
 
51
 
 
52
protected:
 
53
    // reimplemented from QSortFilterProxyModel
 
54
    bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
 
55
 
 
56
private:
 
57
    QDate m_lastVisitDate;
 
58
};
 
59
 
 
60
#endif // __HISTORY_LASTVISITDATE_MODEL_H__