X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FGUI.h;h=ab4cfcd60c8ba4bc247139fa31b42ff819ac421d;hb=0705dae8a3a2bcdd6be55eb468547c1389e84d2c;hp=49f62ea290673a673ef653d3a1191585d4150879;hpb=f1c24d100985c6df2eb5ec390017b69c78fe49c7;p=lyx.git diff --git a/src/frontends/controllers/GUI.h b/src/frontends/controllers/GUI.h index 49f62ea290..ab4cfcd60c 100644 --- a/src/frontends/controllers/GUI.h +++ b/src/frontends/controllers/GUI.h @@ -1,75 +1,52 @@ // -*- C++ -*- /** * \file GUI.h - * Copyright 2001 The LyX Team. - * See the file COPYING. + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming + * + * Full author contact details are available in file CREDITS. */ #ifndef GUI_H #define GUI_H -#include "ButtonController.h" -#include "ViewBase.h" +#include + +class LyXView; +class Dialogs; -/** This class instantiates and makes available the GUI-specific - ButtonController and View. +/** This class makes a whole out of the disparate parts of a dialog. */ -template -class GUI : public Controller { +template +class GUI : boost::noncopyable { public: /// - GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this) {} + GUI(LyXView & lv, Dialogs & d); /// - virtual ButtonControllerBase & bc() { return bc_; } + Controller & controller() { return controller_; } /// - virtual ViewBase & view() { return view_; } - - friend void gui_ShowAboutlyx(LyXView &, Dialogs &); - friend void gui_ShowBibitem(InsetCommand *, LyXView &, Dialogs &); - friend void gui_ShowBibtex(InsetCommand *, LyXView &, Dialogs &); - friend void gui_ShowCharacter(LyXView &, Dialogs &); - friend void gui_SetUserFreeFont(LyXView &, Dialogs &); - friend void gui_ShowCitation(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateCitation(string const &, LyXView &, Dialogs &); - friend void gui_ShowDocument(LyXView &, Dialogs &); - friend void gui_ShowError(InsetError *, LyXView &, Dialogs &); - friend void gui_ShowERT(InsetERT *, LyXView &, Dialogs &); - friend void gui_UpdateERT(InsetERT *, LyXView &, Dialogs &); - friend void gui_ShowExternal(InsetExternal *, LyXView &, Dialogs &); - friend void gui_ShowFloat(InsetFloat *, LyXView &, Dialogs &); - friend void gui_ShowForks(LyXView &, Dialogs &); - friend void gui_ShowGraphics(InsetGraphics *, LyXView &, Dialogs &); - friend void gui_ShowInclude(InsetInclude *, LyXView &, Dialogs &); - friend void gui_ShowIndex(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateIndex(string const &, LyXView &, Dialogs &); - friend void gui_ShowLogFile(LyXView &, Dialogs &); - friend void gui_ShowMathPanel(LyXView &, Dialogs &); - friend void gui_ShowMinipage(InsetMinipage *, LyXView &, Dialogs &); - friend void gui_UpdateMinipage(InsetMinipage *, LyXView &, Dialogs &); - friend void gui_ShowParagraph(LyXView &, Dialogs &); - friend void gui_ShowPreamble(LyXView &, Dialogs &); - friend void gui_ShowPreferences(LyXView &, Dialogs &); - friend void gui_ShowPrint(LyXView &, Dialogs &); - friend void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateRef(string const &, LyXView &, Dialogs &); - friend void gui_ShowSearch(LyXView &, Dialogs &); - friend void gui_ShowSendto(LyXView &, Dialogs &); - friend void gui_ShowSpellchecker(LyXView &, Dialogs &); - friend void gui_ShowTabularCreate(LyXView &, Dialogs &); - friend void gui_ShowTexinfo(LyXView &, Dialogs &); - friend void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateTOC(string const &, LyXView &, Dialogs &); - friend void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateUrl(string const &, LyXView &, Dialogs &); - friend void gui_ShowVCLogFile(LyXView &, Dialogs &); - + Controller const & controller() const { return controller_; } private: /// - ButtonController bc_; + Controller controller_; /// GUIview view_; }; + +template +GUI::GUI(LyXView & lv, Dialogs & d) + : controller_(lv, d), + view_() +{ + controller_.setView(view_); + view_.setController(controller_); + controller_.bc().view(new GUIbc(controller_.bc())); + controller_.bc().bp(new Policy); +} + #endif // GUI_H