2002-02-16 15:59:55 +00:00
|
|
|
// -*- C++ -*-
|
2001-11-26 10:19:58 +00:00
|
|
|
/**
|
|
|
|
* \file Alert.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
*/
|
|
|
|
|
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-03-21 21:21:28 +00:00
|
|
|
void alert(string const & s1, string const & s2 = string(),
|
2002-02-16 15:59:55 +00:00
|
|
|
string const & s3 = string());
|
|
|
|
|
|
|
|
/// 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
|
|
|
|
|
|
|
#endif
|