]> git.lyx.org Git - lyx.git/blob - src/frontends/alert.h
Re-enable QWindowsMimeMetafile with Qt6
[lyx.git] / src / frontends / alert.h
1 // -*- C++ -*-
2 /**
3  * \file alert.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LYX_ALERT_H
13 #define LYX_ALERT_H
14
15 #include "support/strfwd.h"
16
17
18 namespace lyx {
19 namespace frontend {
20 namespace Alert {
21
22 /**
23  * Prompt for a question. Returns 0-3 for the chosen button.
24  * Set default_button and cancel_button to reasonable values. b1-b3
25  * should have accelerators marked with an '&'. title should be
26  * a short summary. Strings should be gettextised.
27  * Please think about the poor user.
28  *
29  * Remember to use boost::format. If you make any of these buttons
30  * "Yes" or "No", I will personally come around to your house and
31  * slap you with fish, and not in an enjoyable way either.
32  */
33 int prompt(docstring const & title, docstring const & question,
34            int default_button, int cancel_button,
35            docstring const & b0, docstring const & b1,
36            docstring const & b2 = empty_docstring(),
37            docstring const & b3 = empty_docstring());
38
39 /**
40  * Display a warning to the user. Title should be a short (general) summary.
41  * Only use this if the user cannot perform some remedial action.
42  * \p askshowagain will display a check box where the user can turn off the
43  * warning for future cases. Ponder carefully if this is feasible.
44  *
45  * The console output takes care of converting any Qt html to plain text.
46  */
47 void warning(docstring const & title, docstring const & message,
48              bool askshowagain = false);
49
50 /**
51  * Display a warning to the user. Title should be a short (general) summary.
52  * Only use this if the user cannot perform some remedial action.
53  * On some systems it is possible to show a backtrace.
54  *
55  * The console output takes care of converting any Qt html to plain text.
56  */
57 void error(docstring const & title, docstring const & message, bool backtrace = false);
58
59 /**
60  * Informational message. Use very very sparingly. That is, you must
61  * apply to me, in triplicate, under the sea, breathing in petrol
62  * and reciting the Nicene Creed, whilst running uphill and also
63  * eating.
64  */
65 void information(docstring const & title, docstring const & message);
66
67 /**
68  * Asks for a text. Returns true for OK. Obtained message is in response
69  * (even empty string). dflt stands for default message in the dialog.
70  */
71 bool askForText(docstring & response, docstring const & msg,
72         docstring const & dflt = empty_docstring());
73
74 } // namespace Alert
75 } // namespace frontend
76 } // namespace lyx
77
78 #endif // LYX_ALERT_H