Messagelib

attachmentdialog.h
1 /*
2  This file is part of KMail, the KDE mail client.
3  SPDX-FileCopyrightText: 2009 Martin Koller <[email protected]>
4 
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 #include <KService>
11 #include <QObject>
12 
13 class QDialog;
14 class QDialogButtonBox;
15 namespace MessageViewer
16 {
17 /**
18  * A class which handles the dialog used to present the user a choice what to do
19  * with an attachment.
20  */
21 class AttachmentDialog : public QObject
22 {
23  Q_OBJECT
24 
25 public:
26  /// returncodes for exec()
27  enum { Save = 2, Open, OpenWith, Cancel };
28 
29  // if @offer is non-null, the "open with <application>" button will also be shown,
30  // otherwise only save, open with, cancel
31  explicit AttachmentDialog(QWidget *parent, const QString &filenameText, const KService::Ptr &offer, const QString &dontAskAgainName);
32 
33  // executes the modal dialog
34  int exec();
35 
36 private:
37  void saveClicked();
38  void openClicked();
39  void openWithClicked();
40  QString text, dontAskName;
41  QDialog *const dialog;
42  QDialogButtonBox *mButtonBox = nullptr;
43 };
44 }
45 
Q_OBJECTQ_OBJECT
A class which handles the dialog used to present the user a choice what to do with an attachment...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Dec 4 2021 23:12:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.