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 {
59 * This is called after the concrete view has been created.
60 * We have to have the toolbar and the other stuff created
61 * before we can populate it with this call.
65 /// start modal operation
66 virtual void prohibitInput() const = 0;
67 /// end modal operation
68 virtual void allowInput() const = 0;
70 //@{ generic accessor functions
72 /// return the current buffer view
73 BufferView * view() const;
75 /// return the LyX function handler for this view
76 LyXFunc * getLyXFunc() const;
78 /// return the buffer currently shown in this window
79 Buffer * buffer() const;
81 /// return the toolbar for this view
82 Toolbar * getToolbar() const;
84 /// return the menubar for this view
85 Menubar * getMenubar() const;
87 /// return the minibuffer for this view
88 /// FIXME: I'm not at all sure that LyXFunc should be
89 /// aware of a mini buffer as such
90 MiniBuffer * getMiniBuffer() const;
92 /// get access to the dialogs
93 Dialogs * getDialogs() { return dialogs_.get(); }
95 /// get this view's keyboard map handler
96 Intl * getIntl() const;
100 /// sets the layout in the toolbar layout selection
101 void setLayout(string const & layout);
102 /// updates the possible layouts selectable
103 void updateLayoutChoice();
105 /// update the toolbar
106 void updateToolbar();
107 /// update the menubar
108 void updateMenubar();
110 /// display a message in the view
111 void message(string const &);
112 /// push a message onto the history, and show it
113 void messagePush(string const & str);
114 /// pop the last message pushed
116 /// show state (font etc.) in minibuffer
119 /// updates the title of the window
120 void updateWindowTitle();
122 /// reset autosave timer
123 void resetAutosaveTimer();
126 /// view of a buffer. Eventually there will be several.
127 boost::scoped_ptr<BufferView> bufferview_;
130 boost::scoped_ptr<Menubar> menubar_;
132 boost::scoped_ptr<Toolbar> toolbar_;
133 /// view's minibuffer
134 boost::scoped_ptr<MiniBuffer> minibuffer_;
136 /// keyboard mapping object
137 boost::scoped_ptr<Intl> intl_;
139 /// auto-saving of buffers
140 boost::scoped_ptr<Timeout> autosave_timeout_;
142 /// called on timeout
147 * setWindowTitle - set title of window
148 * @param t main window title
149 * @param it iconified (short) title
151 virtual void setWindowTitle(string const & t, string const & it) = 0;
153 /// our function handler
154 boost::scoped_ptr<LyXFunc> lyxfunc_;
155 /// dialogs for this view
156 boost::scoped_ptr<Dialogs> dialogs_;