File indexing completed on 2025-01-05 04:55:46
0001 /* models/keyrearangecolumnsproxymodel.h 0002 0003 This file is part of Kleopatra, the KDE keymanager 0004 SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik 0005 SPDX-FileContributor: Intevation GmbH 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 #include "keylistmodelinterface.h" 0013 #include "kleo_export.h" 0014 0015 #include <KRearrangeColumnsProxyModel> 0016 0017 namespace Kleo 0018 { 0019 /** KRearrangeColumnsProxymodel that implements the KeyListModelInterface. */ 0020 class KLEO_EXPORT KeyRearrangeColumnsProxyModel : public KRearrangeColumnsProxyModel, public KeyListModelInterface 0021 { 0022 public: 0023 explicit KeyRearrangeColumnsProxyModel(QObject *parent = nullptr); 0024 0025 GpgME::Key key(const QModelIndex &idx) const override; 0026 std::vector<GpgME::Key> keys(const QList<QModelIndex> &idxs) const override; 0027 0028 KeyGroup group(const QModelIndex &idx) const override; 0029 0030 using KRearrangeColumnsProxyModel::index; 0031 0032 QModelIndex index(const GpgME::Key &key) const override; 0033 QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) const override; 0034 0035 QModelIndex index(const KeyGroup &group) const override; 0036 0037 void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; 0038 0039 private: 0040 KeyListModelInterface *klm() const; 0041 }; 0042 } // namespace Kleo