]> git.lyx.org Git - lyx.git/blob - src/frontends/alert.h
Amend 6c3447c8: FindAdv: sometimes a space is added on some math symbols
[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 typedef unsigned short buttonid;
23
24 /**
25  * Prompt for a question. Returns 0-3 for the chosen button.
26  * Set default_button and cancel_button to reasonable values. b1-b3
27  * should have accelerators marked with an '&'. title should be
28  * a short summary. Strings should be gettextised.
29  * Please think about the poor user.
30  *
31  * Remember to use boost::format. If you make any of these buttons
32  * "Yes" or "No", I will personally come around to your house and
33  * slap you with fish, and not in an enjoyable way either.
34  */
35 buttonid prompt(docstring const & title, docstring const & question,
36            buttonid default_button, buttonid cancel_button,
37            docstring const & b0, docstring const & b1,
38            docstring const & b2 = empty_docstring(),
39            docstring const & b3 = empty_docstring());
40
41 /**
42  * Display a warning to the user. Title should be a short (general) summary.
43  * Only use this if the user cannot perform some remedial action.
44  * \p askshowagain will display a check box where the user can turn off the
45  * warning for future cases. Ponder carefully if this is feasible.
46  *
47  * The console output takes care of converting any Qt html to plain text.
48  */
49 void warning(docstring const & title, docstring const & message,
50              bool askshowagain = false);
51
52 /**
53  * Display a warning to the user. Title should be a short (general) summary.
54  * Only use this if the user cannot perform some remedial action.
55  * On some systems it is possible to show a backtrace.
56  *
57  * The console output takes care of converting any Qt html to plain text.
58  */
59 void error(docstring const & title, docstring const & message, bool backtrace = false);
60
61 /**
62  * Informational message. Use very very sparingly. That is, you must
63  * apply to me, in triplicate, under the sea, breathing in petrol
64  * and reciting the Nicene Creed, whilst running uphill and also
65  * eating.
66  */
67 void information(docstring const & title, docstring const & message);
68
69 /**
70  * Asks for a text. Returns true for OK. Obtained message is in response
71  * (even empty string). dflt stands for default message in the dialog.
72  */
73 bool askForText(docstring & response, docstring const & msg,
74         docstring const & dflt = empty_docstring());
75
76 } // namespace Alert
77 } // namespace frontend
78 } // namespace lyx
79
80 #endif // LYX_ALERT_H