Messagelib

attachmentcontrollerbase.h
1 /*
2  * This file is part of KMail.
3  * SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
4  *
5  * Parts based on KMail code by:
6  * Various authors.
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef MESSAGECOMPOSER_ATTACHMENTCONTROLLERBASE_H
12 #define MESSAGECOMPOSER_ATTACHMENTCONTROLLERBASE_H
13 
14 #include <QObject>
15 
16 #include <QUrl>
17 
18 #include <MessageCore/AttachmentPart>
19 #include <MessageViewer/EditorWatcher>
20 #include <KJob>
21 #include <KService>
22 #include "messagecomposer_export.h"
23 
24 class KActionCollection;
25 class QAction;
26 
27 namespace MessageComposer {
28 class AttachmentModel;
32 class MESSAGECOMPOSER_EXPORT AttachmentControllerBase : public QObject
33 {
34  Q_OBJECT
35 
36 public:
39 
40  void createActions();
41 
42  // TODO dnd stuff...
43 
44  void setSelectedParts(const MessageCore::AttachmentPart::List &selectedParts);
45 
46  void setAttachOwnVcard(bool attachVcard);
47  Q_REQUIRED_RESULT bool attachOwnVcard() const;
48  void setIdentityHasOwnVcard(bool state);
49 
50 public Q_SLOTS:
52  void setEncryptEnabled(bool enabled);
53  void setSignEnabled(bool enabled);
55  void compressAttachment(const MessageCore::AttachmentPart::Ptr &part, bool compress);
56  void showContextMenu();
57  void openAttachment(const MessageCore::AttachmentPart::Ptr &part);
58  void viewAttachment(const MessageCore::AttachmentPart::Ptr &part);
59  void editAttachment(MessageCore::AttachmentPart::Ptr part, MessageViewer::EditorWatcher::OpenWithOption option = MessageViewer::EditorWatcher::NoOpenWithDialog);
60  void editAttachmentWith(const MessageCore::AttachmentPart::Ptr &part);
61  void saveAttachmentAs(const MessageCore::AttachmentPart::Ptr &part);
62  void attachmentProperties(const MessageCore::AttachmentPart::Ptr &part);
63  void showAddAttachmentFileDialog();
64  void showAddAttachmentCompressedDirectoryDialog();
66  void addAttachment(const MessageCore::AttachmentPart::Ptr &part);
67  void addAttachment(const QUrl &url);
68  void addAttachmentUrlSync(const QUrl &url);
69  void addAttachments(const QList<QUrl> &urls);
70  void showAttachPublicKeyDialog();
71  void showAttachVcard();
72  void showAttachClipBoard();
73  virtual void attachMyPublicKey();
74 
75 Q_SIGNALS:
76  void actionsCreated();
77  void refreshSelection();
78  void showAttachment(KMime::Content *content, const QByteArray &charset);
79  void selectedAllAttachment();
80  void addOwnVcard(bool);
81  void fileAttached();
82 
83 protected:
84  void exportPublicKey(const QString &fingerprint);
85  void enableAttachPublicKey(bool enable);
86  void enableAttachMyPublicKey(bool enable);
87  void byteArrayToRemoteFile(const QByteArray &aData, const QUrl &aURL, bool overwrite = false);
88  void openWith(const KService::Ptr &offer = KService::Ptr());
89 
90 private:
91  void attachDirectory(const QUrl &url);
92  void slotPutResult(KJob *job);
93  void slotOpenWithDialog();
94  void slotOpenWithAction(QAction *act);
95 
96 private:
97  class Private;
98  Private *const d;
99 };
100 } //
101 
102 #endif
The AttachmentModel class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The AttachmentControllerBase class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:12:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.