File indexing completed on 2025-01-05 04:55:45

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     models/keylistmodelinterface.h
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
0005     SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
0006     SPDX-FileCopyrightText: 2021 g10 Code GmbH
0007     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #pragma once
0013 
0014 #include "kleo_export.h"
0015 
0016 #include <vector>
0017 
0018 namespace GpgME
0019 {
0020 class Key;
0021 }
0022 
0023 class QModelIndex;
0024 template<typename T>
0025 class QList;
0026 
0027 namespace Kleo
0028 {
0029 class KeyGroup;
0030 
0031 class KLEO_EXPORT KeyListModelInterface
0032 {
0033 public:
0034     virtual ~KeyListModelInterface();
0035 
0036     virtual GpgME::Key key(const QModelIndex &idx) const = 0;
0037     virtual std::vector<GpgME::Key> keys(const QList<QModelIndex> &idxs) const = 0;
0038 
0039     virtual QModelIndex index(const GpgME::Key &key) const = 0;
0040     virtual QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) const = 0;
0041 
0042     virtual KeyGroup group(const QModelIndex &idx) const = 0;
0043     virtual QModelIndex index(const KeyGroup &group) const = 0;
0044 };
0045 
0046 }