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
|
|
|
*
|
2003-08-23 00:17:00 +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
|
|
|
namespace Alert {
|
|
|
|
|
2003-03-29 07:09:13 +00:00
|
|
|
/**
|
|
|
|
* Prompt for a question. Returns 0-2 for the chosen button.
|
2003-04-27 16:40:50 +00:00
|
|
|
* Set default_button and cancel_button to reasonable values. b1-b3
|
|
|
|
* should have accelerators marked with an '&'. title should be
|
|
|
|
* a short summary. Strings should be gettextised.
|
|
|
|
* Please think about the poor user.
|
2003-03-29 07:09:13 +00:00
|
|
|
*
|
|
|
|
* Remember to use boost::format. If you make any of these buttons
|
|
|
|
* "Yes" or "No", I will personally come around to your house and
|
|
|
|
* slap you with fish, and not in an enjoyable way either.
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
int prompt(std::string const & title, std::string const & question,
|
2003-04-27 16:40:50 +00:00
|
|
|
int default_button, int cancel_button,
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & b1, std::string const & b2, std::string const & b3 = std::string());
|
2003-03-29 07:09:13 +00:00
|
|
|
|
2003-03-29 09:02:08 +00:00
|
|
|
/**
|
2003-03-31 01:15:44 +00:00
|
|
|
* Display a warning to the user. Title should be a short (general) summary.
|
2003-03-29 09:02:08 +00:00
|
|
|
* Only use this if the user cannot perform some remedial action.
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
void warning(std::string const & title, std::string const & message);
|
2003-03-29 09:02:08 +00:00
|
|
|
|
|
|
|
/**
|
2003-03-31 01:15:44 +00:00
|
|
|
* Display a warning to the user. Title should be a short (general) summary.
|
2003-03-29 09:02:08 +00:00
|
|
|
* Only use this if the user cannot perform some remedial action.
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
void error(std::string const & title, std::string const & message);
|
2003-03-29 09:02:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Informational message. Use very very sparingly. That is, you must
|
|
|
|
* apply to me, in triplicate, under the sea, breathing in petrol
|
|
|
|
* and reciting the Nicene Creed, whilst running uphill and also
|
|
|
|
* eating.
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
void information(std::string const & title, std::string const & message);
|
2003-03-29 09:02:08 +00:00
|
|
|
|
|
|
|
/// Asks for a text. DO NOT USE !!
|
2003-10-06 15:43:21 +00:00
|
|
|
std::pair<bool, std::string> const
|
|
|
|
askForText(std::string const & msg,
|
|
|
|
std::string const & dflt = std::string());
|
2002-02-16 15:59:55 +00:00
|
|
|
|
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
|