+ /// Get the LayoutFile this document is using.
+ LayoutFile const * baseClass() const;
+ ///
+ LayoutFileIndex const & baseClassID() const;
+ /// Set the LyX layout file this document is using.
+ /// NOTE: This does not call makeDocumentClass() to update the local
+ /// DocumentClass. That needs to be done manually.
+ /// \param classname: the name of the layout file
+ /// \param path: non-empty only for local layout files
+ bool setBaseClass(std::string const & classname,
+ std::string const & path = std::string());
+ /// Adds the module information to the baseClass information to
+ /// create our local DocumentClass.
+ /// NOTE: This should NEVER be called externally unless one immediately goes
+ /// on to class BufferView::updateDocumentClass(). The exception, of course,
+ /// is in GuiDocument, where we use a BufferParams simply to hold a copy of
+ /// the parameters from the active Buffer.
+ void makeDocumentClass(bool const clone = false);
+ /// Returns the DocumentClass currently in use: the BaseClass as modified
+ /// by modules.
+ DocumentClass const & documentClass() const;
+ /// \return A pointer to the DocumentClass currently in use: the BaseClass
+ /// as modified by modules.
+ DocumentClassConstPtr documentClassPtr() const;
+ /// This bypasses the baseClass and sets the textClass directly.
+ /// Should be called with care and would be better not being here,
+ /// but it seems to be needed by CutAndPaste::putClipboard().
+ void setDocumentClass(DocumentClassConstPtr);
+ /// List of modules in use
+ LayoutModuleList const & getModules() const { return layout_modules_; }
+ /// List of default modules the user has removed
+ std::list<std::string> const & getRemovedModules() const
+ { return removed_modules_; }
+ ///
+ /// Add a module to the list of modules in use. This checks only that the
+ /// module is not already in the list, so use layoutModuleCanBeAdeed 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 layoutModuleCanBeAdded(std::string const & modName) const;
+ ///
+ void addRemovedModule(std::string const & modName)
+ { removed_modules_.push_back(modName); }
+ /// Clear the list
+ void clearLayoutModules() { layout_modules_.clear(); }
+ /// Clear the removed module list
+ void clearRemovedModules() { removed_modules_.clear(); }
+ /// Get the local layouts
+ docstring getLocalLayout(bool forced) const;
+ /// Set the local layouts
+ void setLocalLayout(docstring const & layout, bool forced);
+
+ /// returns \c true if the buffer contains a LaTeX document
+ bool isLatex() const;
+ /// returns \c true if the buffer contains a DocBook document
+ bool isDocBook() const;
+ /// returns \c true if the buffer contains a Wed document
+ bool isLiterate() const;
+
+ /// return the format of the buffer on a string
+ std::string bufferFormat() const;
+ /// return the default output format of the current backend
+ std::string getDefaultOutputFormat() const;
+ /// return the output flavor of \p format or the default
+ OutputParams::FLAVOR getOutputFlavor(
+ std::string const & format = std::string()) const;
+ ///
+ bool isExportable(std::string const & format, bool need_viewable) const;
+ ///
+ std::vector<const Format *> const & exportableFormats(bool only_viewable) const;
+ /// the backends appropriate for use with this document.
+ /// so, e.g., latex is excluded , if we're using non-TeX fonts
+ std::vector<std::string> backends() const;
+
+ /// List of included children (for includeonly)
+ std::list<std::string> const & getIncludedChildren() const
+ { return included_children_; }
+ ///
+ void addIncludedChildren(std::string const & child)
+ { included_children_.push_back(child); }
+ /// Clear the list of included children
+ void clearIncludedChildren() { included_children_.clear(); }
+
+ /// update aux files of unincluded children (with \includeonly)
+ bool maintain_unincluded_children;