]> git.lyx.org Git - lyx.git/blob - src/lyx_gui_misc.h
Fix working of the spellchecker dialog with ispell when there are no
[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-2001 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 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include FORMS_H_LOCATION
22 #include "LString.h"
23 #include <utility>  /* needed for pair<> definition */
24
25 /// Prevents LyX from being killed when the close box is pressed in a popup.
26 extern "C"
27 int CancelCloseBoxCB(FL_FORM *, void *);
28
29 /** Redraw the form (on receipt of a Signal indicating, for example,
30     that the xform colors have been re-mapped). */
31 void RedrawAllBufferRelatedDialogs();
32
33 /// Prevents LyX from crashing when no buffers available
34 void CloseAllBufferRelatedDialogs();
35
36 /// Ensures info in visible popups are always correct.
37 void updateAllVisibleBufferRelatedDialogs(bool switched = false);
38
39 /* These shortcut extractors should be shifted to frontends/xforms/ eventually */
40
41 /// Extract shortcut from <ident>|<shortcut> string
42 char const * flyx_shortcut_extract(char const * sc);
43 /// Shortcut for flyx_shortcut_extract
44 #define scex flyx_shortcut_extract
45
46 /// Extract shortcut from <ident>|<shortcut> string
47 char const * flyx_ident_extract(char const * sc);
48 /// Shortcut for flyx_ident_extract
49 #define idex flyx_ident_extract
50
51 /// Show message
52 void WriteAlert(string const & s1, string const & s2 = string(), 
53                 string const & s3 = string());
54
55 /// Alarms user of something related to files
56 void WriteFSAlert(string const & s1, string const & s2 = string());
57
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);
61
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);
65
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());
70
71 /// Informs the user that changes in the coming form will be ignored
72 void WarnReadonly(string const & file);
73
74 /// Get the dpi setting of the current screen
75 float getScreenDPI();
76
77 #endif