File indexing completed on 2024-11-24 04:49:36
0001 /* 0002 kleo/docaction.h 0003 0004 This file is part of libkleopatra, the KDE keymanagement library 0005 SPDX-FileCopyrightText: 2022 g10 Code GmbH 0006 SPDX-FileContributor: Andre Heinecke <aheinecke@g10code.com> 0007 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #pragma once 0012 0013 #include "kleo_export.h" 0014 0015 #include <QAction> 0016 0017 #include <memory> 0018 0019 class QIcon; 0020 class QString; 0021 0022 namespace Kleo 0023 { 0024 /** 0025 An action for custom documentation which is opened 0026 by file. This can be used for PDF documents like the 0027 GnuPG manual. 0028 0029 The action is disabled and invisible if the corresponding 0030 file cannout be found at creation. Otherwise triggered 0031 calls QDesktopServicesOpenURL on the file. 0032 */ 0033 class KLEO_EXPORT DocAction : public QAction 0034 { 0035 Q_OBJECT 0036 0037 public: 0038 /* Create a DocAction with icon, text and file name of the document 0039 * 0040 * @a filename The name of the documentation file. 0041 * @a pathHint A path relative to QCoreApplication::applicationDirPath() to look for the file. 0042 * 0043 * */ 0044 explicit DocAction(const QIcon &icon, const QString &text, const QString &filename, const QString &pathHint = QString(), QObject *parent = nullptr); 0045 0046 ~DocAction() override; 0047 0048 DocAction(const QString &, QObject *parent) = delete; 0049 DocAction(QObject *parent) = delete; 0050 0051 private: 0052 class Private; 0053 std::unique_ptr<Private> d; 0054 }; 0055 0056 } // namespace Kleo