]> 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 29d2aa4b80da2073afde0609909a099ea8051fcc..c175cf1ffd14cb5e05d7aafff22049ef7542ac57 100644 (file)
@@ -5,72 +5,72 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 #include <config.h>
 
-
 #include "insetindex.h"
-#include "BufferView.h"
-#include "frontends/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"
 
-using std::ostream;
+#include "support/std_ostream.h"
 
-InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
-       : InsetCommand(p)
-{}
 
+namespace lyx {
 
-InsetIndex::~InsetIndex()
-{
-       InsetCommandMailer mailer("index", *this);
-       mailer.hideDialog();
-}
+using std::string;
+using std::ostream;
 
 
-string const InsetIndex::getScreenLabel(Buffer const *) const
-{
-       return _("Idx");
-}
+InsetIndex::InsetIndex(InsetCommandParams const & p)
+       : InsetCommand(p, "index")
+{}
 
 
-void InsetIndex::edit(BufferView *, int, int, mouse_button::state)
-{
-       InsetCommandMailer mailer("index", *this);
-       mailer.showDialog();
-}
+// InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
 
 
-void InsetIndex::edit(BufferView * bv, bool)
+docstring const InsetIndex::getScreenLabel(Buffer const &) const
 {
-       edit(bv, 0, 0, mouse_button::none);
+       return _("Idx");
 }
 
 
-int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
+int InsetIndex::docbook(Buffer const &, odocstream & os,
+                       OutputParams const &) const
 {
-       os << "<indexterm><primary>" << getContents()
+       os << "<indexterm><primary>"
+           << sgml::escapeString(getParam("name"))
           << "</primary></indexterm>";
        return 0;
 }
 
 
-Inset::Code InsetIndex::lyxCode() const
+InsetBase::Code InsetIndex::lyxCode() const
 {
-       return Inset::INDEX_CODE;
+       return InsetBase::INDEX_CODE;
 }
 
 
-InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
-       : InsetCommand(p)
+
+InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
+       : InsetCommand(p, string())
 {}
 
 
-string const InsetPrintIndex::getScreenLabel(Buffer const *) const
+// InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
+
+
+docstring const InsetPrintIndex::getScreenLabel(Buffer const &) const
 {
        return _("Index");
 }
@@ -82,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