4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
16 #include <libglademm.h>
17 #include <boost/scoped_ptr.hpp>
19 #include "ButtonPolicies.h"
22 class GViewBase : public Dialog::View, public SigC::Object
25 GViewBase(Dialog &, std::string const &, bool allowResize);
30 virtual void doBuild() = 0;
33 // Create the dialog if necessary, update it and display it.
36 virtual bool isVisible() const;
42 bool onDeleteEvent(GdkEventAny *);
44 virtual Gtk::Window * window() = 0;
45 virtual Gtk::Window const * window() const = 0;
49 template <class Dialog>
50 class GViewDB : public GViewBase
53 GViewDB(Dialog &, std::string const &, bool allowResize);
54 virtual const Gtk::Window * window() const;
55 virtual Gtk::Window * window();
56 boost::scoped_ptr<Dialog> dialog_;
60 template <class Dialog>
61 GViewDB<Dialog>::GViewDB(Dialog & parent, std::string const & t, bool allowResize) :
62 GViewBase(parent, t, allowResize)
67 template <class Dialog>
68 Gtk::Window * GViewDB<Dialog>::window()
74 template <class Dialog>
75 const Gtk::Window * GViewDB<Dialog>::window() const
81 class GViewGladeB : public GViewBase
84 GViewGladeB(Dialog & parent, std::string const & t, bool allowResize);
85 virtual const Gtk::Window * window() const;
86 virtual Gtk::Window * window();
87 Glib::RefPtr<Gnome::Glade::Xml> xml_;
91 template <class Controller, class Base>
92 class GViewCB : public Base
95 Controller & controller();
96 Controller const & controller() const;
98 GViewCB(Dialog & parent, std::string const & t, bool allowResize = false);
102 template <class Controller, class Base>
103 GViewCB<Controller, Base>::GViewCB(Dialog & parent, std::string const & t,
105 Base(parent, t, allowResize)
110 template <class Controller, class Base>
111 Controller & GViewCB<Controller, Base>::controller()
113 return static_cast<Controller &>(getController());
117 template <class Controller, class Base>
118 Controller const & GViewCB<Controller, Base>::controller() const
120 return static_cast<Controller const &>(getController());