#include "insets/InsetCode.h"
#include "support/FileName.h"
-#include "support/docstring.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
#include "support/types.h"
-#include <iosfwd>
#include <string>
-#include <utility>
#include <vector>
class FuncRequest;
class Inset;
class Font;
+class Format;
class Lexer;
class LyXRC;
class Text;
class Language;
class MacroData;
class OutputParams;
+class Paragraph;
class ParConstIterator;
class ParIterator;
class ParagraphList;
/// Write file. Returns \c false if unsuccesful.
bool writeFile(support::FileName const &) const;
+ /// Loads LyX file \c filename into buffer, * and \return success
+ bool loadLyXFile(support::FileName const & s);
+
+ /// Fill in the ErrorList with the TeXErrors
+ void bufferErrors(TeXErrors const &, ErrorList &) const;
+
/// Just a wrapper for writeLaTeXSource, first creating the ofstream.
bool makeLaTeXFile(support::FileName const & filename,
std::string const & original_path,
/// Mark this buffer as dirty.
void markDirty();
+ /// Returns the buffer's filename. It is always an absolute path.
+ support::FileName fileName() const;
+
/// Returns the buffer's filename. It is always an absolute path.
std::string absFileName() const;
std::string latexName(bool no_path = true) const;
/// Get thee name and type of the log.
- std::pair<LogType, std::string> logName() const;
+ std::string logName(LogType * type = 0) const;
/// Change name of buffer. Updates "read-only" flag.
void setFileName(std::string const & newfile);
//
// Macro handling
//
- ///
- void buildMacros();
- ///
+ /// Collect macros in paragraphs
+ void updateMacros();
+ /// Look for macro defined before par (or in the master buffer)
+ bool hasMacro(docstring const & name, Paragraph const & par) const;
+ /// Look for macro defined anywhere in the buffer (or in the master buffer)
bool hasMacro(docstring const & name) const;
- ///
+ /// Return macro defined before par (or in the master buffer)
+ MacroData const & getMacro(docstring const & name, Paragraph const & par) const;
+ /// Return macro defined anywhere in the buffer (or in the master buffer)
MacroData const & getMacro(docstring const & name) const;
- ///
- void insertMacro(docstring const & name, MacroData const & data);
/// Replace the inset contents for insets which InsetCode is equal
/// to the passed \p inset_code.
void changed() const;
/// This function is called when the buffer structure is changed.
void structureChanged() const;
- /// This function is called when an embedded file is changed
- void embeddingChanged() const;
/// This function is called when some parsing error shows up.
void errors(std::string const & err) const;
/// This function is called when the buffer busy status change.
- void busy(bool on) const;
+ void setBusy(bool on) const;
/// This function is called when the buffer readonly status change.
- void readonly(bool on) const;
+ void setReadOnly(bool on) const;
/// Update window titles of all users.
void updateTitles() const;
/// Reset autosave timers for all users.
/// return the format of the buffer on a string
std::string bufferFormat() const;
+ ///
+ bool doExport(std::string const & format, bool put_in_tempdir,
+ std::string & result_file);
+ ///
+ bool doExport(std::string const & format, bool put_in_tempdir);
+ ///
+ bool preview(std::string const & format);
+ ///
+ bool isExportable(std::string const & format) const;
+ ///
+ std::vector<Format const *> exportableFormats(bool only_viewable) const;
+
private:
+ ///
+ bool readFileHelper(support::FileName const & s);
+ ///
+ std::vector<std::string> backends() const;
/** Inserts a file into a document
\return \c false if method fails.
*/