Libkleo

docaction.h
1 /*
2  kleo/docaction.h
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  SPDX-FileCopyrightText: 2022 g10 Code GmbH
6  SPDX-FileContributor: Andre Heinecke <aheinecke@g10code.com>
7 
8  SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 
11 #pragma once
12 
13 #include "kleo_export.h"
14 
15 #include <QAction>
16 
17 #include <memory>
18 
19 class QIcon;
20 class QString;
21 
22 namespace Kleo
23 {
24 /**
25  An action for custom documentation which is opened
26  by file. This can be used for PDF documents like the
27  GnuPG manual.
28 
29  The action is disabled and invisible if the corresponding
30  file cannout be found at creation. Otherwise triggered
31  calls QDesktopServicesOpenURL on the file.
32 */
33 class KLEO_EXPORT DocAction : public QAction
34 {
35  Q_OBJECT
36 
37 public:
38  /* Create a DocAction with icon, text and file name of the document
39  *
40  * @a filename The name of the documentation file.
41  * @a pathHint A path relative to QCoreApplication::applicationDirPath() to look for the file.
42  *
43  * */
44  explicit DocAction(const QIcon &icon, const QString &text, const QString &filename, const QString &pathHint = QString(), QObject *parent = nullptr);
45 
46  ~DocAction() override;
47 
48  DocAction(const QString &, QObject *parent) = delete;
49  DocAction(QObject *parent) = delete;
50 
51 private:
52  class Private;
53  std::unique_ptr<Private> d;
54 };
55 
56 } // namespace Kleo
An action for custom documentation which is opened by file.
Definition: docaction.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:56:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.