1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
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
|
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-11-09 23:52:04 +00:00
|
|
|
#include <vector>
|
2000-03-17 10:14:46 +00:00
|
|
|
#include <set>
|
2001-11-19 15:34:11 +00:00
|
|
|
#include <list>
|
1999-11-09 23:52:04 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#include "LString.h"
|
2000-09-27 17:07:33 +00:00
|
|
|
#include "layout.h"
|
1999-10-02 16:21:10 +00:00
|
|
|
|
1999-09-27 18:44:28 +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")
|
|
|
|
|
|
|
|
To add support you should only need to require() the package name as
|
|
|
|
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;
|
|
|
|
Remember to update the validate function in buffer.C and paragraph.C
|
|
|
|
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
|
|
|
///
|
2000-09-27 17:07:33 +00:00
|
|
|
LaTeXFeatures(BufferParams const &, LyXTextClass::size_type n) ;
|
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;
|
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;
|
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
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
bool hasLanguages();
|
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
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
std::set<string> getEncodingSet(string const & doc_encoding);
|
2000-05-19 16:46:01 +00:00
|
|
|
///
|
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
void useLayout(std::vector<bool>::size_type const & idx);
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2001-11-19 15:34:11 +00:00
|
|
|
BufferParams const & bufferParams() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
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
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
std::vector<bool> layout;
|
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
|