#ifndef LYXVIEW_H
#define LYXVIEW_H
+#include "frontends/Application.h"
#include "frontends/Toolbars.h"
#include <boost/scoped_ptr.hpp>
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();
/// 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(); }
/// 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();
/// show the error list to the user
void showErrorList(std::string 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
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);