lyx_mirror/src/buffer_funcs.h

69 lines
1.7 KiB
C
Raw Normal View History

// -*- C++ -*-
/* \file buffer_funcs.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Lars Gullik Bj<EFBFBD>nnes
* \author Alfredo Braunstein
*
* Full author contact details are available in file CREDITS.
*/
#ifndef BUFFER_FUNCS_H
#define BUFFER_FUNCS_H
#include "lyxlayout_ptr_fwd.h"
#include <string>
class Buffer;
class DocIterator;
class ErrorList;
class TeXErrors;
class ParIterator;
/**
* Loads a LyX file \c filename into \c Buffer
* and \return success status.
*/
bool loadLyXFile(Buffer *, std::string const & filename);
/* Make a new file (buffer) with name \c filename based on a template
* named \c templatename
*/
Buffer * newFile(std::string const & filename, std::string const & templatename,
bool isNamed = false);
///return the format of the buffer on a string
std::string const bufferFormat(Buffer const & buffer);
This commit creates a error_lists map member inside the Buffer class. I had no choice but to use string for the map key. This is because the only information that could be passed to the controller is a string. With this new architecture, persistent error lists are now possible. * Buffer - errorList_, addError(), : deleted - std::map<std::string, ErrorList> errorLists_ : new member - errorList(std::string const & type): associated accessors * buffer_funcs.C - bufferErrors(Buffer const & buf, TeXErrors const & terr): now needs a third errorList argument - bufferErrors(Buffer const & buf, ErrorList const & el): deleted. * Converter - convert(): now needs an ErrorList argument instead of filling the Buffer errorList member directly. - runLaTeX(): ditto - scanLog(): ditto * CutAndPaste.C - pasteParagraphList(): ditto - pasteSelection(): ditto * lyxtext.h/text.C - readParagraph(): ditto - LyXText::read(): ditto * importer: - Importer::Import(): ditto * BufferView_pimpl.C - loadLyXFile(): send the Buffer::errors() signal instead of calling LyXView::showErrorList() directly. * exporter.C - Export(): send the Buffer::errors() signal instead of calling LyXView::showErrorList() directly in lyxfunc.C * ControlErrorList.C - initialiseParams(): translation operation transfered here from LyXView::showErrorList(). * LyXView.C - LoadLyXFile(): add a showErrorList("Parse") call. - showErrorList(): simplified due to code transferred to the ControlErrorList. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14652 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-13 16:16:43 +00:00
/// Fill in the ErrorList with the TeXErrors
void bufferErrors(Buffer const &, TeXErrors const &, ErrorList &);
/// Count the number of words in the text between these two iterators
int countWords(DocIterator const & from, DocIterator const & to);
/// Expand the counters for the labelstring of \c layout
std::string expandLabel(Buffer const & buf, LyXLayout_ptr const & layout,
bool appendix);
/// update labels at "iter".
/**
A full updateLabels(Buffer const &) will be called if not possible.
*/
void updateLabels(Buffer const & buf, ParIterator & it);
/// update labels between "from" and "to" if possible.
/**
A full updateLabels(Buffer const &) will be called if not possible.
*/
void updateLabels(Buffer const & buf,
ParIterator & from, ParIterator & to);
/// updates all counters
void updateLabels(Buffer const &);
#endif // BUFFER_FUNCS_H