2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 1996 Matthias Ettrich
8 * Copyright 1995-1999 The LyX Team
10 * ====================================================== */
12 // Misc. GUI specific routines
14 #ifndef LYX_GUI_MISC_H
15 #define LYX_GUI_MISC_H
17 #include FORMS_H_LOCATION
19 #include <utility> /* needed for pair<> definition */
22 /// Prevents LyX from being killed when the close box is pressed in a popup.
23 extern "C" int CancelCloseBoxCB(FL_FORM *, void *);
24 /// Prevents LyX from being killed when the close box is pressed in a popup.
25 extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *);
27 /// Prevents LyX from crashing when no buffers available
28 void CloseAllBufferRelatedPopups();
30 /// Ensures info in visible popups are always correct.
31 void updateAllVisibleBufferRelatedPopups();
33 /// Extract shortcut from <ident>|<shortcut> string
34 char const * flyx_shortcut_extract(char const * sc);
35 /// Make a shortnamed version of the above func
36 #define scex flyx_shortcut_extract
38 /// Extract shortcut from <ident>|<shortcut> string
39 char const * flyx_ident_extract(char const * sc);
40 /// Make a shortnamed versjon of the above func
41 #define idex flyx_ident_extract
44 void WriteAlert(string const & s1, string const & s2 = string(),
45 string const & s3 = string());
47 /// Alarms user of something related to files
48 void WriteFSAlert(string const & s1, string const & s2 = string());
50 /// Asks "Yes" or "No". Returns true for yes, false for no
51 bool AskQuestion(string const & s1, string const & s2 = string(),
52 string const & s3 = string());
54 /// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
55 int AskConfirmation(string const & s1, string const & s2 = string(),
56 string const & s3 = string());
58 /// returns a bool: false=cancelled, true=okay. string contains returned text
59 pair<bool, string> askForText(string const & msg,
60 string const & dflt = string());
62 /// Informs the user that changes in the coming form will be ignored
63 void WarnReadonly(string const & file);
66 /// rings the audio bell.
69 // if (audio()) ON/OFF switch yet to be implemented