2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 1996 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team
10 * ====================================================== */
12 // Misc. GUI specific routines
14 #ifndef LYX_GUI_MISC_H
15 #define LYX_GUI_MISC_H
21 #include FORMS_H_LOCATION
23 #include <utility> /* needed for pair<> definition */
27 /// Prevents LyX from being killed when the close box is pressed in a popup.
28 extern "C" int CancelCloseBoxCB(FL_FORM *, void *);
30 /// Prevents LyX from crashing when no buffers available
31 void CloseAllBufferRelatedDialogs();
33 /// Ensures info in visible popups are always correct.
34 void updateAllVisibleBufferRelatedDialogs(bool switched = false);
36 /* These shortcut extractors should be shifted to frontends/xforms/ eventually */
38 /// Extract shortcut from <ident>|<shortcut> string
39 char const * flyx_shortcut_extract(char const * sc);
40 /// Shortcut for flyx_shortcut_extract
41 #define scex flyx_shortcut_extract
43 /// Extract shortcut from <ident>|<shortcut> string
44 char const * flyx_ident_extract(char const * sc);
45 /// Shortcut for flyx_ident_extract
46 #define idex flyx_ident_extract
48 /// Show status message
49 void WriteStatus(MiniBuffer * minib, string const & s);
52 void WriteAlert(string const & s1, string const & s2 = string(),
53 string const & s3 = string());
55 /// Alarms user of something related to files
56 void WriteFSAlert(string const & s1, string const & s2 = string());
58 /// Asks "Yes" or "No". Returns true for yes, false for no
59 bool AskQuestion(string const & s1, string const & s2 = string(),
60 string const & s3 = string(), bool default_value = true);
62 /// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
63 int AskConfirmation(string const & s1, string const & s2 = string(),
64 string const & s3 = string(), int default_value = 1);
66 /// returns a bool: false=cancelled, true=okay. string contains returned text
67 std::pair<bool, string> const
68 askForText(string const & msg,
69 string const & dflt = string());
71 /// Informs the user that changes in the coming form will be ignored
72 void WarnReadonly(string const & file);
74 /// Get the dpi setting of the current screen
77 /// rings the audio bell.
80 // if (audio()) ON/OFF switch yet to be implemented