]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetindex.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetindex.C
index c5ebb9b92f61cb75cace221a59ce3822490a4346..c175cf1ffd14cb5e05d7aafff22049ef7542ac57 100644 (file)
@@ -1,49 +1,91 @@
+/**
+ * \file insetindex.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 "insetindex.h"
-#include "BufferView.h"
-#include "LyXView.h"
-#include "frontends/Dialogs.h"
+
+#include "dispatchresult.h"
+#include "funcrequest.h"
+#include "gettext.h"
 #include "LaTeXFeatures.h"
+#include "metricsinfo.h"
+#include "sgml.h"
+
+#include "support/std_ostream.h"
+
+
+namespace lyx {
+
+using std::string;
+using std::ostream;
+
 
 InsetIndex::InsetIndex(InsetCommandParams const & p)
-       : InsetCommand(p)
+       : InsetCommand(p, "index")
 {}
 
 
-string InsetIndex::getScreenLabel() const
+// InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
+
+
+docstring const InsetIndex::getScreenLabel(Buffer const &) const
 {
        return _("Idx");
 }
 
 
-void InsetIndex::Edit(BufferView * bv, int, int, unsigned int)
+int InsetIndex::docbook(Buffer const &, odocstream & os,
+                       OutputParams const &) const
 {
-       bv->owner()->getDialogs()->showIndex( this );
+       os << "<indexterm><primary>"
+           << sgml::escapeString(getParam("name"))
+          << "</primary></indexterm>";
+       return 0;
 }
 
 
+InsetBase::Code InsetIndex::lyxCode() const
+{
+       return InsetBase::INDEX_CODE;
+}
+
+
+
 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
-       : InsetCommand(p)
+       : InsetCommand(p, string())
 {}
 
-string InsetPrintIndex::getScreenLabel() const
+
+// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
+
+
+docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
 {
        return _("Index");
 }
 
 
-void InsetPrintIndex::Validate(LaTeXFeatures & features) const
+void InsetPrintIndex::validate(LaTeXFeatures & features) const
 {
-       features.makeidx = true;
+       features.require("makeidx");
 }
 
 
-Inset::Code InsetPrintIndex::LyxCode() const
+InsetBase::Code InsetPrintIndex::lyxCode() const
 {
-       return Inset::INDEX_CODE;
+       return InsetBase::INDEX_PRINT_CODE;
 }
+
+
+} // namespace lyx