File indexing completed on 2024-04-28 04:41:52

0001 /***************************************************************************
0002  *   Copyright (C) 2017 by Emmanuel Lepage Vallee                          *
0003  *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@kde.org>             *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 3 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
0017  **************************************************************************/
0018 #ifndef HIERARCHYVIEW_H
0019 #define HIERARCHYVIEW_H
0020 
0021 // KQuickItemViews
0022 #include <KQuickItemViews/singlemodelviewbase.h>
0023 class HierarchyViewPrivate;
0024 
0025 // Qt
0026 class QQuickItem;
0027 
0028 /**
0029  * Second generation of QtQuick treeview.
0030  *
0031  * The first one was designed for the chat view. It had a limited number of
0032  * requirements when it came to QtModel. However it required total control of
0033  * the layout.
0034  *
0035  * This is the opposite use case. The layout is classic, but the model support
0036  * has to be complete. Performance and lazy loading is also more important.
0037  *
0038  * It require less work to write a new treeview than refector the first one to
0039  * support the additional requirements. In the long run, the first generation
0040  * could be folded into this widget (if it ever makes sense, otherwise they will
0041  * keep diverging).
0042  */
0043 class Q_DECL_EXPORT HierarchyView : public SingleModelViewBase
0044 {
0045     Q_OBJECT
0046 
0047     friend class HierarchyViewItem;
0048 public:
0049     explicit HierarchyView(QQuickItem* parent = nullptr);
0050     virtual ~HierarchyView();
0051 
0052 private:
0053     HierarchyViewPrivate* d_ptr;
0054     Q_DECLARE_PRIVATE(HierarchyView)
0055 };
0056 
0057 #endif