]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.h
* Hartmut's csv2lyx script
[lyx.git] / src / TextClass.h
index 80713d0bda40bde20688e49be2248e72ac38183d..13d2234873af1180318583e63c566d9b05bbdda6 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <boost/noncopyable.hpp>
 
-#include <list>
 #include <map>
 #include <set>
 #include <vector>
@@ -127,11 +126,25 @@ public:
        enum ReadType { 
                BASECLASS, //>This is a base class, i.e., top-level layout file
                MERGE, //>This is a file included in a layout file
-               MODULE //>This is a layout module
+               MODULE, //>This is a layout module
+               VALIDATION //>We're just validating
        };
+       /// return values for read()
+       enum ReturnValues {
+               OK,
+               ERROR,
+               FORMAT_MISMATCH
+       };
+
        /// Performs the read of the layout file.
        /// \return true on success.
        bool read(support::FileName const & filename, ReadType rt = BASECLASS);
+       ///
+       bool read(std::string const & str, ReadType rt = BASECLASS);
+       ///
+       ReturnValues read(Lexer & lex, ReadType rt = BASECLASS);
+       /// validates the layout information passed in str
+       static bool validate(std::string const & str);
 
        ///////////////////////////////////////////////////////////////////
        // loading
@@ -242,6 +255,8 @@ private:
        ///////////////////////////////////////////////////////////////////
        ///
        bool deleteLayout(docstring const &);
+       ///
+       bool convertLayoutFormat(support::FileName const &, ReadType);
        /// \return true for success.
        bool readStyle(Lexer &, Layout &);
        ///
@@ -289,7 +304,6 @@ public:
        /// will invoke the layout object defined by name = 'CharStyle'.
        /// If that doesn't work either, an empty object returns (shouldn't
        /// happen).  -- Idea JMarc, comment MV
-       ///
        InsetLayout const & insetLayout(docstring const & name) const;
        /// an empty inset layout for use as a default
        static InsetLayout const & emptyInsetLayout() { return empty_insetlayout_; }
@@ -298,7 +312,6 @@ public:
        // accessors
        ///////////////////////////////////////////////////////////////////
        /// the list of floats defined in the document class
-       /// the list of floats defined in the document class
        FloatList const & floats() const { return floatlist_; }
        ///
        Counters & counters() const { return counters_; }
@@ -350,7 +363,7 @@ protected:
        /// Constructs a DocumentClass based upon a LayoutFile.
        DocumentClass(LayoutFile const & tc);
        /// Needed in tex2lyx
-       DocumentClass() {};
+       DocumentClass() {}
 private:
        /// The only class that can create a DocumentClass is
        /// DocumentClassBundle, which calls the protected constructor.
@@ -379,8 +392,10 @@ public:
 private:
        /// control instantiation
        DocumentClassBundle() {}
+       /// clean up
+       ~DocumentClassBundle();
        ///
-       std::list<DocumentClass *> tc_list_;
+       std::vector<DocumentClass *> documentClasses_;
 };