#include "OutputEnums.h"
#include "OutputParams.h"
-#include "insets/InsetCode.h"
-
#include "support/strfwd.h"
#include "support/types.h"
* minimal, probably not.
* \author Lars Gullik Bjønnes
*/
+
+class MarkAsExporting;
+
class Buffer {
public:
/// What type of log will \c getLogName() return?
/// Replace the inset contents for insets which InsetCode is equal
/// to the passed \p inset_code.
- void changeRefsIfUnique(docstring const & from, docstring const & to,
- InsetCode code);
+ void changeRefsIfUnique(docstring const & from, docstring const & to);
/// get source code (latex/docbook) for some paragraphs, or all paragraphs
/// including preamble
int charCount(bool with_blanks) const;
private:
- class MarkAsExporting;
friend class MarkAsExporting;
/// mark the buffer as busy exporting something, or not
void setExportStatus(bool e) const;
};
+/// Helper class, to guarantee that the export status
+/// gets reset properly. To use, simply create a local variable:
+/// MarkAsExporting mex(bufptr);
+/// and leave the rest to us.
+class MarkAsExporting {
+public:
+ MarkAsExporting(Buffer const * buf) : buf_(buf)
+ {
+ buf_->setExportStatus(true);
+ }
+ ~MarkAsExporting()
+ {
+ buf_->setExportStatus(false);
+ }
+private:
+ Buffer const * const buf_;
+};
+
+
} // namespace lyx
#endif