]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetIndex.h
Cleanup mouse/selection/context-menu interactions.
[lyx.git] / src / insets / InsetIndex.h
index cca959a106612e9df34f219f8ed18cade68140ce..5fd73ad43488ab7e3a5e5054d0624483eaae74e8 100644 (file)
 #define INSET_INDEX_H
 
 
+#include "InsetCollapsable.h"
 #include "InsetCommand.h"
 
 
 namespace lyx {
 
-class LaTeXFeatures;
-
 /** Used to insert index labels
   */
-class InsetIndex : public InsetCommand {
+class InsetIndex : public InsetCollapsable {
 public:
        ///
-       InsetIndex(InsetCommandParams const &);
-       ///
-       docstring const getScreenLabel(Buffer const &) const;
+       InsetIndex(Buffer const &);
+private:
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       Inset::Code lyxCode() const;
+       InsetCode lyxCode() const { return INDEX_CODE; }
        ///
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
-private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetIndex(params()));
-       }
+       docstring name() const { return from_ascii("Index"); }
+       ///
+       void write(std::ostream & os) const;
+       ///
+       int docbook(odocstream &, OutputParams const &) const;
+       /// should paragraph indendation be omitted in any case?
+       bool neverIndent() const { return true; }
+       ///
+       void addToToc(ParConstIterator const &) const;
+       ///
+       Inset * clone() const { return new InsetIndex(*this); }
 };
 
 
@@ -46,20 +49,27 @@ class InsetPrintIndex : public InsetCommand {
 public:
        ///
        InsetPrintIndex(InsetCommandParams const &);
+
+       ///
+       static ParamInfo const & findInfo(std::string const &);
+       ///
+       static std::string defaultCommand() { return "printindex"; };
+       ///
+       static bool isCompatibleCommand(std::string const & s) 
+               { return s == "printindex"; }
+private:
        /// Updates needed features for this inset.
        void validate(LaTeXFeatures & features) const;
        ///
        EDITABLE editable() const { return NOT_EDITABLE; }
        ///
-       Inset::Code lyxCode() const;
+       InsetCode lyxCode() const;
        ///
        DisplayType display() const { return AlignCenter; }
        ///
-       docstring const getScreenLabel(Buffer const &) const;
-private:
-       virtual std::auto_ptr<Inset> doClone() const {
-               return std::auto_ptr<Inset>(new InsetPrintIndex(params()));
-       }
+       docstring screenLabel() const;
+       ///
+       Inset * clone() const { return new InsetPrintIndex(*this); }
 };