File indexing completed on 2024-05-19 08:11:53
0001 // SPDX-FileCopyrightText: 2003-2013 Jesper K. Pedersen <jesper.pedersen@kdab.com> 0002 // SPDX-FileCopyrightText: 2013-2023 Johannes Zarl-Zierl <johannes@zarl-zierl.at> 0003 // 0004 // SPDX-License-Identifier: GPL-2.0-or-later 0005 0006 #ifndef CATEGORYPAGE_H 0007 #define CATEGORYPAGE_H 0008 #include "BrowserPage.h" 0009 0010 #include <DB/Category.h> 0011 #include <DB/CategoryPtr.h> 0012 #include <DB/search/ImageSearchInfo.h> 0013 0014 class QAbstractItemModel; 0015 class FlatCategoryModel; 0016 class BrowserWidget; 0017 0018 namespace Browser 0019 { 0020 0021 /** 0022 * \brief The Browser page for categories. 0023 * 0024 * See \ref Browser for a detailed description of how this fits in with the rest of the classes in this module 0025 * 0026 */ 0027 class CategoryPage : public BrowserPage 0028 { 0029 public: 0030 CategoryPage(const DB::CategoryPtr &category, const DB::ImageSearchInfo &info, BrowserWidget *browser); 0031 void activate() override; 0032 BrowserPage *activateChild(const QModelIndex &) override; 0033 DB::Category::ViewType viewType() const override; 0034 bool isViewChangeable() const override; 0035 0036 DB::CategoryPtr category() const; 0037 0038 private: 0039 const DB::CategoryPtr m_category; 0040 QAbstractItemModel *m_model; 0041 }; 0042 0043 } 0044 0045 #endif /* CATEGORYPAGE_H */ 0046 0047 // vi:expandtab:tabstop=4 shiftwidth=4: