]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.h
2ac0c02acd9e3062fd1cdf836f02cfe3d59a14fc
[lyx.git] / src / frontends / Dialogs.h
1 // -*- C++ -*-
2 /* Dialogs.h
3  * Container of all dialogs and signals a LyXView needs or uses to access them.
4  * Author: Allan Rae <rae@lyx.org>
5  * This file is part of
6  * ======================================================
7  *
8  *           LyX, The Document Processor
9  *
10  *           Copyright 1995 Matthias Ettrich
11  *           Copyright 1995-2000 The LyX Team.
12  *
13  *           This file Copyright 2000
14  *           Allan Rae
15  * ======================================================
16  */
17
18 #ifndef DIALOGS_H
19 #define DIALOGS_H
20
21 #include <vector>
22 #include <sigc++/signal_system.h>
23
24 #include "LString.h"
25 #include <boost/utility.hpp>
26
27 class DialogBase;
28
29 // Maybe this should be a UIFunc modelled on LyXFunc
30 class LyXView;
31
32 class FormSplash;
33
34 class InsetGraphics;
35 class InsetBibKey;
36 class InsetBibtex;
37 class InsetError;
38 class InsetExternal;
39 class InsetInclude;
40 class InsetInfo;
41 class InsetTabular;
42 class InsetCommand;
43
44 #ifdef SIGC_CXX_NAMESPACES
45 using SigC::Signal0;
46 using SigC::Signal1;
47 #endif
48
49 /** Container of all dialogs and signals a LyXView needs or uses to access them
50     The list of dialog signals isn't comprehensive but should be a good guide
51     for any future additions.  Remember don't go overboard -- think minimal.
52  */
53 class Dialogs : public noncopyable
54 {
55 public:
56         /**@name Constructors and Deconstructors */
57         //@{
58         ///
59         Dialogs(LyXView *);
60         ///
61         ~Dialogs();
62         //@}
63         
64         /** Redraw all visible popups because, for example, the GUI colours
65             have been re-mapped. */
66         static Signal0<void> redrawGUI;
67
68         /**@name Global Hide and Update Signals */
69         //@{
70         /// Hide all visible popups
71         Signal0<void> hideAll;
72         
73         /// Hide any dialogs that require a buffer for them to operate
74         Signal0<void> hideBufferDependent;
75         
76         /** Update visible, buffer-dependent dialogs
77             If the bool is true then a buffer change has occurred
78             else its still the same buffer.
79          */
80         Signal1<void, bool> updateBufferDependent;
81         //@}
82
83         /**@name Dialog Access Signals.
84            Put into some sort of alphabetical order */
85         //@{
86         /// Do we really have to push this?
87         Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
88         /// show the key and label of a bibliography entry
89         Signal1<void, InsetCommand *> showBibitem;
90         /// show the bibtex dialog
91         Signal1<void, InsetCommand *> showBibtex;
92         ///
93         Signal0<void> showCharacter;
94         ///
95         Signal1<void, InsetCommand *> showCitation;
96         ///
97         Signal1<void, string const &> createCitation;
98         ///
99         Signal0<void> showCopyright;
100         ///
101         Signal0<void> showCredits;
102         ///
103         Signal1<void, InsetError *> showError;
104         /// show the external inset dialog
105         Signal1<void, InsetExternal *> showExternal; 
106         ///
107         Signal1<void, InsetGraphics *> showGraphics;
108         /// show the details of a LyX file include inset
109         Signal1<void, InsetCommand *> showInclude;
110         /// create a LyX file include inset
111         Signal1<void, string const &> createInclude;
112         ///
113         Signal1<void, InsetCommand *> showIndex;
114         ///
115         Signal1<void, string const &> createIndex;
116         ///
117         Signal1<void, InsetInfo *> showInfo;
118         ///
119         Signal0<void> showLayoutDocument;
120         ///
121         Signal0<void> showLayoutParagraph;
122         ///
123         Signal0<void> showLayoutCharacter;
124         ///
125         Signal0<void> setUserFreeFont;
126         /// show the version control log
127         Signal0<void> showVCLogFile;
128         /// show the LaTeX log or build file
129         Signal0<void> showLogFile;
130         ///
131         Signal0<void> showPreamble;
132         ///
133         Signal0<void> showPreferences;
134         ///
135         Signal0<void> showPrint;
136         ///
137         Signal1<void, InsetCommand *> showRef;
138         ///
139         Signal1<void, string const &> createRef;
140         ///
141         Signal0<void> showSearch;
142         /// pop up the splash
143         Signal0<void> showSplash;
144         /// destroy the splash dialog
145         void destroySplash();
146         ///
147         Signal1<void, InsetTabular *> showTabular;
148         ///
149         Signal1<void, InsetTabular *> updateTabular;
150         ///
151         Signal0<void> showTabularCreate;
152         ///
153         Signal1<void, InsetCommand *> showTOC;
154         ///
155         Signal1<void, string const &> createTOC;
156         ///
157         Signal1<void, InsetCommand *> showUrl;
158         ///
159         Signal1<void, string const &> createUrl;
160         ///
161         Signal0<void> updateCharacter;  // allow update as cursor moves
162         //@}
163 private:
164         /// the dialogs being managed
165         std::vector<DialogBase *> dialogs_;
166         /// the splash dialog
167         FormSplash * splash_;
168 };
169
170 #endif