]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetindex.C
move inset related stuff from src/graphics to src/inset/
[lyx.git] / src / insets / insetindex.C
index 18d79e5551f9f260780321e2536dd7ecd3464260..1e5e2c6de32d8f2183ed240ba90bb989dc00eb19 100644 (file)
@@ -6,33 +6,57 @@
 
 #include "insetindex.h"
 #include "BufferView.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
 #include "LaTeXFeatures.h"
 #include "gettext.h"
+#include "support/LOstream.h"
 
-InsetIndex::InsetIndex(InsetCommandParams const & p)
+using std::ostream;
+
+InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
 
 
-string const InsetIndex::getScreenLabel() const
+string const InsetIndex::getScreenLabel(Buffer const *) const
 {
        return _("Idx");
 }
 
 
-void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
+void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
+{
+       bv->owner()->getDialogs()->showIndex(this);
+}
+
+
+void InsetIndex::edit(BufferView * bv, bool)
+{
+       edit(bv, 0, 0, mouse_button::none);
+}
+
+
+int InsetIndex::docbook(Buffer const *, ostream & os) const
 {
-       bv->owner()->getDialogs()->showIndex( this );
+       os << "<indexterm><primary>" << getContents()
+          << "</primary></indexterm>";
+       return 0;
 }
 
 
-InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
+Inset::Code InsetIndex::lyxCode() const
+{
+       return Inset::INDEX_CODE;
+}
+
+
+InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
 
-string const InsetPrintIndex::getScreenLabel() const
+
+string const InsetPrintIndex::getScreenLabel(Buffer const *) const
 {
        return _("Index");
 }
@@ -40,11 +64,11 @@ string const InsetPrintIndex::getScreenLabel() const
 
 void InsetPrintIndex::validate(LaTeXFeatures & features) const
 {
-       features.makeidx = true;
+       features.require("makeidx");
 }
 
 
 Inset::Code InsetPrintIndex::lyxCode() const
 {
-       return Inset::INDEX_CODE;
+       return Inset::INDEX_PRINT_CODE;
 }