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 {
28  Save = 2,
29  Open,
30  OpenWith,
31  Cancel,
32  };
33 
34  // if @offer is non-null, the "open with <application>" button will also be shown,
35  // otherwise only save, open with, cancel
36  explicit AttachmentDialog(QWidget *parent, const QString &filenameText, const KService::Ptr &offer, const QString &dontAskAgainName);
37 
38  // executes the modal dialog
39  int exec();
40 
41 private:
42  void saveClicked();
43  void openClicked();
44  void openWithClicked();
45  QString text, dontAskName;
46  QDialog *const dialog;
47  QDialogButtonBox *mButtonBox = nullptr;
48 };
49 }
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-2023 The KDE developers.
Generated on Fri Mar 24 2023 04:08:30 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.