]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.h
PrefLanguageUi.ui: this string was forgotten in r39449
[lyx.git] / src / TextClass.h
index 52074751bd2aeeea5a9c1d8868df8c3be3f1757f..c1e99e950ac16365e17eb464d41934cabd917eec 100644 (file)
@@ -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
@@ -306,6 +310,8 @@ protected:
        int max_toclevel_;
        /// Citation formatting information
        std::map<std::string, std::string> cite_formats_;
+       /// Citation macros
+       std::map<std::string, std::string> cite_macros_;
 private:
        ///////////////////////////////////////////////////////////////////
        // helper routines for reading layout files
@@ -329,7 +335,7 @@ private:
        ///
        void readCharStyle(Lexer &, std::string const &);
        ///
-       void readFloat(Lexer &);
+       bool readFloat(Lexer &);
        ///
        void readCiteFormat(Lexer &);
 };
@@ -371,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
@@ -429,6 +436,8 @@ public:
        bool hasTocLevels() const;
        ///
        std::string const & getCiteFormat(std::string const & entry_type) const;
+       ///
+       std::string const & getCiteMacro(std::string const & macro) const;
 protected:
        /// Constructs a DocumentClass based upon a LayoutFile.
        DocumentClass(LayoutFile const & tc);
@@ -476,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