]> git.lyx.org Git - lyx.git/blob - src/frontends/Alert.h
Big shake up of all Alert::askQuestion/Confirmation into something
[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 to a reasonable value. b1-b3 should have
24  * accelerators marked with an '&'. title should be a short summary.
25  * Strings should be gettextised. Please think about the poor user.
26  *
27  * Remember to use boost::format. If you make any of these buttons
28  * "Yes" or "No", I will personally come around to your house and
29  * slap you with fish, and not in an enjoyable way either.
30  */
31 int prompt(string const & title, string const & question,
32            int default_button,
33            string const & b1, string const & b2, string const & b3 = string());
34
35 /// show an alert message
36 void alert(string const & title, string const & s1 = string(),
37            string const & s2 = string());
38
39 /// show an alert message and strerror(errno)
40 void err_alert(string const & s1, string const & s2 = string());
41
42 /// Asks for a text
43 std::pair<bool, string> const
44 askForText(string const & msg,
45            string const & dflt = string());
46
47 }
48
49 #endif // LYX_ALERT_H