1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-1999 The LyX Team.
|
|
|
|
*
|
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef LAYOUT_H
|
|
|
|
#define LAYOUT_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#include <vector>
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "definitions.h"
|
|
|
|
#include "lyxlex.h"
|
|
|
|
#include "lyxfont.h"
|
|
|
|
#include "Spacing.h"
|
|
|
|
|
|
|
|
/// Reads the style files
|
1999-11-04 01:40:20 +00:00
|
|
|
extern void LyXSetStyle();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// The different output types
|
|
|
|
enum OutputType {
|
|
|
|
///
|
|
|
|
LATEX,
|
|
|
|
///
|
|
|
|
LINUXDOC,
|
|
|
|
///
|
|
|
|
DOCBOOK,
|
|
|
|
///
|
|
|
|
LITERATE
|
|
|
|
};
|
|
|
|
|
|
|
|
/// The different margin types
|
|
|
|
enum LYX_MARGIN_TYPE {
|
|
|
|
///
|
|
|
|
MARGIN_MANUAL,
|
|
|
|
///
|
|
|
|
MARGIN_FIRST_DYNAMIC,
|
|
|
|
///
|
|
|
|
MARGIN_DYNAMIC,
|
|
|
|
///
|
|
|
|
MARGIN_STATIC,
|
|
|
|
///
|
|
|
|
MARGIN_RIGHT_ADDRESS_BOX
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
enum LyXAlignment {
|
|
|
|
///
|
|
|
|
LYX_ALIGN_NONE = 0,
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
LYX_ALIGN_BLOCK = 1,
|
|
|
|
///
|
|
|
|
LYX_ALIGN_LEFT = 2,
|
|
|
|
///
|
|
|
|
LYX_ALIGN_RIGHT = 4,
|
|
|
|
///
|
|
|
|
LYX_ALIGN_CENTER = 8,
|
|
|
|
///
|
|
|
|
LYX_ALIGN_LAYOUT = 16,
|
|
|
|
///
|
|
|
|
LYX_ALIGN_SPECIAL = 32
|
|
|
|
};
|
1999-11-04 01:40:20 +00:00
|
|
|
inline void operator|=(LyXAlignment & la1, LyXAlignment la2) {
|
|
|
|
la1 = static_cast<LyXAlignment>(la1 | la2);
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// The different LaTeX-Types
|
|
|
|
enum LYX_LATEX_TYPES {
|
|
|
|
///
|
|
|
|
LATEX_PARAGRAPH,
|
|
|
|
///
|
|
|
|
LATEX_COMMAND,
|
|
|
|
///
|
|
|
|
LATEX_ENVIRONMENT,
|
|
|
|
///
|
|
|
|
LATEX_ITEM_ENVIRONMENT,
|
|
|
|
///
|
|
|
|
LATEX_LIST_ENVIRONMENT
|
|
|
|
};
|
|
|
|
|
|
|
|
/// The different label types
|
|
|
|
enum LYX_LABEL_TYPES {
|
|
|
|
///
|
|
|
|
LABEL_NO_LABEL,
|
|
|
|
///
|
|
|
|
LABEL_MANUAL,
|
|
|
|
///
|
|
|
|
LABEL_BIBLIO,
|
|
|
|
///
|
|
|
|
LABEL_TOP_ENVIRONMENT,
|
|
|
|
///
|
|
|
|
LABEL_CENTERED_TOP_ENVIRONMENT,
|
|
|
|
|
|
|
|
// the flushright labels following now must start with LABEL_STATIC
|
|
|
|
///
|
|
|
|
LABEL_STATIC,
|
|
|
|
///
|
|
|
|
LABEL_SENSITIVE,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_CHAPTER,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_SECTION,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_SUBSECTION,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_SUBSUBSECTION,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_PARAGRAPH,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_SUBPARAGRAPH,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_ENUMI,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_ENUMII,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_ENUMIII,
|
|
|
|
///
|
|
|
|
LABEL_COUNTER_ENUMIV,
|
|
|
|
///
|
|
|
|
LABEL_FIRST_COUNTER = LABEL_COUNTER_CHAPTER
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Fix labels are printed flushright, manual labels flushleft.
|
1999-11-04 01:40:20 +00:00
|
|
|
* MARGIN_MANUAL and MARGIN_FIRST_DYNAMIC are *only* for LABEL_MANUAL,
|
|
|
|
* MARGIN_DYNAMIC and MARGIN_STATIC are *not* for LABEL_MANUAL.
|
|
|
|
* This seems a funny restriction, but I think other combinations are
|
|
|
|
* not needed, so I will not change it yet.
|
|
|
|
* Correction: MARGIN_FIRST_DYNAMIC also usable with LABEL_STATIC
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* There is a parindent and a parskip. Which one is used depends on the
|
1999-11-04 01:40:20 +00:00
|
|
|
* paragraph_separation-flag of the text-object.
|
|
|
|
* BUT: parindent is only thrown away, if a parskip is defined! So if you
|
|
|
|
* want a space between the paragraphs and a parindent at the same time,
|
|
|
|
* you should set parskip to zero and use topsep, parsep and bottomsep.
|
|
|
|
*
|
|
|
|
* The standard layout is an exception: its parindent is only set, if the
|
|
|
|
* previous paragraph is standard too. Well, this is LateX and it is good!
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/// Attributes of a layout/paragraph environment
|
1999-11-04 01:40:20 +00:00
|
|
|
class LyXTextClass;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
class LyXLayout {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
LyXLayout ();
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
bool Read (LyXLex &, LyXTextClass const &);
|
|
|
|
|
|
|
|
string const & name() const { return name_; }
|
|
|
|
void name(string const & n) { name_ = n; }
|
|
|
|
string const & obsoleted_by() const { return obsoleted_by_; }
|
|
|
|
string const & latexname() const { return latexname_; }
|
|
|
|
string const & labelstring() const { return labelstring_; }
|
|
|
|
string const & preamble() const { return preamble_; }
|
|
|
|
string const & latexparam() const { return latexparam_; }
|
|
|
|
string const & labelstring_appendix() const { return labelstring_appendix_; }
|
|
|
|
/** Default font for this layout/environment.
|
|
|
|
The main font for this kind of environment. If an attribute has
|
|
|
|
LyXFont::INHERITED_*, it means that the value is specified by
|
|
|
|
the defaultfont for the entire layout. If we are nested, the
|
|
|
|
font is inherited from the font in the environment one level
|
|
|
|
up until the font is resolved. The values LyXFont::IGNORE_*
|
|
|
|
and LyXFont::TOGGLE are illegal here.
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
|
|
|
LyXFont font;
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Default font for labels.
|
|
|
|
Interpretation the same as for font above
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
LyXFont labelfont;
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Resolved version of the font for this layout/environment.
|
|
|
|
This is a resolved version the default font. The font is resolved
|
|
|
|
against the defaultfont of the entire layout.
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
LyXFont resfont;
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Resolved version of the font used for labels.
|
|
|
|
This is a resolved version the label font. The font is resolved
|
|
|
|
against the defaultfont of the entire layout.
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
LyXFont reslabelfont;
|
|
|
|
|
|
|
|
/// Text that dictates how wide the left margin is on the screen
|
1999-10-02 16:21:10 +00:00
|
|
|
string leftmargin;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Text that dictates how wide the right margin is on the screen
|
1999-10-02 16:21:10 +00:00
|
|
|
string rightmargin;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Text that dictates how much space to leave after a potential label
|
1999-10-02 16:21:10 +00:00
|
|
|
string labelsep;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Text that dictates how much space to leave before a potential label
|
1999-10-02 16:21:10 +00:00
|
|
|
string labelindent;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Text that dictates the width of the indentation of
|
|
|
|
indented paragraphs.
|
|
|
|
*/
|
1999-10-02 16:21:10 +00:00
|
|
|
string parindent;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
float parskip;
|
|
|
|
|
|
|
|
///
|
|
|
|
float itemsep;
|
|
|
|
|
|
|
|
///
|
|
|
|
float topsep;
|
|
|
|
|
|
|
|
///
|
|
|
|
float bottomsep;
|
|
|
|
|
|
|
|
///
|
|
|
|
float labelbottomsep;
|
|
|
|
|
|
|
|
///
|
|
|
|
float parsep;
|
|
|
|
|
|
|
|
///
|
|
|
|
Spacing spacing;
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXAlignment align; // add approp. signedness
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXAlignment alignpossible; // add approp. signedness
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
char labeltype; // add approp. signedness
|
|
|
|
|
|
|
|
///
|
|
|
|
char margintype; // add approp. signedness
|
|
|
|
|
|
|
|
///
|
|
|
|
bool fill_top;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool fill_bottom;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool newline_allowed;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool nextnoindent;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool free_spacing;
|
|
|
|
/// true when the fragile commands in the paragraph need to be
|
|
|
|
/// \protect'ed.
|
|
|
|
bool needprotect;
|
|
|
|
/// true when empty paragraphs should be kept.
|
|
|
|
bool keepempty;
|
|
|
|
///
|
|
|
|
bool isParagraph() const {
|
|
|
|
return latextype == LATEX_PARAGRAPH;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
bool isCommand() const {
|
|
|
|
return latextype == LATEX_COMMAND;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
bool isEnvironment() const {
|
|
|
|
return (latextype == LATEX_ENVIRONMENT
|
|
|
|
|| latextype == LATEX_ITEM_ENVIRONMENT
|
|
|
|
|| latextype == LATEX_LIST_ENVIRONMENT);
|
|
|
|
}
|
|
|
|
/// Type of LaTeX object
|
|
|
|
LYX_LATEX_TYPES latextype;
|
|
|
|
/// Does this object belong in the title part of the document?
|
|
|
|
bool intitle;
|
1999-11-04 01:40:20 +00:00
|
|
|
private:
|
|
|
|
/// Name of the layout/paragraph environment
|
|
|
|
string name_;
|
|
|
|
|
|
|
|
/** Name of an layout that has replaced this layout.
|
|
|
|
This is used to rename a layout, while keeping backward
|
|
|
|
compatibility
|
|
|
|
*/
|
|
|
|
string obsoleted_by_;
|
|
|
|
|
|
|
|
/// LaTeX name for environment
|
|
|
|
string latexname_;
|
|
|
|
|
|
|
|
/// Label string. "Abstract", "Reference", "Caption"...
|
|
|
|
string labelstring_;
|
|
|
|
|
|
|
|
/// Label string inside appendix. "Appendix", ...
|
|
|
|
string labelstring_appendix_;
|
|
|
|
|
|
|
|
/// LaTeX parameter for environment
|
|
|
|
string latexparam_;
|
|
|
|
|
|
|
|
/// Macro definitions needed for this layout
|
|
|
|
string preamble_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
class LyXTextClass {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
typedef vector<LyXLayout> LayoutList;
|
|
|
|
|
|
|
|
///
|
|
|
|
LyXTextClass (string const & = string(),
|
|
|
|
string const & = string(),
|
|
|
|
string const & = string());
|
|
|
|
|
|
|
|
///
|
|
|
|
LayoutList::const_iterator begin() const { return layoutlist.begin(); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LayoutList::const_iterator end() const { return layoutlist.end(); }
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
bool Read(string const & filename, bool merge = false);
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
bool hasLayout(string const & name) const;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXLayout const & GetLayout(string const & vname) const;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXLayout & GetLayout(string const & vname);
|
|
|
|
|
|
|
|
/// Sees to that the textclass structure has been loaded
|
|
|
|
void load();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & name() const { return name_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & latexname() const { return latexname_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & description() const { return description_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & opt_fontsize() const { return opt_fontsize_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & opt_pagestyle() const { return opt_pagestyle_; }
|
|
|
|
///
|
|
|
|
string const & options() const { return options_; }
|
|
|
|
///
|
|
|
|
string const & pagestyle() const { return pagestyle_; }
|
|
|
|
///
|
|
|
|
string const & preamble() const { return preamble_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/// Packages that are already loaded by the class
|
|
|
|
enum Provides {
|
|
|
|
nothing = 0,
|
|
|
|
amsmath = 1,
|
|
|
|
makeidx = 2,
|
|
|
|
url = 4
|
|
|
|
};
|
|
|
|
bool provides(Provides p) const { return provides_ & p; }
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
unsigned int columns() const { return columns_; }
|
|
|
|
///
|
|
|
|
enum PageSides {
|
|
|
|
OneSide,
|
|
|
|
TwoSides
|
|
|
|
};
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
PageSides sides() const { return sides_; }
|
|
|
|
///
|
|
|
|
int secnumdepth() const { return secnumdepth_; }
|
|
|
|
///
|
|
|
|
int tocdepth() const { return tocdepth_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
OutputType outputType() const { return outputType_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
LyXFont const & defaultfont() const { return defaultfont_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/// Text that dictates how wide the left margin is on the screen
|
|
|
|
string const & leftmargin() const { return leftmargin_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/// Text that dictates how wide the right margin is on the screen
|
|
|
|
string const & rightmargin() const { return rightmargin_; }
|
|
|
|
///
|
|
|
|
int maxcounter() const { return maxcounter_; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LayoutList::size_type numLayouts() const { return layoutlist.size(); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXLayout const & operator[](LayoutList::size_type i) const {
|
|
|
|
return layoutlist[i];
|
|
|
|
}
|
|
|
|
private:
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
bool delete_layout(string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
bool do_readStyle(LyXLex &, LyXLayout &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string name_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string latexname_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string description_;
|
|
|
|
/// Specific class options
|
|
|
|
string opt_fontsize_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string opt_pagestyle_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string options_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string pagestyle_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string preamble_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Provides provides_;
|
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
|
|
|
PageSides sides_;
|
|
|
|
///
|
|
|
|
int secnumdepth_;
|
|
|
|
///
|
|
|
|
int tocdepth_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
OutputType outputType_;
|
|
|
|
/** Base font. The paragraph and layout fonts are resolved against
|
|
|
|
this font. This has to be fully instantiated. Attributes
|
|
|
|
LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
|
|
|
|
extremely illegal.
|
|
|
|
*/
|
|
|
|
LyXFont defaultfont_;
|
|
|
|
/// Text that dictates how wide the left margin is on the screen
|
|
|
|
string leftmargin_;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Text that dictates how wide the right margin is on the screen
|
1999-11-04 01:40:20 +00:00
|
|
|
string rightmargin_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int maxcounter_; // add approp. signedness
|
|
|
|
|
|
|
|
///
|
|
|
|
LayoutList layoutlist;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Has this layout file been loaded yet?
|
|
|
|
bool loaded;
|
|
|
|
};
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
inline void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
|
|
|
|
{
|
|
|
|
p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
|
|
|
|
}
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
class LyXTextClassList {
|
|
|
|
public:
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
typedef vector<LyXTextClass> ClassList;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Gets layout structure from layout number and textclass number
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXLayout const & Style(ClassList::size_type textclass,
|
|
|
|
LyXTextClass::LayoutList::size_type layout) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Gets layout number from textclass number and layout name
|
1999-11-04 01:40:20 +00:00
|
|
|
pair<bool, LyXTextClass::LayoutList::size_type>
|
|
|
|
NumberOfLayout(ClassList::size_type textclass,
|
|
|
|
string const & name) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Gets a layout name from layout number and textclass number
|
1999-11-04 01:40:20 +00:00
|
|
|
string const &
|
|
|
|
NameOfLayout(ClassList::size_type textclass,
|
|
|
|
LyXTextClass::LayoutList::size_type layout) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Gets textclass number from name.
|
|
|
|
Returns -1 if textclass name does not exist
|
|
|
|
*/
|
|
|
|
pair<bool, ClassList::size_type>
|
|
|
|
NumberOfClass(string const & textclass) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & NameOfClass(ClassList::size_type number) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & LatexnameOfClass(ClassList::size_type number) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
string const & DescOfClass(ClassList::size_type number) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXTextClass const & TextClass(ClassList::size_type textclass) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Read textclass list.
|
|
|
|
Returns false if this fails
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
bool Read();
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Load textclass.
|
|
|
|
Returns false if this fails
|
|
|
|
*/
|
|
|
|
bool Load(ClassList::size_type number) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
mutable ClassList classlist;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void Add (LyXTextClass const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Should not be declared here!! (Lgb) Why not? (Asger)
|
1999-11-04 01:40:20 +00:00
|
|
|
extern LyXTextClassList textclasslist;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#endif
|