/**
- * \file xforms/Dialogs.C
+ * \file qt2/Dialogs2.C
* Copyright 1995 Matthias Ettrich
* This file is part of LyX, the document processor.
* 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_impl.h"
-
-void Dialogs::showAboutlyx()
-{
- pimpl_->aboutlyx.controller().show();
-}
-
-
-void Dialogs::showBibitem(InsetCommand * ic)
-{
- pimpl_->bibitem.controller().showInset(ic);
-}
-
-
-void Dialogs::showBibtex(InsetCommand * ic)
-{
- pimpl_->bibtex.controller().showInset(ic);
-}
-
-
-void Dialogs::showCharacter()
-{
- pimpl_->character.controller().show();
-}
-
-
-void Dialogs::setUserFreeFont()
-{
- pimpl_->character.controller().apply();
-}
-
-
-void Dialogs::showCitation(InsetCommand * ic)
-{
- pimpl_->citation.controller().showInset(ic);
-}
-
-
-void Dialogs::createCitation(string const & s)
-{
- pimpl_->citation.controller().createInset(s);
-}
-
-
-void Dialogs::showDocument()
+#include "Dialogs.h"
+#include "controllers/GUI.h"
+#include "ButtonController.h"
+
+#include "ControlDocument.h"
+#include "ControlForks.h"
+#include "ControlPrefs.h"
+#include "ControlPrint.h"
+#include "ControlSearch.h"
+#include "ControlSendto.h"
+#include "ControlSpellchecker.h"
+#include "ControlTexinfo.h"
+
+#include "QCharacter.h"
+#include "QCharacterDialog.h"
+#include "QDocument.h"
+#include "QDocumentDialog.h"
+//#include "QForks.h"
+// Here would be an appropriate point to lecture on the evils
+// of the Qt headers, those most fucked up of disgusting ratholes.
+// But I won't.
+#undef signals
+#include "QPrefs.h"
+#include "QPrefsDialog.h"
+#include "QPrint.h"
+#include "QLPrintDialog.h"
+#include "QSearch.h"
+#include "QSearchDialog.h"
+#include "QSendto.h"
+#include "QSendtoDialog.h"
+#include "QSpellchecker.h"
+#include "QSpellcheckerDialog.h"
+#include "QTexinfo.h"
+#include "QTexinfoDialog.h"
+
+#include "Qt2BC.h"
+
+
+
+typedef GUI<ControlDocument, QDocument, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+DocumentDialog;
+
+typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
+PrefsDialog;
+
+typedef GUI<ControlPrint, QPrint, OkApplyCancelPolicy, Qt2BC>
+PrintDialog;
+
+typedef GUI<ControlSearch, QSearch, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+SearchDialog;
+
+typedef GUI<ControlSendto, QSendto, OkApplyCancelPolicy, Qt2BC>
+SendtoDialog;
+
+typedef GUI<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+SpellcheckerDialog;
+
+typedef GUI<ControlTexinfo, QTexinfo, OkCancelPolicy, Qt2BC>
+TexinfoDialog;
+
+struct Dialogs::Impl {
+ Impl(LyXView & lv, Dialogs & d);
+
+ DocumentDialog document;
+ PrefsDialog prefs;
+ PrintDialog print;
+ SearchDialog search;
+ SendtoDialog sendto;
+ SpellcheckerDialog spellchecker;
+ TexinfoDialog texinfo;
+};
+
+
+Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
+ : document(lv, d),
+ prefs(lv, d),
+ print(lv, d),
+ search(lv, d),
+ sendto(lv, d),
+ spellchecker(lv, d),
+ texinfo(lv, d)
{}
-void Dialogs::showError(InsetError * ie)
-{
- pimpl_->error.controller().showInset(ie);
-}
-
-
-void Dialogs::showERT(InsetERT * ie)
-{
- pimpl_->ert.controller().showInset(ie);
-}
-
-
-void Dialogs::updateERT(InsetERT * ie)
-{
- pimpl_->ert.controller().showInset(ie);
-}
-
-
-void Dialogs::showExternal(InsetExternal * ie)
+void Dialogs::init_pimpl()
{
- pimpl_->external.controller().showInset(ie);
+ pimpl_ = new Impl(lyxview_, *this);
}
-void Dialogs::showFile(string const & f)
+Dialogs::~Dialogs()
{
- pimpl_->file.controller().showFile(f);
+ delete pimpl_;
}
-void Dialogs::showFloat(InsetFloat * ifl)
+void Dialogs::showDocument()
{
- pimpl_->floats.controller().showInset(ifl);
+ pimpl_->document.controller().show();
}
{}
-void Dialogs::showGraphics(InsetGraphics * ig)
-{
- pimpl_->graphics.controller().showInset(ig);
-}
-
-
-void Dialogs::showInclude(InsetInclude * ii)
-{
- pimpl_->include.controller().showInset(ii);
-}
-
-
-void Dialogs::showIndex(InsetCommand * ic)
-{
- pimpl_->index.controller().showInset(ic);
-}
-
-
-void Dialogs::createIndex()
-{
- pimpl_->index.controller().createInset(string());
-}
-
-
-void Dialogs::showLogFile()
-{
- pimpl_->logfile.controller().show();
-}
-
-
void Dialogs::showMathPanel()
{
// FIXME FIXME FIXME
}
-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();
-}
-
-
void Dialogs::showPreamble()
{
- pimpl_->preamble.controller().show();
+ pimpl_->document.controller().show();
+ // Oh Angus, won't you help a poor child ?
+ //pimpl_->document.view()->showPreamble();
}
void Dialogs::showPreferences()
-{}
-
-
-void Dialogs::showPrint()
-{
- pimpl_->print.controller().show();
-}
-
-
-void Dialogs::showRef(InsetCommand * ic)
{
- pimpl_->ref.controller().showInset(ic);
+ pimpl_->prefs.controller().show();
}
-void Dialogs::createRef(string const & s)
+void Dialogs::showPrint()
{
- pimpl_->ref.controller().createInset(s);
+ pimpl_->print.controller().show();
}
void Dialogs::showSendto()
-{}
-
-
-void Dialogs::showSpellchecker()
{
- pimpl_->spellchecker.controller().show();
+ pimpl_->sendto.controller().show();
}
-void Dialogs::showTabular(InsetTabular * it)
-{}
-
-
-void Dialogs::updateTabular(InsetTabular * it)
-{}
-
-
-void Dialogs::showTabularCreate()
+void Dialogs::showSpellchecker()
{
- pimpl_->tabularcreate.controller().show();
+ pimpl_->spellchecker.controller().show();
}
{
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 * i)
-{
- // FIXME
-}