]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettoc.C
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insettoc.C
index b658a3bd8064ed5e52a9792eefb5e6bebd397f92..46137a94c78fad93855924e60c05a21dbe21e4bb 100644 (file)
@@ -1,11 +1,18 @@
+/**
+ * \file insettoc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
+ */
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "gettext.h"
 #include "insettoc.h"
+#include "funcrequest.h"
 #include "BufferView.h"
 #include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
@@ -16,6 +23,18 @@ using std::vector;
 using std::ostream;
 
 
+InsetTOC::InsetTOC(InsetCommandParams const & p, bool same_id)
+       : InsetCommand(p, same_id)
+{}
+
+
+InsetTOC::~InsetTOC()
+{
+       InsetCommandMailer mailer("toc", *this);
+       mailer.hideDialog();
+}
+
+
 string const InsetTOC::getScreenLabel(Buffer const *) const
 {
        string const cmdname(getCmdName());
@@ -35,15 +54,15 @@ Inset::Code InsetTOC::lyxCode() const
 }
 
 
-void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
-{
-       bv->owner()->getDialogs()->showTOC(this);
-}
-
-
-void InsetTOC::edit(BufferView * bv, bool)
+dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd)
 {
-       edit(bv, 0, 0, mouse_button::none);
+       switch (cmd.action) {
+       case LFUN_INSET_EDIT:
+               InsetCommandMailer("toc", *this).showDialog(cmd.view());
+               return DISPATCHED;
+       default:
+               return UNDISPATCHED;
+       }
 }