2003-06-20 12:46:28 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/* \file buffer_funcs.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2003-06-20 12:46:28 +00:00
|
|
|
|
* \author Alfredo Braunstein
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-06-20 12:46:28 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-06-24 20:42:15 +00:00
|
|
|
|
#ifndef BUFFER_FUNCS_H
|
|
|
|
|
#define BUFFER_FUNCS_H
|
|
|
|
|
|
2005-02-25 11:55:36 +00:00
|
|
|
|
#include "lyxlayout_ptr_fwd.h"
|
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
2003-06-20 12:46:28 +00:00
|
|
|
|
|
|
|
|
|
class Buffer;
|
2004-12-27 16:30:27 +00:00
|
|
|
|
class DocIterator;
|
2003-06-24 20:42:15 +00:00
|
|
|
|
class ErrorList;
|
2004-12-27 16:30:27 +00:00
|
|
|
|
class TeXErrors;
|
2003-06-20 12:46:28 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2003-09-09 18:27:24 +00:00
|
|
|
|
* Loads a LyX file \c filename into \c Buffer
|
2003-06-20 12:46:28 +00:00
|
|
|
|
* and \return success status.
|
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
|
bool loadLyXFile(Buffer *, std::string const & filename);
|
2003-06-20 12:46:28 +00:00
|
|
|
|
|
|
|
|
|
/* Make a new file (buffer) with name \c filename based on a template
|
|
|
|
|
* named \c templatename
|
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
|
Buffer * newFile(std::string const & filename, std::string const & templatename,
|
2003-06-20 12:46:28 +00:00
|
|
|
|
bool isNamed = false);
|
2003-06-24 20:42:15 +00:00
|
|
|
|
|
|
|
|
|
///return the format of the buffer on a string
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const BufferFormat(Buffer const & buffer);
|
2003-07-17 08:23:33 +00:00
|
|
|
|
///
|
2003-07-07 08:37:02 +00:00
|
|
|
|
void bufferErrors(Buffer const &, TeXErrors const &);
|
2003-07-17 08:23:33 +00:00
|
|
|
|
///
|
2003-07-07 08:37:02 +00:00
|
|
|
|
void bufferErrors(Buffer const &, ErrorList const &);
|
2003-06-24 20:42:15 +00:00
|
|
|
|
|
2004-12-27 16:30:27 +00:00
|
|
|
|
/// Count the number of words in the text between these two iterators
|
|
|
|
|
int countWords(DocIterator const & from, DocIterator const & to);
|
|
|
|
|
|
2005-02-25 11:55:36 +00:00
|
|
|
|
/// Expand the counters for the labelstring of \c layout
|
2005-06-09 09:58:08 +00:00
|
|
|
|
std::string expandLabel(Buffer const & buf, LyXLayout_ptr const & layout,
|
2005-05-20 09:13:42 +00:00
|
|
|
|
bool appendix);
|
2005-02-25 11:55:36 +00:00
|
|
|
|
|
|
|
|
|
/// updates all counters
|
|
|
|
|
void updateCounters(Buffer const &);
|
|
|
|
|
|
2004-12-27 16:30:27 +00:00
|
|
|
|
|
2003-06-24 20:42:15 +00:00
|
|
|
|
#endif // BUFFER_FUNCS_H
|