]> git.lyx.org Git - lyx.git/blob - src/lyx_gui_misc.h
white-space changes, removed definitions.h several enum changes because of this,...
[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 (C) 1995 1996 Matthias Ettrich
8 *           and 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
20 /// Prevents LyX from being killed when the close box is pressed in a popup.
21 extern "C" int CancelCloseBoxCB(FL_FORM *, void *);
22 /// Prevents LyX from being killed when the close box is pressed in a popup.
23 extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *);
24
25 /// Prevents LyX from crashing when no buffers available
26 void CloseAllBufferRelatedPopups();
27
28 /// Ensures info in visible popups are always correct.
29 void updateAllVisibleBufferRelatedPopups();
30
31 /// Extract shortcut from <ident>|<shortcut> string
32 const char* flyx_shortcut_extract(const char*sc);
33 /// Make a shortnamed version of the above func
34 #define scex flyx_shortcut_extract
35
36 /// Extract shortcut from <ident>|<shortcut> string
37 const char* flyx_ident_extract(char const *sc);
38 /// Make a shortnamed versjon of the above func
39 #define idex flyx_ident_extract
40
41 /// Show message
42 void WriteAlert(string const & s1, string const & s2 = string(), 
43                 string const & s3 = string());
44
45 /// Alarms user of something related to files
46 void WriteFSAlert(string const & s1, string const & s2 = string());
47
48 /// Asks "Yes" or "No". Returns true for yes, false for no
49 bool AskQuestion(string const & s1, string const & s2 = string(),
50                  string const & s3 = string());
51
52 /// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
53 int AskConfirmation(string const & s1, string const & s2 = string(), 
54                     string const & s3 = string());
55
56 /// returns a text
57 string askForText(string const & msg, string const & dflt = string());
58
59 /// Informs the user that changes in the coming form will be ignored
60 void WarnReadonly();
61
62 // inlined functions
63 /// rings the audio bell.
64 inline
65 void LyXBell() {
66         // if (audio()) ON/OFF switch yet to be implemented
67 #if FL_REVISION > 85
68         fl_ringbell(20);
69 #else
70         ringbell();
71 #endif
72 }
73
74 #endif