]> git.lyx.org Git - lyx.git/blob - src/frontends/Alert.h
namespace grfx -> lyx::graphics
[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/lstrings.h"
16
17 #include <algorithm>
18
19 namespace Alert {
20
21 /**
22  * Prompt for a question. Returns 0-2 for the chosen button.
23  * Set default_button and cancel_button to reasonable values. b1-b3
24  * should have accelerators marked with an '&'. title should be
25  * a short summary. Strings should be gettextised.
26  * Please think about the poor user.
27  *
28  * Remember to use boost::format. If you make any of these buttons
29  * "Yes" or "No", I will personally come around to your house and
30  * slap you with fish, and not in an enjoyable way either.
31  */
32 int prompt(string const & title, string const & question,
33            int default_button, int cancel_button,
34            string const & b1, string const & b2, string const & b3 = string());
35
36 /**
37  * Display a warning to the user. Title should be a short (general) summary.
38  * Only use this if the user cannot perform some remedial action.
39  */
40 void warning(string const & title, string const & message);
41
42 /**
43  * Display a warning to the user. Title should be a short (general) summary.
44  * Only use this if the user cannot perform some remedial action.
45  */
46 void error(string const & title, string const & message);
47
48 /**
49  * Informational message. Use very very sparingly. That is, you must
50  * apply to me, in triplicate, under the sea, breathing in petrol
51  * and reciting the Nicene Creed, whilst running uphill and also
52  * eating.
53  */
54 void information(string const & title, string const & message);
55
56 /// Asks for a text. DO NOT USE !!
57 std::pair<bool, string> const
58 askForText(string const & msg,
59            string const & dflt = string());
60
61 }
62
63 #endif // LYX_ALERT_H