#ifndef LYXVIEW_H
#define LYXVIEW_H
-#include "errorlist.h"
+#include "frontends/Application.h"
+#include "frontends/Toolbars.h"
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
class Buffer;
-class Toolbars;
class InsetBase;
-class Intl;
class Menubar;
class BufferView;
namespace lyx {
namespace frontend {
-class Gui;
class WorkArea;
class ControlCommandBuffer;
} // namespace frontend
class LyXView : public boost::signals::trackable, boost::noncopyable {
public:
- LyXView(lyx::frontend::Gui & owner);
+ LyXView();
virtual ~LyXView();
/// show busy cursor
virtual void busy(bool) const = 0;
+ virtual Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb) = 0;
+
//@{ generic accessor functions
/** return the current buffer view
/// return the buffer currently shown in this window
Buffer * buffer() const;
+ /* FIXME: Abdel 22/09/71
+ there is only one lyxFunc() for now but there is maybe a need
+ for more in the feature. Something like that:
+
+ LyXFunc & getLyXFunc() { return theApp->lyxFunc(id_); }
+
+ where id_ would be the this LyXView ID.
+ That's the reason why I didn't remove these methods for now.
+ */
/// return the LyX function handler for this view
- LyXFunc & getLyXFunc() { return *lyxfunc_.get(); }
+ LyXFunc & getLyXFunc() { return theApp->lyxFunc(); }
///
- LyXFunc const & getLyXFunc() const { return *lyxfunc_.get(); }
+ LyXFunc const & getLyXFunc() const { return theApp->lyxFunc(); }
/// return the toolbar for this view
Toolbars & getToolbars() { return *toolbars_.get(); }
///
Dialogs const & getDialogs() const { return *dialogs_.get(); }
- /// get this view's keyboard map handler
- Intl & getIntl() { return *intl_.get(); }
- ///
- Intl const & getIntl() const { return *intl_.get(); }
-
//@}
/// load a buffer into the current workarea
boost::signal<void()> focus_command_buffer;
/// display a message in the view
- virtual void message(std::string const &) = 0;
+ virtual void message(lyx::docstring const &) = 0;
/// clear any temporary message and replace with current status
virtual void clearMessage() = 0;
/// returns true if this view has the focus.
virtual bool hasFocus() const = 0;
- ///
- virtual lyx::frontend::Gui & gui();
-
/// Temporary method used by the kernel to redraw the work area.
virtual void redrawWorkArea();
/// This is needed for the qt3 and gtk frontend.
lyx::frontend::WorkArea * workArea();
- /// get the stored error list
- ErrorList const & getErrorList() const;
/// show the error list to the user
void showErrorList(std::string const &);
- /// add an error to the list
- /** FIXME: public method until the signal connection in
- * BufferView::menuInsertLyXFile() is removed.
- */
- void addError(ErrorItem const &);
+
+ /// connect to signals in the given BufferView
+ void connectBufferView(BufferView & bv);
+ /// disconnect from signals in the given BufferView
+ void disconnectBufferView();
protected:
/// current work area (screen view of a BufferView).
boost::scoped_ptr<Menubar> menubar_;
private:
- lyx::frontend::Gui & owner_;
/**
* setWindowTitle - set title of window
* @param t main window title
* @param it iconified (short) title
*/
- virtual void setWindowTitle(std::string const & t, std::string const & it) = 0;
+ virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it) = 0;
/// called on timeout
void autoSave();
/// view's toolbar
boost::scoped_ptr<Toolbars> toolbars_;
- /// keyboard mapping object
- boost::scoped_ptr<Intl> const intl_;
/// auto-saving of buffers
boost::scoped_ptr<Timeout> const autosave_timeout_;
/// our function handler
/// dialogs for this view
boost::scoped_ptr<Dialogs> dialogs_;
- /// An error list (replaces the error insets)
- ErrorList errorlist_;
-
/// buffer errors signal connection
- boost::signals::connection errorConnection_;
+ boost::signals::connection errorsConnection_;
/// buffer messages signal connection
boost::signals::connection messageConnection_;
/// buffer busy status signal connection
void connectBuffer(Buffer & buf);
/// disconnect from signals in the given buffer
void disconnectBuffer();
+
+ /// BufferView messages signal connection
+ //@{
+ boost::signals::connection message_connection_;
+ boost::signals::connection show_dialog_connection_;
+ boost::signals::connection show_dialog_with_data_connection_;
+ boost::signals::connection show_inset_dialog_connection_;
+ boost::signals::connection update_dialog_connection_;
+ //@}
+
+ /// Bind methods for BufferView messages signal connection
+ //@{
+ void showDialog(std::string const & name);
+ void showDialogWithData(std::string const & name,
+ std::string const & data);
+ void showInsetDialog(std::string const & name,
+ std::string const & data, InsetBase * inset);
+ void updateDialog(std::string const & name,
+ std::string const & data);
+ //@}
+
/// notify readonly status
void showReadonly(bool);