File indexing completed on 2024-06-23 05:49:16

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_DOCUMENTSVIEW_HPP
0010 #define KASTEN_DOCUMENTSVIEW_HPP
0011 
0012 // Qt
0013 #include <QWidget>
0014 
0015 class QTreeView;
0016 class QModelIndex;
0017 
0018 namespace Kasten {
0019 
0020 class DocumentListModel;
0021 class DocumentsTool;
0022 
0023 class DocumentsView : public QWidget
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit DocumentsView(DocumentsTool* tool, QWidget* parent = nullptr);
0029     ~DocumentsView() override;
0030 
0031 public:
0032     DocumentsTool* tool() const;
0033 
0034 private Q_SLOTS:
0035     void onDocumentActivated(const QModelIndex& index);
0036 
0037 private:
0038     DocumentsTool* mTool;
0039 
0040     DocumentListModel* mDocumentListModel;
0041 
0042     QTreeView* mDocumentListView;
0043 };
0044 
0045 inline DocumentsTool* DocumentsView::tool() const { return mTool; }
0046 
0047 }
0048 
0049 #endif