]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Dialogs2.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / Dialogs2.C
index 18fd6b6dd555dbb88df1ee2d4f06d1c2cde8f926..0c95fde9811dcf6f1b955914d7438408e52e51ed 100644 (file)
  * Licence details can be found in the file COPYING.
  *
  * \author Allan Rae
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "Dialogs.h"
+#include "controllers/GUI.h"
+#include "ButtonController.h"
 
-#include "Dialogs_impl.h"
+#include "Tooltips.h"
+#include "xformsBC.h"
 
+#include "ControlDocument.h"
+#include "FormDocument.h"
+#include "forms/form_document.h"
 
-void Dialogs::showAboutlyx()
-{
-       pimpl_->aboutlyx.controller().show();
-}
+#include "ControlForks.h"
+#include "FormForks.h"
+#include "forms/form_forks.h"
 
+#include "ControlMath.h"
+#include "FormMathsPanel.h"
+#include "forms/form_maths_panel.h"
 
-void Dialogs::showBibitem(InsetCommand * ic)
-{
-       pimpl_->bibitem.controller().showInset(ic);
-}
+#include "ControlPreamble.h"
+#include "FormPreamble.h"
+#include "forms/form_preamble.h"
 
+#include "ControlPrefs.h"
+#include "FormPreferences.h"
+#include "forms/form_preferences.h"
 
-void Dialogs::showBibtex(InsetCommand * ic)
-{
-       pimpl_->bibtex.controller().showInset(ic);
-}
+#include "ControlPrint.h"
+#include "FormPrint.h"
+#include "forms/form_print.h"
 
+#include "ControlSearch.h"
+#include "FormSearch.h"
+#include "forms/form_search.h"
 
-void Dialogs::showCharacter()
-{
-       pimpl_->character.controller().show();
-}
+#include "ControlSendto.h"
+#include "FormSendto.h"
+#include "forms/form_sendto.h"
 
+#include "ControlSpellchecker.h"
+#include "FormSpellchecker.h"
+#include "forms/form_spellchecker.h"
 
-void Dialogs::setUserFreeFont()
-{
-       pimpl_->character.controller().apply();
-}
+#include "ControlTexinfo.h"
+#include "FormTexinfo.h"
+#include "forms/form_texinfo.h"
 
+typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
+DocumentDialog;
 
-void Dialogs::showCitation(InsetCommand * ic)
-{
-       pimpl_->citation.controller().showInset(ic);
-}
-
-
-void Dialogs::createCitation(string const & s)
-{
-       pimpl_->citation.controller().createInset(s);
-}
-
-
-void Dialogs::showDocument()
-{
-       pimpl_->document.show();
-}
-
-
-void Dialogs::showError(InsetError * ie)
-{
-       pimpl_->error.controller().showInset(ie);
-}
-
-
-void Dialogs::showERT(InsetERT * ie)
-{
-       pimpl_->ert.controller().showInset(ie);
-}
+typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
+ForksDialog;
 
+typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
+MathPanelDialog;
 
-void Dialogs::updateERT(InsetERT * ie)
-{
-       pimpl_->ert.controller().showInset(ie);
-}
+typedef GUI<ControlPreamble, FormPreamble, NoRepeatedApplyReadOnlyPolicy, xformsBC>
+PreambleDialog;
 
+typedef GUI<ControlPrefs, FormPreferences, OkApplyCancelPolicy, xformsBC>
+PreferencesDialog;
 
-void Dialogs::showExternal(InsetExternal * ie)
-{
-       pimpl_->external.controller().showInset(ie);
-}
+typedef GUI<ControlPrint, FormPrint, OkApplyCancelPolicy, xformsBC>
+PrintDialog;
 
+typedef GUI<ControlSearch, FormSearch, NoRepeatedApplyReadOnlyPolicy, xformsBC>
+SearchDialog;
 
-void Dialogs::showFile(string const & f)
-{
-       pimpl_->file.controller().showFile(f);
-}
+typedef GUI<ControlSendto, FormSendto, OkApplyCancelPolicy, xformsBC>
+SendtoDialog;
 
+typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
+SpellcheckerDialog;
 
-void Dialogs::showFloat(InsetFloat * ifl)
-{
-       pimpl_->floats.controller().showInset(ifl);
-}
+typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
+TexinfoDialog;
 
