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