]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.h
EmbeddedObjects.lyx, Math.lyx, UserGuide.lyx: Spanish translation updates by Ignacio
[lyx.git] / src / BufferParams.h
index fbc5a7b92515ad63ba17637de7d8a4f76ca4c6d2..5e6fccd82bf709c204668c1932c0849141dc5241 100644 (file)
@@ -4,10 +4,10 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  * \author John Levon
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -23,6 +23,7 @@
 
 #include "support/copied_ptr.h"
 
+#include <list>
 #include <set>
 #include <vector>
 
@@ -53,7 +54,7 @@ class VSpace;
 class BufferParams {
 public:
        ///
-       typedef std::vector<std::string> LayoutModuleList;
+       typedef std::list<std::string> LayoutModuleList;
        ///
        enum ParagraphSeparation {
                ///
@@ -132,13 +133,14 @@ public:
        std::set<std::string> const & getRemovedModules() const 
                        { return removedModules_; }
        ///
-       /// Add a module to the list of modules in use.
-       /// Returns true if module was successfully added.
-       /// The makeClass variable signals whether to call makeDocumentClass. This
-       /// need not be done if we know this isn't the final time through, or if
-       /// the BufferParams do not represent the parameters for an actual buffer
-       /// (as in GuiDocument).
+       /// Add a module to the list of modules in use. This checks only that the
+       /// module is not already in the list, so use moduleIsCompatible first if
+       /// you want to check for compatibility.
+       /// \return true if module was successfully added.
        bool addLayoutModule(std::string const & modName);
+       /// checks to make sure module's requriements are satisfied, that it does
+       /// not conflict with already-present modules, isn't already loaded, etc.
+       bool moduleCanBeAdded(std::string const & modName) const;
        ///
        void addRemovedModule(std::string const & modName) 
                        { removedModules_.insert(modName); }
@@ -236,6 +238,8 @@ public:
        std::string local_layout;
        ///
        std::string options;
+       /// use the class options defined in the layout?
+       bool use_default_options;
        ///
        std::string master;
        ///
@@ -341,6 +345,19 @@ private:
        void readModules(Lexer &);
        ///
        void readRemovedModules(Lexer &);
+       /// Called when the document class changes. Removes modules
+       /// excluded by, provided by, etc, the document class.
+       /// \return true if modules were consistent, false if changes had
+       /// to be made.
+       bool removeBadModules();
+       /// Adds default modules, if they're addable.
+       void addDefaultModules();
+       /// checks for consistency among modules: makes sure requirements
+       /// are met, no modules exclude one another, etc, and resolves any
+       /// such conflicts, leaving us with a consistent collection.
+       /// \return true if modules were consistent, false if changes had
+       /// to be made.
+       bool checkModuleConsistency();
 
        /// for use with natbib
        CiteEngine cite_engine_;