+struct Dialogs::Impl {
+       Impl(LyXView & lv, Dialogs & d);
 
-void Dialogs::showForks()
-{
-       pimpl_->forks.controller().show();
-}
+       DocumentDialog      document;
+       ForksDialog         forks;
+       MathPanelDialog     mathpanel;
+       PreambleDialog      preamble;
+       PreferencesDialog   preferences;
+       PrintDialog         print;
+       SearchDialog        search;
+       SendtoDialog        sendto;
+       SpellcheckerDialog  spellchecker;
+       TexinfoDialog       texinfo;
+};
 
 
-void Dialogs::showGraphics(InsetGraphics * ig)
-{
-       pimpl_->graphics.controller().showInset(ig);
-}
+Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
+       : document(lv, d),
+         forks(lv, d),
+         mathpanel(lv, d),
+         preamble(lv, d),
+         preferences(lv, d),
+         print(lv, d),
+         search(lv, d),
+         sendto(lv, d),
+         spellchecker(lv, d),
+         texinfo(lv, d)
+{}
 
 
-void Dialogs::showInclude(InsetInclude * ii)
+void Dialogs::init_pimpl()
 {
-       pimpl_->include.controller().showInset(ii);
+       pimpl_ = new Impl(lyxview_, *this);
 }
 
 
-void Dialogs::showIndex(InsetCommand * ic)
+Dialogs::~Dialogs()
 {
-       pimpl_->index.controller().showInset(ic);
+       delete pimpl_;
 }
 
 
-void Dialogs::createIndex()
+void Dialogs::showDocument()
 {
-       pimpl_->index.controller().createInset(string());
+       pimpl_->document.controller().show();
 }
 
 
-void Dialogs::showLogFile()
+void Dialogs::showForks()
 {
-       pimpl_->logfile.controller().show();
+       pimpl_->forks.controller().show();
 }
 
 
 void Dialogs::showMathPanel()
 {
-       pimpl_->mathpanel.show();
-}
-
-
-void Dialogs::showMinipage(InsetMinipage * im)
-{
-       pimpl_->minipage.controller().showInset(im);
-}
-
-
-void Dialogs::updateMinipage(InsetMinipage * im)
-{
-       pimpl_->minipage.controller().showInset(im);
-}
-
-
-void Dialogs::showParagraph()
-{
-       pimpl_->paragraph.controller().show();
-}
-
-
-void Dialogs::updateParagraph()
-{
-       pimpl_->paragraph.controller().changedParagraph();
+       pimpl_->mathpanel.controller().show();
 }
 
 
@@ -177,7 +157,7 @@ void Dialogs::showPreamble()
 
 void Dialogs::showPreferences()
 {
-       pimpl_->preferences.show();
+       pimpl_->preferences.controller().show();
 }
 
 
@@ -187,18 +167,6 @@ void Dialogs::showPrint()
 }
 
 
-void Dialogs::showRef(InsetCommand * ic)
-{
-       pimpl_->ref.controller().showInset(ic);
-}
-
-
-void Dialogs::createRef(string const & s)
-{
-       pimpl_->ref.controller().createInset(s);
-}
-
-
 void Dialogs::showSearch()
 {
        pimpl_->search.controller().show();
@@ -217,76 +185,7 @@ void Dialogs::showSpellchecker()
 }
 
 
-void Dialogs::showTabular(InsetTabular * it)
-{
-       pimpl_->tabular.showInset(it);
-}
-
-
-void Dialogs::updateTabular(InsetTabular * it)
-{
-       pimpl_->tabular.updateInset(it);
-}
-
-
-void Dialogs::showTabularCreate()
-{
-       pimpl_->tabularcreate.controller().show();
-}
-
-
 void Dialogs::showTexinfo()
 {
        pimpl_->texinfo.controller().show();
 }
-
-
-#ifdef HAVE_LIBAIKSAURUS
-
-void Dialogs::showThesaurus(string const & s)
-{
-       pimpl_->thesaurus.controller().showEntry(s);
-}
-
-#else
-
-void Dialogs::showThesaurus(string const &)
-{}
-
-#endif
-
-
-void Dialogs::showTOC(InsetCommand * ic)
-{
-       pimpl_->toc.controller().showInset(ic);
-}
-
-
-void Dialogs::createTOC(string const & s)
-{
-       pimpl_->toc.controller().createInset(s);
-}
-
-
-void Dialogs::showUrl(InsetCommand * ic)
-{
-       pimpl_->url.controller().showInset(ic);
-}
-
-
-void Dialogs::createUrl(string const & s)
-{
-       pimpl_->url.controller().createInset(s);
-}
-
-
-void Dialogs::showVCLogFile()
-{
-       pimpl_->vclogfile.controller().show();
-}
-
-
-void Dialogs::showWrap(InsetWrap * iw)
-{
-       pimpl_->wrap.controller().showInset(iw);
-}