]> git.lyx.org Git - lyx.git/blob - src/frontends/LyXView.h
Switch from SigC signals to boost::signals
[lyx.git] / src / frontends / LyXView.h
1 // -*- C++ -*-
2
3 #ifndef LYXVIEW_BASE_H
4 #define LYXVIEW_BASE_H
5
6 #ifdef __GNUG__
7 #pragma interface
8 #endif
9
10 #include "LString.h"
11
12 #include "support/types.h"
13
14 #include <boost/utility.hpp>
15 #include <boost/signals/trackable.hpp>
16
17 class Buffer;
18 class Toolbar;
19 class MiniBuffer;
20 class Intl;
21 class Menubar;
22
23 class BufferView;
24 class Dialogs;
25 class LyXFunc;
26 class Timeout;
27
28 ///
29 class LyXView : public boost::signals::trackable, boost::noncopyable {
30 public:
31         ///
32         LyXView();
33         ///
34         virtual ~LyXView();
35         ///
36         virtual void init() = 0;
37         ///
38         virtual void setPosition(int, int) = 0;
39         ///
40         virtual void show(int, int, string const &) = 0;
41         /// Redraw the main form.
42         virtual void redraw() = 0;
43
44         /// Resize all BufferViews in this LyXView (because the width changed)
45         void resize();
46
47         /// returns the buffer currently shown in the main form.
48         Buffer * buffer() const;
49
50         ///
51         BufferView * view() const;
52
53         /// return a pointer to the toolbar
54         Toolbar * getToolbar() const;
55
56         /// sets the layout in the toolbar layout combox
57         void setLayout(string const & layout);
58         /// update the toolbar
59         void updateToolbar();
60
61         /// return a pointer to the lyxfunc
62         LyXFunc * getLyXFunc() const;
63
64         /// return a pointer to the minibuffer
65         MiniBuffer * getMiniBuffer() const;
66
67         ///
68         void message(string const &);
69         ///
70         void messagePush(string const & str);
71         ///
72         void messagePop();
73
74         ///
75         Menubar * getMenubar() const;
76
77         ///
78         void updateMenubar();
79
80         ///
81         Intl * getIntl() const;
82
83         ///
84         Dialogs * getDialogs() { return dialogs_; }
85
86         ///
87         void updateLayoutChoice();
88
89         /// Updates the title of the window
90         void updateWindowTitle();
91
92         /// Show state (toolbar and font in minibuffer)
93         void showState();
94
95         /// Reset autosave timer
96         void resetAutosaveTimer();
97         ///
98         virtual void prohibitInput() const = 0;
99         ///
100         virtual void allowInput() const = 0;
101 protected:
102         ///
103         Menubar * menubar;
104         ///
105         Toolbar * toolbar;
106         /** This is supposed to be a pointer or a list of pointers to the
107            BufferViews currently being shown in the LyXView. So far
108            this is not used, but that should change pretty soon. (Lgb) */
109         BufferView * bufferview;
110         ///
111         MiniBuffer * minibuffer;
112         ///
113         Intl * intl;
114         ///
115         Timeout * autosave_timeout;
116         /// A callback
117         void AutoSave();
118         ///
119         void invalidateLayoutChoice();
120 private:
121         ///
122         LyXFunc * lyxfunc;
123         ///
124         Dialogs * dialogs_;
125         ///
126         virtual void setWindowTitle(string const &, string const &) = 0;
127         /** The last textclass layout list in the layout choice selector
128           This should probably be moved to the toolbar, but for now it's
129         here. (Asger) */
130         int last_textclass;
131 };
132 #endif