]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.h
implement getLabelList
[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 class InsetMinipage;
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 boost::noncopyable
54 {
55 public:
56         ///
57         typedef boost::shared_ptr<DialogBase> db_ptr;
58         /**@name Constructor */
59         //@{
60         ///
61         Dialogs(LyXView *);
62         //@}
63
64         /** Redraw all visible dialogs because, for example, the GUI colours
65             have been re-mapped. */
66         static SigC::Signal0<void> redrawGUI;
67
68         /**@name Global Hide and Update Signals */
69         //@{
70         /// Hide all visible dialogs
71         SigC::Signal0<void> hideAll;
72         
73         /// Hide any dialogs that require a buffer for them to operate
74         SigC::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         SigC::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         SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
88         /// show the key and label of a bibliography entry
89         SigC::Signal1<void, InsetCommand *> showBibitem;
90         /// show the bibtex dialog
91         SigC::Signal1<void, InsetCommand *> showBibtex;
92         ///
93         SigC::Signal0<void> showCharacter;
94         ///
95         SigC::Signal1<void, InsetCommand *> showCitation;
96         ///
97         SigC::Signal1<void, string const &> createCitation;
98         ///
99         SigC::Signal0<void> showCopyright;
100         ///
101         SigC::Signal0<void> showCredits;
102         ///
103         SigC::Signal1<void, InsetError *> showError;
104         /// show the external inset dialog
105         SigC::Signal1<void, InsetExternal *> showExternal; 
106         ///
107         SigC::Signal1<void, InsetGraphics *> showGraphics;
108         /// show the details of a LyX file include inset
109         SigC::Signal1<void, InsetInclude *> showInclude;
110         ///
111         SigC::Signal1<void, InsetCommand *> showIndex;
112         ///
113         SigC::Signal1<void, string const &> createIndex;
114         ///
115         SigC::Signal1<void, InsetInfo *> showInfo;
116         ///
117         SigC::Signal0<void> showLayoutDocument;
118         ///
119         SigC::Signal0<void> showLayoutParagraph;
120         ///
121         SigC::Signal0<void> showLayoutCharacter;
122         ///
123         SigC::Signal0<void> setUserFreeFont;
124         /// show the version control log
125         SigC::Signal0<void> showVCLogFile;
126         /// show the LaTeX log or build file
127         SigC::Signal0<void> showLogFile;
128         /// display the top-level maths panel
129         SigC::Signal0<void> showMathPanel;
130         ///
131         SigC::Signal0<void> showPreamble;
132         ///
133         SigC::Signal0<void> showPreferences;
134         ///
135         SigC::Signal0<void> showPrint;
136         ///
137         SigC::Signal1<void, InsetCommand *> showRef;
138         ///
139         SigC::Signal1<void, string const &> createRef;
140         ///
141         SigC::Signal0<void> showSearch;
142         /// pop up the splash
143         SigC::Signal0<void> showSplash;
144         /// destroy the splash dialog
145         void destroySplash();
146         ///
147         SigC::Signal1<void, InsetTabular *> showTabular;
148         ///
149         SigC::Signal1<void, InsetTabular *> updateTabular;
150         ///
151         SigC::Signal0<void> showTabularCreate;
152         ///
153         SigC::Signal1<void, InsetMinipage *> showMinipage;
154         ///
155         SigC::Signal1<void, InsetMinipage *> updateMinipage;
156         ///
157         SigC::Signal1<void, InsetCommand *> showTOC;
158         ///
159         SigC::Signal1<void, string const &> createTOC;
160         ///
161         SigC::Signal1<void, InsetCommand *> showUrl;
162         ///
163         SigC::Signal1<void, string const &> createUrl;
164         ///
165         SigC::Signal0<void> updateCharacter;  // allow update as cursor moves
166         //@}
167 private:
168         /// Add a dialog to the vector of dialogs.
169         void add(DialogBase *);
170         /// the dialogs being managed
171         std::vector<db_ptr> dialogs_;
172         /// the splash dialog
173         boost::scoped_ptr<DialogBase> splash_;
174 };
175
176 inline void Dialogs::add(DialogBase * ptr)
177 {
178         Assert(ptr);
179         dialogs_.push_back(db_ptr(ptr));
180 }
181
182 inline void Dialogs::destroySplash()
183 {
184         splash_.reset();
185 }
186
187 #endif