This commit was manufactured by cvs2svn to create tag
[lyx.git] / src / lyx_gui_misc.h
blob2ad413d558781a800bc8ce69d91cc7cf36d90f5a
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.
10 *======================================================*/
12 // Misc. GUI specific routines
14 #ifndef _LYX_GUI_MISC_H
15 #define _LYX_GUI_MISC_H
17 #include FORMS_H_LOCATION
18 #include "LString.h"
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 *);
25 /// Prevents LyX from crashing when no buffers available
26 void CloseAllBufferRelatedPopups();
28 /// Ensures info in visible popups are always correct.
29 void updateAllVisibleBufferRelatedPopups();
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
36 /// Extract shortcut from <ident>|<shortcut> string
37 const char* flyx_ident_extract(const char *sc);
38 /// Make a shortnamed versjon of the above func
39 #define idex flyx_ident_extract
41 /// Show message
42 void WriteAlert(string const & s1, string const & s2=string(),
43 string const & s3=string());
45 /// Alarms user of something related to files
46 void WriteFSAlert(string const & s1, string const & s2=string());
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());
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());
56 /// returns a text
57 string askForText(string const & msg, string const & dflt=string());
59 /// Informs the user that changes in the coming form will be ignored
60 void WarnReadonly();
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
74 #endif