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
|
|
|
*
|
2000-02-04 09:38:32 +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-15 12:01:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#ifndef LATEXFEATURES_H
|
|
|
|
#define LATEXFEATURES_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
#include "support/types.h"
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-03-17 10:14:46 +00:00
|
|
|
#include <set>
|
2001-11-19 15:34:11 +00:00
|
|
|
#include <list>
|
2001-12-28 13:26:54 +00:00
|
|
|
#include <map>
|
1999-10-02 16:21:10 +00:00
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
class BufferParams;
|
2000-03-17 10:14:46 +00:00
|
|
|
struct Language;
|
1999-10-02 16:21:10 +00:00
|
|
|
|
2001-11-19 15:34:11 +00:00
|
|
|
/** The packages and commands that a buffer needs. This class
|
|
|
|
contains a list<string>. Each of the LaTeX packages that a buffer needs
|
|
|
|
should be added with void require(string const & name).
|
|
|
|
|
|
|
|
i.e require("amssymb")
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
To add support you should only need to require() the package name as
|
2001-11-19 15:34:11 +00:00
|
|
|
packages which don't have special requirements are handled automatically.
|
|
|
|
If your new package does need special consideration you'll need to alter
|
|
|
|
string const getPackages() const;
|
2002-03-21 17:27:08 +00:00
|
|
|
Remember to update the validate function in buffer.C and paragraph.C
|
2001-11-19 15:34:11 +00:00
|
|
|
when you do so.
|
2000-08-07 20:58:24 +00:00
|
|
|
*/
|
2001-11-19 15:34:11 +00:00
|
|
|
class LaTeXFeatures {
|
|
|
|
public:
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2002-03-02 16:39:54 +00:00
|
|
|
LaTeXFeatures(BufferParams const &);
|
2001-11-09 13:44:48 +00:00
|
|
|
/// The packages needed by the document
|
2001-05-08 17:08:44 +00:00
|
|
|
string const getPackages() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// The macros definitions needed by the document
|
2001-05-08 17:08:44 +00:00
|
|
|
string const getMacros() const;
|
2002-05-10 12:58:07 +00:00
|
|
|
///
|
|
|
|
string const getBabelOptions() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// The definitions needed by the document's textclass
|
2001-05-08 17:08:44 +00:00
|
|
|
string const getTClassPreamble() const;
|
2001-10-23 09:42:14 +00:00
|
|
|
/// The sgml definitions needed by the document (dobook/linuxdoc)
|
|
|
|
string const getLyXSGMLEntities() const;
|
2001-11-19 15:34:11 +00:00
|
|
|
/// The SGML Required to include the files added with includeFile();
|
2001-05-08 17:08:44 +00:00
|
|
|
string const getIncludedFiles(string const & fname) const;
|
2001-11-19 15:34:11 +00:00
|
|
|
/// Include a file for use with the SGML entities
|
|
|
|
void includeFile(string const & key, string const & name);
|
|
|
|
/// The float definitions.
|
2001-05-09 15:20:58 +00:00
|
|
|
void getFloatDefinitions(std::ostream & os) const;
|
2001-11-19 15:34:11 +00:00
|
|
|
/// Print requirements to lyxerr
|
2001-05-08 17:08:44 +00:00
|
|
|
void showStruct() const;
|
2002-03-21 17:27:08 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
void addExternalPreamble(string const &);
|
2000-06-12 11:27:15 +00:00
|
|
|
/// Provide a string name-space to the requirements
|
|
|
|
void require(string const & name);
|
2001-11-19 15:34:11 +00:00
|
|
|
/// Is the package required?
|
|
|
|
bool isRequired(string const & name) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
void useFloat(string const & name);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
void useLanguage(Language const *);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-02-16 00:54:43 +00:00
|
|
|
bool hasLanguages() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
string getLanguages() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-02-16 00:54:43 +00:00
|
|
|
std::set<string> getEncodingSet(string const & doc_encoding) const;
|
2000-05-19 16:46:01 +00:00
|
|
|
///
|
2002-03-02 16:39:54 +00:00
|
|
|
void useLayout(string const & lyt);
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
BufferParams const & bufferParams() const;
|
2003-05-23 11:18:43 +00:00
|
|
|
/// the return value is dependent upon both LyXRC and LaTeXFeatures.
|
|
|
|
bool useBabel() const;
|
2000-08-07 20:58:24 +00:00
|
|
|
|
2001-11-19 15:34:11 +00:00
|
|
|
private:
|
|
|
|
string externalPreambles;
|
2000-08-07 20:58:24 +00:00
|
|
|
|
2002-07-21 21:21:06 +00:00
|
|
|
std::list<string> usedLayouts;
|
2000-08-07 20:58:24 +00:00
|
|
|
|
2001-11-19 15:34:11 +00:00
|
|
|
/// Static preamble bits from the external material insets
|
|
|
|
|
|
|
|
|
|
|
|
typedef std::list<string> FeaturesList;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
FeaturesList features;
|
2000-03-17 10:14:46 +00:00
|
|
|
///
|
2000-04-04 00:19:15 +00:00
|
|
|
typedef std::set<Language const *> LanguageList;
|
2000-03-17 10:14:46 +00:00
|
|
|
///
|
|
|
|
LanguageList UsedLanguages;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2000-12-29 12:48:02 +00:00
|
|
|
typedef std::set<string> UsedFloats;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2000-12-29 12:48:02 +00:00
|
|
|
UsedFloats usedFloats;
|
2000-07-01 12:54:45 +00:00
|
|
|
///
|
2000-07-03 14:33:51 +00:00
|
|
|
typedef std::map<string , string> FileMap;
|
2000-07-01 12:54:45 +00:00
|
|
|
///
|
2000-07-07 07:46:37 +00:00
|
|
|
FileMap IncludedFiles;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
|
|
|
///
|
2000-04-10 21:40:13 +00:00
|
|
|
BufferParams const & params;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|