| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net> |
| 3 | SPDX-FileContributor: Stephen Kelly <stephen@kdab.com> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KVIEWSTATEMAINTAINERBASE_H |
| 9 | #define KVIEWSTATEMAINTAINERBASE_H |
| 10 | |
| 11 | #include "kwidgetsaddons_export.h" |
| 12 | |
| 13 | #include <QObject> |
| 14 | |
| 15 | #include <memory> |
| 16 | |
| 17 | class QItemSelectionModel; |
| 18 | class QAbstractItemView; |
| 19 | |
| 20 | class KViewStateMaintainerBasePrivate; |
| 21 | |
| 22 | /*! |
| 23 | * \class KViewStateMaintainerBase |
| 24 | * \inmodule KWidgetsAddons |
| 25 | */ |
| 26 | class KWIDGETSADDONS_EXPORT KViewStateMaintainerBase : public QObject |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | public: |
| 30 | /*! |
| 31 | * |
| 32 | */ |
| 33 | KViewStateMaintainerBase(QObject *parent = nullptr); |
| 34 | ~KViewStateMaintainerBase() override; |
| 35 | |
| 36 | /*! |
| 37 | * |
| 38 | */ |
| 39 | void setSelectionModel(QItemSelectionModel *selectionModel); |
| 40 | |
| 41 | /*! |
| 42 | * |
| 43 | */ |
| 44 | QItemSelectionModel *selectionModel() const; |
| 45 | |
| 46 | /*! |
| 47 | * |
| 48 | */ |
| 49 | void setView(QAbstractItemView *view); |
| 50 | |
| 51 | /*! |
| 52 | * |
| 53 | */ |
| 54 | QAbstractItemView *view() const; |
| 55 | |
| 56 | /*! |
| 57 | * |
| 58 | */ |
| 59 | virtual void saveState() = 0; |
| 60 | |
| 61 | /*! |
| 62 | * |
| 63 | */ |
| 64 | virtual void restoreState() = 0; |
| 65 | |
| 66 | private: |
| 67 | Q_DECLARE_PRIVATE(KViewStateMaintainerBase) |
| 68 | std::unique_ptr<KViewStateMaintainerBasePrivate> const d_ptr; |
| 69 | }; |
| 70 | |
| 71 | #endif |
| 72 | |