X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiImplementation.h;h=b88c2f211e5325d6fed2f79c654677704a2714fd;hb=50de85396c785a454fe07b77d815c57f3e462282;hp=d31437cfa59617dbafd4b00133a06d56540b7511;hpb=c9c6ed0b7fbccbbed8b5ef48d05cfefa5acfb99e;p=lyx.git diff --git a/src/frontends/qt4/GuiImplementation.h b/src/frontends/qt4/GuiImplementation.h index d31437cfa5..b88c2f211e 100644 --- a/src/frontends/qt4/GuiImplementation.h +++ b/src/frontends/qt4/GuiImplementation.h @@ -14,55 +14,43 @@ #define GUI_H #include "frontends/Gui.h" -#include "GuiClipboard.h" -#include "GuiSelection.h" -#include +#include #include -class LyXView; - namespace lyx { namespace frontend { -class GuiWorkArea; -class GuiView; +class GuiViewBase; +class LyXView; /** * The GuiImplementation class is the interface to all Qt4 components. */ -class GuiImplementation: public Gui +class GuiImplementation : public QObject, public Gui { + Q_OBJECT + public: GuiImplementation(); virtual ~GuiImplementation() {} - Clipboard& clipboard(); - Selection& selection(); - - int newView(unsigned int width, unsigned int height); - LyXView& view(int id); - void destroyView(int id); - int newWorkArea(unsigned int width, unsigned int height, int view_id); - int newWorkArea(int w, int h); - WorkArea& workArea(int id); - void destroyWorkArea(int id); + virtual LyXView& createRegisteredView(); + virtual bool closeAllViews(); + virtual bool unregisterView(int id); + virtual LyXView& view(int id) const; private: - /// - GuiClipboard clipboard_; - /// - GuiSelection selection_; - /// - std::map > views_; - /// - std::map > work_areas_; - /// - size_t max_view_id_; - /// - size_t max_wa_id_; + + /// Multiple views container. + /** + * Warning: This must not be a smart pointer as the destruction of the + * object is handled by Qt when the view is closed + * \sa Qt::WA_DeleteOnClose attribute. + */ + std::map views_; }; } // namespace frontend