4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjornes <larsbj@lyx.org>
8 * \author John Levon <moz@compsoc.man.ac.uk>
20 #include "support/types.h"
22 #include <boost/utility.hpp>
23 #include <boost/scoped_ptr.hpp>
24 #include <boost/signals/trackable.hpp>
39 * LyXView - main LyX window
41 * This class represents the main LyX window and provides
42 * accessor functions to its content.
44 * The eventual intention is that LyX will support a number
45 * of containing LyXViews. Currently a lot of code still
46 * relies on there being a single top-level view.
48 * Additionally we would like to support multiple views
49 * in a single LyXView.
51 class LyXView : public boost::signals::trackable, boost::noncopyable {
57 /// Redraw the main form.
58 virtual void redraw() = 0;
60 /// Resize all BufferViews in this LyXView (because the width changed)
63 /// returns the buffer currently shown in the main form.
64 Buffer * buffer() const;
67 BufferView * view() const;
69 /// return the toolbar for this view
70 Toolbar * getToolbar() const;
72 /// sets the layout in the toolbar layout combox
73 void setLayout(string const & layout);
74 /// update the toolbar
77 /// return a pointer to the lyxfunc
78 LyXFunc * getLyXFunc() const;
80 /// return a pointer to the minibuffer
81 MiniBuffer * getMiniBuffer() const;
84 void message(string const &);
86 void messagePush(string const & str);
90 /// return the menubar for this view
91 Menubar * getMenubar() const;
97 Intl * getIntl() const;
99 /// get access to the dialogs
100 Dialogs * getDialogs() { return dialogs_.get(); }
103 void updateLayoutChoice();
105 /// Updates the title of the window
106 void updateWindowTitle();
108 /// Show state (toolbar and font in minibuffer)
111 /// Reset autosave timer
112 void resetAutosaveTimer();
114 virtual void prohibitInput() const = 0;
116 virtual void allowInput() const = 0;
119 /// view of a buffer. Eventually there will be several.
120 boost::scoped_ptr<BufferView> bufferview_;
123 boost::scoped_ptr<Menubar> menubar_;
125 boost::scoped_ptr<Toolbar> toolbar_;
126 /// view's minibuffer
127 boost::scoped_ptr<MiniBuffer> minibuffer_;
129 /// keyboard mapping object
130 boost::scoped_ptr<Intl> intl_;
132 /// auto-saving of buffers
133 boost::scoped_ptr<Timeout> autosave_timeout_;
135 /// called on timeout
138 /// FIXME: GUII - toolbar property
139 void invalidateLayoutChoice();
143 * setWindowTitle - set title of window
144 * @param t main window title
145 * @param it iconified (short) title
147 virtual void setWindowTitle(string const & t, string const & it) = 0;
149 /// our function handler
150 boost::scoped_ptr<LyXFunc> lyxfunc_;
151 /// dialogs for this view
152 boost::scoped_ptr<Dialogs> dialogs_;
155 * The last textclass layout list in the layout choice selector
156 * This should probably be moved to the toolbar, but for now it's