]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.h
Improve handling of top and bottom margin
[lyx.git] / src / insets / InsetTOC.h
index 9ba7cf06f3de98d527014932d087ed8c725ef435..4b92e329a2ec95f86d91f146f05e0122b0e875e7 100644 (file)
 
 #include "InsetCommand.h"
 
+#include "Toc.h"
+
 
 namespace lyx {
 
+class Paragraph;
 
 /// Used to insert table of contents and similar lists
-/// at present, supports only \tableofcontents. Other
-/// such commands, such as \listoffigures, are supported
+/// at present, supports only \tableofcontents and \listoflistings.
+/// Other such commands, such as \listoffigures, are supported
 /// by InsetFloatList.
 class InsetTOC : public InsetCommand {
 public:
@@ -32,17 +35,22 @@ public:
        ///
        InsetCode lyxCode() const { return TOC_CODE; }
        ///
-       DisplayType display() const { return AlignCenter; }
+       docstring layoutName() const;
+       ///
+       RowFlags rowFlags() const { return Display; }
        ///
-       int plaintext(odocstream &, OutputParams const &) const;
+       virtual void validate(LaTeXFeatures &) const;
        ///
-       int docbook(odocstream &, OutputParams const &) const;
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const;
        ///
-       docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
+       void docbook(XMLStream &, OutputParams const &) const;
+       ///
+       docstring xhtml(XMLStream & xs, OutputParams const &) const;
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       bool clickable(int, int) const { return true; }
+       bool clickable(BufferView const &, int, int) const { return true; }
        //@}
 
        /// \name Static public methods obligated for InsetCommand derived classes
@@ -52,11 +60,17 @@ public:
        ///
        static std::string defaultCommand() { return "tableofcontents"; }
        ///
-       static bool isCompatibleCommand(std::string const & cmd)
-               { return cmd == defaultCommand(); }
+       static bool isCompatibleCommand(std::string const & cmd);
        //@}
 
 private:
+       ///
+       void makeTOCWithDepth(XMLStream & xs, Toc const & toc, const OutputParams & op) const;
+       ///
+       void makeTOCNoDepth(XMLStream & xs, Toc const & toc, const OutputParams & op) const;
+       ///
+       void makeTOCEntry(XMLStream & xs, Paragraph const & par, OutputParams const & op) const;
+
        /// \name Private functions inherited from Inset class
        //@{
        ///