1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file bufferparams.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
|
#ifndef BUFFERPARAMS_H
|
|
|
|
|
#define BUFFERPARAMS_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "lyxtextclass.h"
|
2003-07-26 23:04:39 +00:00
|
|
|
|
#include "paper.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include "insets/insetquotes.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
2003-09-15 20:23:57 +00:00
|
|
|
|
#include "support/copied_ptr.h"
|
2003-09-07 01:45:40 +00:00
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
2003-03-12 23:25:59 +00:00
|
|
|
|
#include <vector>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-09-09 17:00:19 +00:00
|
|
|
|
|
|
|
|
|
class AuthorList;
|
|
|
|
|
class BranchList;
|
|
|
|
|
class Bullet;
|
2002-07-21 21:21:06 +00:00
|
|
|
|
class LyXLex;
|
2003-02-16 00:54:43 +00:00
|
|
|
|
class LatexFeatures;
|
2003-09-09 17:00:19 +00:00
|
|
|
|
class Spacing;
|
2003-02-16 00:54:43 +00:00
|
|
|
|
class TexRow;
|
2003-09-09 17:00:19 +00:00
|
|
|
|
class VSpace;
|
2000-03-17 10:14:46 +00:00
|
|
|
|
struct Language;
|
|
|
|
|
|
2003-09-09 17:00:19 +00:00
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
|
/** Buffer parameters.
|
2003-09-15 20:23:57 +00:00
|
|
|
|
* This class contains all the parameters for this a buffer uses. Some
|
|
|
|
|
* work needs to be done on this class to make it nice. Now everything
|
|
|
|
|
* is in public.
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
class BufferParams {
|
|
|
|
|
public:
|
1999-11-15 12:01:38 +00:00
|
|
|
|
///
|
|
|
|
|
enum PARSEP {
|
|
|
|
|
///
|
|
|
|
|
PARSEP_INDENT,
|
|
|
|
|
///
|
|
|
|
|
PARSEP_SKIP
|
|
|
|
|
};
|
|
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
|
BufferParams();
|
2003-09-09 17:00:19 +00:00
|
|
|
|
~BufferParams();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-03-12 02:39:12 +00:00
|
|
|
|
/// read a header token, if unrecognised, return it or an unknown class name
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const readToken(LyXLex & lex, std::string const & token);
|
2003-03-12 02:39:12 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-04-04 00:19:15 +00:00
|
|
|
|
void writeFile(std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-05-22 22:44:30 +00:00
|
|
|
|
/** \returns true if the babel package is used (interogates
|
2003-09-15 20:23:57 +00:00
|
|
|
|
* the BufferParams and a LyXRC variable).
|
|
|
|
|
* This returned value can then be passed to the insets...
|
2003-05-22 22:44:30 +00:00
|
|
|
|
*/
|
|
|
|
|
bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
|
2003-02-16 00:54:43 +00:00
|
|
|
|
|
2001-11-07 10:25:05 +00:00
|
|
|
|
///
|
|
|
|
|
void setPaperStuff();
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
|
|
|
|
void useClassDefaults();
|
|
|
|
|
|
2001-09-17 15:39:58 +00:00
|
|
|
|
///
|
|
|
|
|
bool hasClassDefaults() const;
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
|
VSpace const & getDefSkip() const;
|
2000-02-04 09:38:32 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
|
void setDefSkip(VSpace const & vs);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/** Wether paragraphs are separated by using a indent like in
|
2003-09-15 20:23:57 +00:00
|
|
|
|
* articles or by using a little skip like in letters.
|
|
|
|
|
*/
|
2002-03-21 17:27:08 +00:00
|
|
|
|
PARSEP paragraph_separation;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-11-29 17:12:21 +00:00
|
|
|
|
InsetQuotes::quote_language quotes_language;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-11-29 17:12:21 +00:00
|
|
|
|
InsetQuotes::quote_times quotes_times;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string fontsize;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2002-03-21 17:27:08 +00:00
|
|
|
|
lyx::textclass_type textclass;
|
2002-07-21 21:21:06 +00:00
|
|
|
|
///
|
|
|
|
|
LyXTextClass const & getLyXTextClass() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/* this are for the PaperLayout */
|
2000-08-07 20:58:24 +00:00
|
|
|
|
/// the general papersize (papersize2 or paperpackage
|
2003-06-10 14:39:45 +00:00
|
|
|
|
PAPER_SIZE papersize;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
/// the selected Geometry papersize
|
2003-06-10 14:39:45 +00:00
|
|
|
|
VMARGIN_PAPER_TYPE papersize2;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
/// a special paperpackage .sty-file
|
2003-06-10 14:39:45 +00:00
|
|
|
|
PAPER_PACKAGES paperpackage;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-06-10 14:39:45 +00:00
|
|
|
|
PAPER_ORIENTATION orientation;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-11-29 17:12:21 +00:00
|
|
|
|
bool use_geometry;
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string paperwidth;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string paperheight;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string leftmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string topmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string rightmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string bottommargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string headheight;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string headsep;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string footskip;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
|
|
|
|
|
/* some LaTeX options */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// The graphics driver
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string graphicsDriver;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string fonts;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
|
Spacing & spacing();
|
|
|
|
|
Spacing const & spacing() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
|
int secnumdepth;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
|
int tocdepth;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-10-10 12:36:36 +00:00
|
|
|
|
Language const * language;
|
2003-08-17 11:28:23 +00:00
|
|
|
|
/// BranchList:
|
2003-09-09 17:00:19 +00:00
|
|
|
|
BranchList & branchlist();
|
|
|
|
|
BranchList const & branchlist() const;
|
2000-03-17 10:14:46 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string inputenc;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string preamble;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string options;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string float_placement;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
|
unsigned int columns;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
|
LyXTextClass::PageSides sides;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string pagestyle;
|
2003-09-09 17:00:19 +00:00
|
|
|
|
/// \param index should lie in the range 0 <= \c index <= 3.
|
|
|
|
|
Bullet & temp_bullet(lyx::size_type index);
|
|
|
|
|
Bullet const & temp_bullet(lyx::size_type index) const;
|
|
|
|
|
/// \param index should lie in the range 0 <= \c index <= 3.
|
|
|
|
|
Bullet & user_defined_bullet(lyx::size_type index);
|
|
|
|
|
Bullet const & user_defined_bullet(lyx::size_type index) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
|
void readPreamble(LyXLex &);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
|
void readLanguage(LyXLex &);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
|
void readGraphicsDriver(LyXLex &);
|
2003-03-06 11:07:55 +00:00
|
|
|
|
|
|
|
|
|
/// use AMS package, not, or auto
|
|
|
|
|
enum AMS {
|
|
|
|
|
AMS_OFF,
|
|
|
|
|
AMS_AUTO,
|
|
|
|
|
AMS_ON
|
|
|
|
|
};
|
|
|
|
|
AMS use_amsmath;
|
2001-07-19 14:12:37 +00:00
|
|
|
|
///
|
2001-11-29 17:12:21 +00:00
|
|
|
|
bool use_natbib;
|
2001-07-19 14:12:37 +00:00
|
|
|
|
///
|
2001-11-29 17:12:21 +00:00
|
|
|
|
bool use_numerical_citations;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// revision tracking for this buffer ?
|
|
|
|
|
bool tracking_changes;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// Time ago we agreed that this was a buffer property [ale990407]
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string parentname;
|
2003-07-28 14:40:29 +00:00
|
|
|
|
///
|
|
|
|
|
bool compressed;
|
2003-03-12 02:39:12 +00:00
|
|
|
|
|
2003-09-09 17:00:19 +00:00
|
|
|
|
/// the author list for the document
|
|
|
|
|
AuthorList & authors();
|
|
|
|
|
AuthorList const & authors() const;
|
|
|
|
|
|
2003-03-12 23:25:59 +00:00
|
|
|
|
/// map of the file's author IDs to buffer author IDs
|
|
|
|
|
std::vector<int> author_map;
|
2003-07-17 08:23:33 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const dvips_options() const;
|
2003-07-17 08:23:33 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const paperSizeName() const;
|
2003-03-12 23:25:59 +00:00
|
|
|
|
|
2003-03-12 11:52:23 +00:00
|
|
|
|
private:
|
2003-09-09 17:00:19 +00:00
|
|
|
|
/** Use the Pimpl idiom to hide those member variables that would otherwise
|
2003-09-15 20:23:57 +00:00
|
|
|
|
* drag in other header files.
|
2003-09-09 17:00:19 +00:00
|
|
|
|
*/
|
|
|
|
|
class Impl;
|
2003-09-15 20:23:57 +00:00
|
|
|
|
struct MemoryTraits {
|
|
|
|
|
static Impl * clone(Impl const *);
|
|
|
|
|
static void destroy(Impl *);
|
|
|
|
|
};
|
|
|
|
|
lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|