2002-02-16 15:59:55 +00:00
|
|
|
// -*- C++ -*-
|
2001-11-26 10:19:58 +00:00
|
|
|
/**
|
|
|
|
* \file Alert.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-11-26 10:19:58 +00:00
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author John Levon
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-11-26 10:19:58 +00:00
|
|
|
*/
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
#ifndef LYX_ALERT_H
|
|
|
|
#define LYX_ALERT_H
|
|
|
|
|
2001-11-26 10:19:58 +00:00
|
|
|
#include "support/lstrings.h"
|
2002-02-16 15:59:55 +00:00
|
|
|
|
2001-11-26 10:19:58 +00:00
|
|
|
#include <algorithm>
|
2002-02-16 15:59:55 +00:00
|
|
|
|
2001-11-26 10:19:58 +00:00
|
|
|
namespace Alert {
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
/// show an alert message
|
2002-05-31 01:13:36 +00:00
|
|
|
void alert(string const & title, string const & s1 = string(),
|
|
|
|
string const & s2 = string());
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
/// show an alert message and strerror(errno)
|
|
|
|
void err_alert(string const & s1, string const & s2 = string());
|
2001-11-26 10:19:58 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/// ask a question
|
2002-02-16 15:59:55 +00:00
|
|
|
bool askQuestion(string const & s1, string const & s2 = string(),
|
2001-11-26 10:19:58 +00:00
|
|
|
string const & s3 = string(), bool default_value = true);
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
/// Returns 1 for yes, 2 for no, 3 for cancel.
|
2002-03-21 21:21:28 +00:00
|
|
|
int askConfirmation(string const & s1, string const & s2 = string(),
|
2002-02-16 15:59:55 +00:00
|
|
|
string const & s3 = string(), int default_value = 1);
|
|
|
|
|
|
|
|
/// Asks for a text
|
|
|
|
std::pair<bool, string> const
|
2002-03-21 21:21:28 +00:00
|
|
|
askForText(string const & msg,
|
2002-02-16 15:59:55 +00:00
|
|
|
string const & dflt = string());
|
|
|
|
|
2001-12-10 15:59:20 +00:00
|
|
|
}
|
2002-02-16 15:59:55 +00:00
|
|
|
|
2002-06-12 02:54:19 +00:00
|
|
|
#endif // LYX_ALERT_H
|