X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextClass.h;h=c1e99e950ac16365e17eb464d41934cabd917eec;hb=1db7ad00fe02ca4ebba56a5e02c2b9856dc538db;hp=fe68ceae78a8286c9d886b3f53799071cbe257a7;hpb=287612cfba4c749decf848f585300c826e2217e6;p=lyx.git diff --git a/src/TextClass.h b/src/TextClass.h index fe68ceae78..c1e99e950a 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -153,19 +153,23 @@ public: /// return values for read() enum ReturnValues { OK, + OK_OLDFORMAT, ERROR, FORMAT_MISMATCH }; /// Performs the read of the layout file. /// \return true on success. + // FIXME Should return ReturnValues.... bool read(support::FileName const & filename, ReadType rt = BASECLASS); /// - bool read(std::string const & str, ReadType rt = BASECLASS); + ReturnValues read(std::string const & str, ReadType rt = MODULE); /// ReturnValues read(Lexer & lex, ReadType rt = BASECLASS); /// validates the layout information passed in str - static bool validate(std::string const & str); + static ReturnValues validate(std::string const & str); + /// + static std::string convert(std::string const & str); /////////////////////////////////////////////////////////////////// // loading @@ -373,7 +377,8 @@ public: /// a plain inset layout for use as a default static InsetLayout const & plainInsetLayout() { return plain_insetlayout_; } /// add a new layout \c name if it does not exist in layoutlist_ - void addLayoutIfNeeded(docstring const & name) const; + /// \return whether we had to add one. + bool addLayoutIfNeeded(docstring const & name) const; /////////////////////////////////////////////////////////////////// // accessors @@ -480,6 +485,9 @@ private: /// convert page sides option to text 1 or 2 std::ostream & operator<<(std::ostream & os, PageSides p); +/// current format of layout files +extern int const LAYOUT_FORMAT; + } // namespace lyx