1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
2002-03-21 17:27:08 +00:00
|
|
|
* ======================================================
|
|
|
|
*
|
1999-09-27 18:44:28 +00:00
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* ====================================================== */
|
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
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include "vspace.h"
|
|
|
|
#include "Spacing.h"
|
|
|
|
#include "Bullet.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
#include "lyxtextclass.h"
|
2003-02-16 00:54:43 +00:00
|
|
|
#include "LaTeXFeatures.h"
|
|
|
|
#include "texrow.h"
|
2003-03-12 02:39:12 +00:00
|
|
|
#include "author.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-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 PAPER_SIZE {
|
|
|
|
///
|
|
|
|
PAPER_DEFAULT,
|
|
|
|
///
|
|
|
|
PAPER_USLETTER,
|
|
|
|
///
|
|
|
|
PAPER_LEGALPAPER,
|
|
|
|
///
|
|
|
|
PAPER_EXECUTIVEPAPER,
|
|
|
|
///
|
|
|
|
PAPER_A3PAPER,
|
|
|
|
///
|
|
|
|
PAPER_A4PAPER,
|
|
|
|
///
|
|
|
|
PAPER_A5PAPER,
|
|
|
|
///
|
|
|
|
PAPER_B5PAPER
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum PAPER_PACKAGES {
|
|
|
|
///
|
|
|
|
PACKAGE_NONE,
|
|
|
|
///
|
|
|
|
PACKAGE_A4,
|
|
|
|
///
|
|
|
|
PACKAGE_A4WIDE,
|
|
|
|
///
|
|
|
|
PACKAGE_WIDEMARGINSA4
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum VMARGIN_PAPER_TYPE {
|
|
|
|
///
|
|
|
|
VM_PAPER_DEFAULT,
|
|
|
|
///
|
|
|
|
VM_PAPER_CUSTOM,
|
|
|
|
///
|
|
|
|
VM_PAPER_USLETTER,
|
|
|
|
///
|
|
|
|
VM_PAPER_USLEGAL,
|
|
|
|
///
|
|
|
|
VM_PAPER_USEXECUTIVE,
|
|
|
|
///
|
|
|
|
VM_PAPER_A3,
|
|
|
|
///
|
|
|
|
VM_PAPER_A4,
|
|
|
|
///
|
|
|
|
VM_PAPER_A5,
|
|
|
|
///
|
|
|
|
VM_PAPER_B3,
|
|
|
|
///
|
|
|
|
VM_PAPER_B4,
|
|
|
|
///
|
|
|
|
VM_PAPER_B5
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum PARSEP {
|
|
|
|
///
|
|
|
|
PARSEP_INDENT,
|
|
|
|
///
|
|
|
|
PARSEP_SKIP
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum PAPER_ORIENTATION {
|
|
|
|
///
|
|
|
|
ORIENTATION_PORTRAIT,
|
|
|
|
///
|
|
|
|
ORIENTATION_LANDSCAPE
|
|
|
|
};
|
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-02-16 00:54:43 +00:00
|
|
|
///
|
|
|
|
void writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
|
|
|
|
|
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
|
2002-03-21 17:27:08 +00:00
|
|
|
char papersize; // add apprip. signedness
|
2001-11-29 17:12:21 +00:00
|
|
|
/// the selected Geometry papersize
|
|
|
|
char papersize2; // add approp. signedness
|
|
|
|
/// a special paperpackage .sty-file
|
|
|
|
char paperpackage; // add approp. signedness
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
PAPER_ORIENTATION orientation; // add approp. signedness
|
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;
|
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-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-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
|