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
|
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2006-12-02 16:07:15 +00:00
|
|
|
|
namespace support { class FileName; }
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
2003-06-20 12:46:28 +00:00
|
|
|
|
class Buffer;
|
2004-12-27 16:30:27 +00:00
|
|
|
|
class DocIterator;
|
2006-04-07 22:16:09 +00:00
|
|
|
|
class ParIterator;
|
2003-06-20 12:46:28 +00:00
|
|
|
|
|
2007-06-19 16:03:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* Checks and loads a LyX file \param filename.
|
|
|
|
|
* \retval the newly created \c Buffer pointer if successful or 0.
|
|
|
|
|
* \retval 0 if the \c Buffer could not be created.
|
|
|
|
|
*/
|
|
|
|
|
Buffer * checkAndLoadLyXFile(support::FileName const & filename);
|
|
|
|
|
|
2007-08-06 04:14:26 +00:00
|
|
|
|
/** Make a new file (buffer) with name \c filename based on a template
|
|
|
|
|
* named \c templatename
|
2003-06-20 12:46:28 +00:00
|
|
|
|
*/
|
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
|
|
|
|
|
2007-12-07 11:57:13 +00:00
|
|
|
|
/** Make a new unnamed file (buffer) based on a template
|
|
|
|
|
* named \c templatename
|
|
|
|
|
*/
|
|
|
|
|
Buffer * newUnnamedFile(std::string const & templatename,
|
|
|
|
|
support::FileName const & path);
|
|
|
|
|
|
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);
|
|
|
|
|
|
2008-01-08 15:18:00 +00:00
|
|
|
|
/// Count the number of chars in the text between these two iterators
|
|
|
|
|
int countChars(DocIterator const & from, DocIterator const & to, bool with_blanks);
|
|
|
|
|
|
2006-04-16 14:19:25 +00:00
|
|
|
|
/// updates all counters
|
2006-11-13 16:53:49 +00:00
|
|
|
|
void updateLabels(Buffer const &, bool childonly = false);
|
2004-12-27 16:30:27 +00:00
|
|
|
|
|
2007-08-12 21:43:58 +00:00
|
|
|
|
///
|
|
|
|
|
void updateLabels(Buffer const &, ParIterator &);
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2003-06-24 20:42:15 +00:00
|
|
|
|
#endif // BUFFER_FUNCS_H
|