]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
text2 chane, XFormsView
[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 "frontends/Timeout.h"
15 #include "layout.h"
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
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(LyXTextClass::size_type layout);
57
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 &) = 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