Messagelib

attachmentpropertiesdialog.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  Based on KMail code by various authors (kmmsgpartdlg).
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include "messagecore_export.h"
12 
13 #include "attachmentpart.h"
14 
15 #include <QDialog>
16 
17 namespace MessageCore
18 {
19 /**
20  * @short A dialog for editing attachment properties.
21  *
22  * @author Constantin Berzan <[email protected]>
23  */
24 class MESSAGECORE_EXPORT AttachmentPropertiesDialog : public QDialog
25 {
26  Q_OBJECT
27 
28 public:
29  /**
30  * Creates a new attachment properties dialog.
31  *
32  * @param part The attachment part which properties to change.
33  * @param readOnly Whether the dialog should be in read-only mode.
34  * @param parent The parent object.
35  */
36  explicit AttachmentPropertiesDialog(const AttachmentPart::Ptr &part, bool readOnly = false, QWidget *parent = nullptr);
37 
38  /**
39  * Creates a new attachment properties dialog.
40  *
41  * @param content The mime content that represents the attachment which properties to change.
42  * @param parent The parent object.
43  *
44  * @note This converts the KMime::Content to an AttachmentPart internally.
45  * Therefore, saving the changes to the KMime::Content is not supported,
46  * and the dialog is in readOnly mode.
47  */
48  explicit AttachmentPropertiesDialog(const KMime::Content *content, QWidget *parent = nullptr);
49 
50  /**
51  * Destroys the attachment properties dialog.
52  */
53  ~AttachmentPropertiesDialog() override;
54 
55  /**
56  * Returns the modified attachment.
57  */
58  Q_REQUIRED_RESULT AttachmentPart::Ptr attachmentPart() const;
59 
60  /**
61  * Sets whether the encryption status of the attachment can be changed.
62  */
63  void setEncryptEnabled(bool enabled);
64 
65  /**
66  * Returns whether the encryption status of the attachment can be changed.
67  */
68  Q_REQUIRED_RESULT bool isEncryptEnabled() const;
69 
70  /**
71  * Sets whether the signature status of the attachment can be changed.
72  */
73  void setSignEnabled(bool enabled);
74 
75  /**
76  * Returns whether the signature status of the attachment can be changed.
77  */
78  Q_REQUIRED_RESULT bool isSignEnabled() const;
79 
80 public Q_SLOTS:
81  void accept() override;
82  void slotHelp();
83 
84 private:
85  //@cond PRIVATE
86  class AttachmentPropertiesDialogPrivate;
87  std::unique_ptr<AttachmentPropertiesDialogPrivate> const d;
88  //@endcond
89 };
90 }
91 
A dialog for editing attachment properties.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Dec 2 2021 23:06:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.