]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.h
use more specific smart_ptr headers
[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-2001 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 "LString.h"
22
23 #include <boost/utility.hpp>
24 #include <boost/shared_ptr.hpp>
25
26 #include <sigc++/signal_system.h>
27
28 #include <vector>
29
30 #ifdef __GNUG__
31 #pragma interface
32 #endif
33
34 #include "DialogBase.h"
35
36 // Maybe this should be a UIFunc modelled on LyXFunc
37 class LyXView;
38
39 class InsetGraphics;
40 class InsetBibKey;
41 class InsetBibtex;
42 class InsetError;
43 class InsetExternal;
44 class InsetInclude;
45 class InsetInfo;
46 class InsetTabular;
47 class InsetCommand;
48 class InsetMinipage;
49 class InsetFloat;
50 class InsetERT;
51 class Paragraph;
52
53 /** Container of all dialogs and signals a LyXView needs or uses to access them
54     The list of dialog signals isn't comprehensive but should be a good guide
55     for any future additions.  Remember don't go overboard -- think minimal.
56  */
57 class Dialogs : boost::noncopyable
58 {
59 public:
60         ///
61         typedef boost::shared_ptr<DialogBase> db_ptr;
62         /**@name Constructor */
63         //@{
64         ///
65         Dialogs(LyXView *);
66         //@}
67
68         /** Redraw all visible dialogs because, for example, the GUI colours
69             have been re-mapped. */
70         static SigC::Signal0<void> redrawGUI;
71
72         /// Toggle tooltips on/off in all dialogs.
73         static SigC::Signal0<void> toggleTooltips;
74
75         /// Are the tooltips on or off?
76         static bool tooltipsEnabled();
77
78         /**@name Global Hide and Update Signals */
79         //@{
80         /// Hide all visible dialogs
81         SigC::Signal0<void> hideAll;
82
83         /// Hide any dialogs that require a buffer for them to operate
84         SigC::Signal0<void> hideBufferDependent;
85
86         /** Update visible, buffer-dependent dialogs
87             If the bool is true then a buffer change has occurred
88             else its still the same buffer.
89          */
90         SigC::Signal1<void, bool> updateBufferDependent;
91         //@}
92
93         /**@name Dialog Access Signals.
94            Put into some sort of alphabetical order */
95         //@{
96         /// Do we really have to push this?
97         SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
98         ///
99         SigC::Signal0<void> showAboutlyx;
100         /// show the key and label of a bibliography entry
101         SigC::Signal1<void, InsetCommand *> showBibitem;
102         /// show the bibtex dialog
103         SigC::Signal1<void, InsetCommand *> showBibtex;
104         ///
105         SigC::Signal0<void> showCharacter;
106         /// connected to the character dialog also
107         SigC::Signal0<void> setUserFreeFont;
108         ///
109         SigC::Signal1<void, InsetCommand *> showCitation;
110         ///
111         SigC::Signal1<void, string const &> createCitation;
112         ///
113         SigC::Signal0<void> showDocument;
114         ///
115         SigC::Signal1<void, InsetError *> showError;
116         /// show the external inset dialog
117         SigC::Signal1<void, InsetExternal *> showExternal;
118         /// show the contents of a file.
119         SigC::Signal1<void, string const &> showFile;
120         /// show all forked child processes
121         SigC::Signal0<void> showForks;
122         ///
123         SigC::Signal1<void, InsetGraphics *> showGraphics;
124         /// show the details of a LyX file include inset
125         SigC::Signal1<void, InsetInclude *> showInclude;
126         ///
127         SigC::Signal1<void, InsetCommand *> showIndex;
128         ///
129         SigC::Signal1<void, string const &> createIndex;
130         ///
131         SigC::Signal1<void, InsetInfo *> showInfo;
132         /// show the LaTeX log or build file
133         SigC::Signal0<void> showLogFile;
134         /// display the top-level maths panel
135         SigC::Signal0<void> showMathPanel;
136         ///
137         SigC::Signal1<void, InsetMinipage *> showMinipage;
138         ///
139         SigC::Signal1<void, InsetMinipage *> updateMinipage;
140         ///
141         SigC::Signal1<void, InsetERT *> showERT;
142         ///
143         SigC::Signal1<void, InsetERT *> updateERT;
144         ///
145         SigC::Signal1<void, InsetFloat *> showFloat;
146         ///
147         SigC::Signal0<void> showParagraph;
148         ///
149         SigC::Signal0<void> updateParagraph;
150         ///
151         SigC::Signal0<void> showPreamble;
152         ///
153         SigC::Signal0<void> showPreferences;
154         ///
155         SigC::Signal0<void> showPrint;
156         ///
157         SigC::Signal1<void, InsetCommand *> showRef;
158         ///
159         SigC::Signal1<void, string const &> createRef;
160         ///
161         SigC::Signal0<void> showSearch;
162         ///
163         SigC::Signal0<void> showSendto;
164         /// bring up the spellchecker
165         SigC::Signal0<void> showSpellchecker;
166         /// bring up the spellchecker tab in preferences
167         SigC::Signal0<void> showSpellcheckerPreferences;
168         ///
169         SigC::Signal1<void, InsetTabular *> showTabular;
170         ///
171         SigC::Signal1<void, InsetTabular *> updateTabular;
172         ///
173         SigC::Signal0<void> showTabularCreate;
174         /// show the TexInfo
175         SigC::Signal0<void> showTexinfo;
176         /// show the thesaurus dialog
177         SigC::Signal1<void, string const &> showThesaurus;
178         ///
179         SigC::Signal1<void, InsetCommand *> showTOC;
180         ///
181         SigC::Signal1<void, string const &> createTOC;
182         ///
183         SigC::Signal1<void, InsetCommand *> showUrl;
184         ///
185         SigC::Signal1<void, string const &> createUrl;
186         /// show the version control log
187         SigC::Signal0<void> showVCLogFile;
188         //@}
189 private:
190         /// Add a dialog to the vector of dialogs.
191         void add(DialogBase *);
192         /// the dialogs being managed
193         std::vector<db_ptr> dialogs_;
194 };
195
196 #endif