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 {
58 virtual void init() = 0;
60 virtual void setPosition(int, int) = 0;
62 virtual void show(int, int, string const &) = 0;
63 /// Redraw the main form.
64 virtual void redraw() = 0;
66 /// Resize all BufferViews in this LyXView (because the width changed)
69 /// returns the buffer currently shown in the main form.
70 Buffer * buffer() const;
73 BufferView * view() const;
75 /// return the toolbar for this view
76 Toolbar * getToolbar() const;
78 /// sets the layout in the toolbar layout combox
79 void setLayout(string const & layout);
80 /// update the toolbar
83 /// return a pointer to the lyxfunc
84 LyXFunc * getLyXFunc() const;
86 /// return a pointer to the minibuffer
87 MiniBuffer * getMiniBuffer() const;
90 void message(string const &);
92 void messagePush(string const & str);
96 /// return the menubar for this view
97 Menubar * getMenubar() const;
100 void updateMenubar();
103 Intl * getIntl() const;
105 /// get access to the dialogs
106 Dialogs * getDialogs() { return dialogs_.get(); }
109 void updateLayoutChoice();
111 /// Updates the title of the window
112 void updateWindowTitle();
114 /// Show state (toolbar and font in minibuffer)
117 /// Reset autosave timer
118 void resetAutosaveTimer();
120 virtual void prohibitInput() const = 0;
122 virtual void allowInput() const = 0;
125 /// view of a buffer. Eventually there will be several.
126 boost::scoped_ptr<BufferView> bufferview_;
129 boost::scoped_ptr<Menubar> menubar_;
131 boost::scoped_ptr<Toolbar> toolbar_;
132 /// view's minibuffer
133 boost::scoped_ptr<MiniBuffer> minibuffer_;
135 /// keyboard mapping object
136 boost::scoped_ptr<Intl> intl_;
138 /// auto-saving of buffers
139 boost::scoped_ptr<Timeout> autosave_timeout_;
141 /// called on timeout
144 /// FIXME: GUII - toolbar property
145 void invalidateLayoutChoice();
149 * setWindowTitle - set title of window
150 * @param t main window title
151 * @param it iconified (short) title
153 virtual void setWindowTitle(string const & t, string const & it) = 0;
155 /// our function handler
156 boost::scoped_ptr<LyXFunc> lyxfunc_;
157 /// dialogs for this view
158 boost::scoped_ptr<Dialogs> dialogs_;
161 * The last textclass layout list in the layout choice selector
162 * This should probably be moved to the toolbar, but for now it's