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
|
|
|
|
|
2003-09-06 23:36:02 +00:00
|
|
|
|
#include "author.h"
|
|
|
|
|
#include "BranchList.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include "Bullet.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "lyxtextclass.h"
|
2003-07-26 23:04:39 +00:00
|
|
|
|
#include "paper.h"
|
2003-09-06 23:36:02 +00:00
|
|
|
|
#include "Spacing.h"
|
|
|
|
|
#include "vspace.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
|
|
|
|
|
2000-10-02 00:55:02 +00:00
|
|
|
|
#include <boost/array.hpp>
|
2003-09-06 23:36:02 +00:00
|
|
|
|
|
|
|
|
|
#include "support/std_string.h"
|
2003-03-12 23:25:59 +00:00
|
|
|
|
#include <vector>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2002-07-21 21:21:06 +00:00
|
|
|
|
class LyXLex;
|
2003-02-16 00:54:43 +00:00
|
|
|
|
class LatexFeatures;
|
|
|
|
|
class TexRow;
|
2000-03-17 10:14:46 +00:00
|
|
|
|
struct Language;
|
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
|
/** Buffer parameters.
|
|
|
|
|
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-03-12 02:39:12 +00:00
|
|
|
|
/// read a header token, if unrecognised, return it or an unknown class name
|
|
|
|
|
string const readToken(LyXLex & lex, string const & token);
|
|
|
|
|
|
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
|
|
|
|
|
the BufferParams and a LyXRC variable).
|
|
|
|
|
This returned value can then be passed to the insets...
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
///
|
2000-02-04 09:38:32 +00:00
|
|
|
|
VSpace const & getDefSkip() const { return defskip; }
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
void setDefSkip(VSpace const & vs) { defskip = vs; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/** Wether paragraphs are separated by using a indent like in
|
|
|
|
|
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
|
|
|
|
///
|
2002-03-21 17:27:08 +00:00
|
|
|
|
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;
|
|
|
|
|
///
|
|
|
|
|
string paperwidth;
|
|
|
|
|
///
|
|
|
|
|
string paperheight;
|
|
|
|
|
///
|
|
|
|
|
string leftmargin;
|
|
|
|
|
///
|
|
|
|
|
string topmargin;
|
|
|
|
|
///
|
|
|
|
|
string rightmargin;
|
|
|
|
|
///
|
|
|
|
|
string bottommargin;
|
|
|
|
|
///
|
|
|
|
|
string headheight;
|
|
|
|
|
///
|
|
|
|
|
string headsep;
|
|
|
|
|
///
|
|
|
|
|
string footskip;
|
|
|
|
|
|
|
|
|
|
/* some LaTeX options */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// The graphics driver
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string graphicsDriver;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string fonts;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
|
|
|
|
Spacing spacing;
|
|
|
|
|
///
|
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:
|
|
|
|
|
BranchList branchlist;
|
2000-03-17 10:14:46 +00:00
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string inputenc;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string preamble;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string options;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
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
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
|
string pagestyle;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
|
boost::array<Bullet, 4> temp_bullets;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
|
boost::array<Bullet, 4> user_defined_bullets;
|
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]
|
2001-11-29 17:12:21 +00:00
|
|
|
|
string parentname;
|
2003-07-28 14:40:29 +00:00
|
|
|
|
///
|
|
|
|
|
bool compressed;
|
2003-03-12 02:39:12 +00:00
|
|
|
|
|
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
|
|
|
|
///
|
|
|
|
|
string const dvips_options() const;
|
|
|
|
|
///
|
|
|
|
|
string const paperSizeName() const;
|
2003-03-12 23:25:59 +00:00
|
|
|
|
|
2003-03-12 11:52:23 +00:00
|
|
|
|
private:
|
2003-03-12 02:39:12 +00:00
|
|
|
|
/// the author list
|
|
|
|
|
AuthorList authorlist;
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
|
|
|
|
friend class Buffer;
|
|
|
|
|
/** This is the amount of space used for paragraph_separation "skip",
|
2000-08-07 20:58:24 +00:00
|
|
|
|
and for detached paragraphs in "indented" documents.
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
VSpace defskip;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|