]> git.lyx.org Git - lyx.git/blob - src/lyx_gui_misc.h
fix the smallcaps drawing, move xfont metrics functions out from LyXFont, move non...
[lyx.git] / src / lyx_gui_misc.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 1996 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team
9  *
10  * ====================================================== */
11
12 // Misc. GUI specific routines
13
14 #ifndef LYX_GUI_MISC_H
15 #define LYX_GUI_MISC_H
16
17 #include FORMS_H_LOCATION
18 #include "LString.h"
19 #include <utility>  /* needed for pair<> definition */
20
21 /// Prevents LyX from being killed when the close box is pressed in a popup.
22 extern "C" int CancelCloseBoxCB(FL_FORM *, void *);
23 /// Prevents LyX from being killed when the close box is pressed in a popup.
24 extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *);
25
26 /// Prevents LyX from crashing when no buffers available
27 void CloseAllBufferRelatedPopups();
28
29 /// Ensures info in visible popups are always correct.
30 void updateAllVisibleBufferRelatedPopups();
31
32 /// Extract shortcut from <ident>|<shortcut> string
33 char const * flyx_shortcut_extract(char const * sc);
34 /// Make a shortnamed version of the above func
35 #define scex flyx_shortcut_extract
36
37 /// Extract shortcut from <ident>|<shortcut> string
38 char const * flyx_ident_extract(char const * sc);
39 /// Make a shortnamed versjon of the above func
40 #define idex flyx_ident_extract
41
42 /// Show message
43 void WriteAlert(string const & s1, string const & s2 = string(), 
44                 string const & s3 = string());
45
46 /// Alarms user of something related to files
47 void WriteFSAlert(string const & s1, string const & s2 = string());
48
49 /// Asks "Yes" or "No". Returns true for yes, false for no
50 bool AskQuestion(string const & s1, string const & s2 = string(),
51                  string const & s3 = string());
52
53 /// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
54 int AskConfirmation(string const & s1, string const & s2 = string(), 
55                     string const & s3 = string());
56
57 /// returns a bool: false=cancelled, true=okay. string contains returned text
58 std::pair<bool, string> askForText(string const & msg,
59                                    string const & dflt = string());
60
61 /// Informs the user that changes in the coming form will be ignored
62 void WarnReadonly(string const & file);
63
64 // inlined functions
65 /// rings the audio bell.
66 inline
67 void LyXBell() {
68         // if (audio()) ON/OFF switch yet to be implemented
69         fl_ringbell(20);
70 }
71
72 #endif