2002-02-16 15:59:55 +00:00
|
|
|
// -*- C++ -*-
|
2001-11-26 10:19:58 +00:00
|
|
|
/**
|
2007-04-28 20:44:46 +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
|
|
|
|
|
2007-11-13 23:21:29 +00:00
|
|
|
#include "support/docstring.h"
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
2006-10-07 16:47:54 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
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.
|
|
|
|
*/
|
2006-10-21 00:16:43 +00:00
|
|
|
int prompt(docstring const & title, docstring const & question,
|
2006-04-05 23:56:29 +00:00
|
|
|
int default_button, int cancel_button,
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring const & b1, docstring const & b2, docstring const & b3 = docstring());
|
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.
|
|
|
|
*/
|
2006-10-21 00:16:43 +00:00
|
|
|
void warning(docstring const & title, docstring 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.
|
|
|
|
*/
|
2006-10-21 00:16:43 +00:00
|
|
|
void error(docstring const & title, docstring 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.
|
|
|
|
*/
|
2006-10-21 00:16:43 +00:00
|
|
|
void information(docstring const & title, docstring const & message);
|
2003-03-29 09:02:08 +00:00
|
|
|
|
|
|
|
/// Asks for a text. DO NOT USE !!
|
2007-11-13 23:00:36 +00:00
|
|
|
bool askForText(docstring & response, docstring const & msg,
|
|
|
|
docstring const & dflt = docstring());
|
2002-02-16 15:59:55 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace Alert
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2002-02-16 15:59:55 +00:00
|
|
|
|
2002-06-12 02:54:19 +00:00
|
|
|
#endif // LYX_ALERT_H
|