]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.h
one small private fix in mathed, put noncopyable and tie into boost namespace
[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 #include <boost/smart_ptr.hpp>
27
28 #ifdef __GNUG__
29 #pragma interface
30 #endif
31
32 #include "DialogBase.h"
33 #include "support/LAssert.h"
34
35 // Maybe this should be a UIFunc modelled on LyXFunc
36 class LyXView;
37
38 class InsetGraphics;
39 class InsetBibKey;
40 class InsetBibtex;
41 class InsetError;
42 class InsetExternal;
43 class InsetInclude;
44 class InsetInfo;
45 class InsetTabular;
46 class InsetCommand;
47
48 /** Container of all dialogs and signals a LyXView needs or uses to access them
49     The list of dialog signals isn't comprehensive but should be a good guide
50     for any future additions.  Remember don't go overboard -- think minimal.
51  */
52 class Dialogs : public boost::noncopyable
53 {
54 public:
55         ///
56         typedef boost::shared_ptr<DialogBase> db_ptr;
57         /**@name Constructor */
58         //@{
59         ///
60         Dialogs(LyXView *);
61         //@}
62
63         /** Redraw all visible popups because, for example, the GUI colours
64             have been re-mapped. */
65         static SigC::Signal0<void> redrawGUI;
66
67         /**@name Global Hide and Update Signals */
68         //@{
69         /// Hide all visible popups
70         SigC::Signal0<void> hideAll;
71         
72         /// Hide any dialogs that require a buffer for them to operate
73         SigC::Signal0<void> hideBufferDependent;
74         
75         /** Update visible, buffer-dependent dialogs
76             If the bool is true then a buffer change has occurred
77             else its still the same buffer.
78          */
79         SigC::Signal1<void, bool> updateBufferDependent;
80         //@}
81
82         /**@name Dialog Access Signals.
83            Put into some sort of alphabetical order */
84         //@{
85         /// Do we really have to push this?
86         SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
87         /// show the key and label of a bibliography entry
88         SigC::Signal1<void, InsetCommand *> showBibitem;
89         /// show the bibtex dialog
90         SigC::Signal1<void, InsetCommand *> showBibtex;
91         ///
92         SigC::Signal0<void> showCharacter;
93         ///
94         SigC::Signal1<void, InsetCommand *> showCitation;
95         ///
96         SigC::Signal1<void, string const &> createCitation;
97         ///
98         SigC::Signal0<void> showCopyright;
99         ///
100         SigC::Signal0<void> showCredits;
101         ///
102         SigC::Signal1<void, InsetError *> showError;
103         /// show the external inset dialog
104         SigC::Signal1<void, InsetExternal *> showExternal; 
105         ///
106         SigC::Signal1<void, InsetGraphics *> showGraphics;
107         /// show the details of a LyX file include inset
108         SigC::Signal1<void, InsetInclude *> showInclude;
109         ///
110         SigC::Signal1<void, InsetCommand *> showIndex;
111         ///
112         SigC::Signal1<void, string const &> createIndex;
113         ///
114         SigC::Signal1<void, InsetInfo *> showInfo;
115         ///
116         SigC::Signal0<void> showLayoutDocument;
117         ///
118         SigC::Signal0<void> showLayoutParagraph;
119         ///
120         SigC::Signal0<void> showLayoutCharacter;
121         ///
122         SigC::Signal0<void> setUserFreeFont;
123         /// show the version control log
124         SigC::Signal0<void> showVCLogFile;
125         /// show the LaTeX log or build file
126         SigC::Signal0<void> showLogFile;
127         ///
128         SigC::Signal0<void> showPreamble;
129         ///
130         SigC::Signal0<void> showPreferences;
131         ///
132         SigC::Signal0<void> showPrint;
133         ///
134         SigC::Signal1<void, InsetCommand *> showRef;
135         ///
136         SigC::Signal1<void, string const &> createRef;
137         ///
138         SigC::Signal0<void> showSearch;
139         /// pop up the splash
140         SigC::Signal0<void> showSplash;
141         /// destroy the splash dialog
142         void destroySplash();
143         ///
144         SigC::Signal1<void, InsetTabular *> showTabular;
145         ///
146         SigC::Signal1<void, InsetTabular *> updateTabular;
147         ///
148         SigC::Signal0<void> showTabularCreate;
149         ///
150         SigC::Signal1<void, InsetCommand *> showTOC;
151         ///
152         SigC::Signal1<void, string const &> createTOC;
153         ///
154         SigC::Signal1<void, InsetCommand *> showUrl;
155         ///
156         SigC::Signal1<void, string const &> createUrl;
157         ///
158         SigC::Signal0<void> updateCharacter;  // allow update as cursor moves
159         //@}
160 private:
161         /// Add a dialog to the vector of dialogs.
162         void add(DialogBase *);
163         /// the dialogs being managed
164         std::vector<db_ptr> dialogs_;
165         /// the splash dialog
166         boost::scoped_ptr<DialogBase> splash_;
167 };
168
169 inline void Dialogs::add(DialogBase * ptr)
170 {
171         Assert(ptr);
172         dialogs_.push_back(db_ptr(ptr));
173 }
174
175 inline void Dialogs::destroySplash()
176 {
177         splash_.reset();
178 }
179
180 #endif