digiKam
dmessagebox.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2015-01-19
7  * Description : message box notification settings
8  *
9  * Copyright (C) 2015-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DMESSAGE_BOX_H
25 #define DIGIKAM_DMESSAGE_BOX_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QString>
31 #include <QMessageBox>
32 #include <QListWidget>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 class QDialog;
39 class QDialogButtonBox;
40 
41 namespace Digikam
42 {
43 
44 class DIGIKAM_EXPORT DMessageBox
45 {
46 
47 public:
48 
54  static bool readMsgBoxShouldBeShown(const QString& dontShowAgainName);
55 
62  static void saveMsgBoxShouldBeShown(const QString& dontShowAgainName, bool value);
63 
64 public:
65 
69  static void showInformationList(QMessageBox::Icon icon,
70  QWidget* const parent,
71  const QString& caption,
72  const QString& text,
73  const QStringList& items,
74  const QString& dontShowAgainName = QString());
75 
79  static void showInformationWidget(QMessageBox::Icon icon,
80  QWidget* const parent,
81  const QString& caption,
82  const QString& text,
83  QWidget* const listWidget,
84  const QString& dontShowAgainName);
85 
86 public:
87 
92  static int showContinueCancel(QMessageBox::Icon icon,
93  QWidget* const parent,
94  const QString& caption,
95  const QString& text,
96  const QString& dontAskAgainName = QString());
97 
103  static int showContinueCancelList(QMessageBox::Icon icon,
104  QWidget* const parent,
105  const QString& caption,
106  const QString& text,
107  const QStringList& items,
108  const QString& dontAskAgainName = QString());
109 
115  static int showContinueCancelWidget(QMessageBox::Icon icon,
116  QWidget* const parent,
117  const QString& caption,
118  const QString& text,
119  QWidget* const listWidget,
120  const QString& dontAskAgainName);
121 
122 public:
123 
128  static int showYesNo(QMessageBox::Icon icon,
129  QWidget* const parent,
130  const QString& caption,
131  const QString& text,
132  const QString& dontAskAgainName = QString());
133 
139  static int showYesNoList(QMessageBox::Icon icon,
140  QWidget* const parent,
141  const QString& caption,
142  const QString& text,
143  const QStringList& items,
144  const QString& dontAskAgainName = QString());
145 
151  static int showYesNoWidget(QMessageBox::Icon icon,
152  QWidget* const parent,
153  const QString& caption,
154  const QString& text,
155  QWidget* const listWidget,
156  const QString& dontAskAgainName = QString());
157 
158 private:
159 
160  static int createMessageBox(QDialog* const dialog,
161  QDialogButtonBox* const buttons,
162  const QIcon& icon,
163  const QString& text,
164  QWidget* const listWidget,
165  const QString& ask,
166  bool* checkboxReturn);
167 
168  static QIcon createIcon(QMessageBox::Icon icon);
169 
170  static QListWidget* createWidgetList(const QStringList& items);
171 };
172 
173 } // namespace Digikam
174 
175 #endif // DIGIKAM_DMESSAGE_BOX_H
Definition: dmessagebox.h:45
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43