diff options
Diffstat (limited to 'src/tabbrowsinghistory.hpp')
| -rw-r--r-- | src/tabbrowsinghistory.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tabbrowsinghistory.hpp b/src/tabbrowsinghistory.hpp new file mode 100644 index 0000000..4305218 --- /dev/null +++ b/src/tabbrowsinghistory.hpp @@ -0,0 +1,39 @@ +#ifndef TABBROWSINGHISTORY_HPP +#define TABBROWSINGHISTORY_HPP + +#include <QAbstractListModel> +#include <QVector> +#include <QUrl> + +class TabBrowsingHistory : + public QAbstractListModel +{ + Q_OBJECT +public: + TabBrowsingHistory(); + + bool canGoBack() const; + + bool canGoForward() const; + + QModelIndex pushUrl(QModelIndex const & position, QUrl const & url); + + QUrl get(QModelIndex const & index) const; + + QModelIndex oneForward(QModelIndex index) const; + + QModelIndex oneBackward(QModelIndex index) const; + +public: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + + +private: + QVector<QUrl> history; +}; + +#endif // TABBROWSINGHISTORY_HPP |
