]> 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 486aeb23111eb845002f76c2d95d5f78f60f3c40..c175cf1ffd14cb5e05d7aafff22049ef7542ac57 100644 (file)
@@ -1,60 +1,76 @@
+/**
+ * \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 "LaTeXFeatures.h"
+
+#include "dispatchresult.h"
+#include "funcrequest.h"
 #include "gettext.h"
-#include "support/LOstream.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, bool)
-       : InsetCommand(p)
+
+InsetIndex::InsetIndex(InsetCommandParams const & p)
+       : InsetCommand(p, "index")
 {}
 
 
-string const InsetIndex::getScreenLabel(Buffer const *) 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;
 }
 
 
-void InsetIndex::edit(BufferView * bv, bool)
+InsetBase::Code InsetIndex::lyxCode() const
 {
-       edit(bv, 0, 0, 0);
+       return InsetBase::INDEX_CODE;
 }
 
 
-int InsetIndex::docbook(Buffer const *, ostream & os) const
-{
-  os << "<indexterm><primary>" << getContents() << "</primary></indexterm>";
-  return 0;
-}
 
+InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
+       : InsetCommand(p, string())
+{}
 
-Inset::Code InsetIndex::lyxCode() const
-{
-       return Inset::INDEX_CODE;
-}
 
+// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
 
-InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
-       : InsetCommand(p)
-{}
 
-string const InsetPrintIndex::getScreenLabel(Buffer const *) const
+docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
 {
        return _("Index");
 }
@@ -66,7 +82,10 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const
 }
 
 
-Inset::Code InsetPrintIndex::lyxCode() const
+InsetBase::Code InsetPrintIndex::lyxCode() const
 {
-       return Inset::INDEX_PRINT_CODE;
+       return InsetBase::INDEX_PRINT_CODE;
 }
+
+
+} // namespace lyx