File indexing completed on 2024-05-19 08:11:53
0001 // SPDX-FileCopyrightText: 2003-2014 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 FLATCATEGORYMODEL_H 0007 #define FLATCATEGORYMODEL_H 0008 #include "AbstractCategoryModel.h" 0009 0010 #include <DB/Category.h> 0011 #include <DB/search/ImageSearchInfo.h> 0012 0013 namespace RemoteControl 0014 { 0015 class RemoteInterface; 0016 } 0017 namespace Browser 0018 { 0019 0020 /** 0021 * \brief Implements a flat model for categories - ie. a model where all catergories, including subcategories, are shown. 0022 * 0023 * See \ref Browser for a detailed description of how this fits in with the rest of the classes in this module 0024 */ 0025 class FlatCategoryModel : public AbstractCategoryModel 0026 { 0027 public: 0028 FlatCategoryModel(const DB::CategoryPtr &category, const DB::ImageSearchInfo &info); 0029 int rowCount(const QModelIndex &index) const override; 0030 0031 int columnCount(const QModelIndex &) const override; 0032 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; 0033 QModelIndex parent(const QModelIndex &index) const override; 0034 0035 QString indexToName(const QModelIndex &) const override; 0036 0037 private: 0038 friend class RemoteControl::RemoteInterface; 0039 QStringList m_items; 0040 }; 0041 0042 } 0043 0044 #endif /* FLATCATEGORYMODEL_H */ 0045 0046 // vi:expandtab:tabstop=4 shiftwidth=4: