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
|
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2000-02-04 09:38:32 +00:00
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* ====================================================== */
|
1999-10-02 16:21:10 +00:00
|
|
|
|
|
|
|
#ifndef LYXPARAGRAPH_H
|
|
|
|
#define LYXPARAGRAPH_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-01-11 01:59:00 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <list>
|
|
|
|
|
1999-12-13 07:33:00 +00:00
|
|
|
#include "insets/lyxinset.h"
|
|
|
|
#include "table.h"
|
|
|
|
#include "vspace.h"
|
|
|
|
#include "layout.h"
|
|
|
|
#include "support/block.h"
|
2000-02-04 09:38:32 +00:00
|
|
|
#include "direction.h"
|
1999-11-04 01:40:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class BufferParams;
|
|
|
|
class LyXBuffer;
|
|
|
|
class TexRow;
|
|
|
|
struct LaTeXFeatures;
|
2000-02-18 22:22:42 +00:00
|
|
|
class InsetBibKey;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-01-11 11:23:48 +00:00
|
|
|
using std::list;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A LyXParagraph holds all text, attributes and insets in a text paragraph
|
|
|
|
class LyXParagraph {
|
|
|
|
public:
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
|
|
|
enum PEXTRA_TYPE {
|
|
|
|
///
|
|
|
|
PEXTRA_NONE,
|
|
|
|
///
|
|
|
|
PEXTRA_INDENT,
|
|
|
|
///
|
|
|
|
PEXTRA_MINIPAGE,
|
|
|
|
///
|
|
|
|
PEXTRA_FLOATFLT
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum MINIPAGE_ALIGNMENT {
|
|
|
|
///
|
|
|
|
MINIPAGE_ALIGN_TOP,
|
|
|
|
///
|
|
|
|
MINIPAGE_ALIGN_MIDDLE,
|
|
|
|
///
|
|
|
|
MINIPAGE_ALIGN_BOTTOM
|
|
|
|
};
|
|
|
|
///
|
|
|
|
enum META_KIND {
|
|
|
|
///
|
|
|
|
META_FOOTNOTE = 1,
|
|
|
|
///
|
|
|
|
META_MARGIN,
|
|
|
|
///
|
|
|
|
META_FIG,
|
|
|
|
///
|
|
|
|
META_TAB,
|
|
|
|
///
|
|
|
|
META_ALGORITHM,
|
|
|
|
///
|
|
|
|
META_WIDE_FIG,
|
|
|
|
///
|
|
|
|
META_WIDE_TAB,
|
|
|
|
///
|
|
|
|
META_HFILL,
|
|
|
|
///
|
|
|
|
META_NEWLINE,
|
|
|
|
///
|
2000-02-29 02:19:17 +00:00
|
|
|
//META_PROTECTED_SEPARATOR,
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
|
|
|
META_INSET
|
|
|
|
};
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// The footnoteflag
|
|
|
|
enum footnote_flag {
|
|
|
|
///
|
|
|
|
NO_FOOTNOTE,
|
|
|
|
///
|
|
|
|
OPEN_FOOTNOTE,
|
|
|
|
///
|
|
|
|
CLOSED_FOOTNOTE
|
|
|
|
};
|
|
|
|
|
|
|
|
/// The footnotekinds
|
|
|
|
enum footnote_kind {
|
|
|
|
///
|
|
|
|
FOOTNOTE,
|
|
|
|
///
|
|
|
|
MARGIN,
|
|
|
|
///
|
|
|
|
FIG,
|
|
|
|
///
|
|
|
|
TAB,
|
|
|
|
///
|
|
|
|
ALGORITHM, // Bernhard, 970807
|
|
|
|
///
|
|
|
|
WIDE_FIG, // CFO-G, 971106
|
|
|
|
///
|
|
|
|
WIDE_TAB // CFO-G, 971106
|
|
|
|
};
|
|
|
|
|
2000-02-04 09:38:32 +00:00
|
|
|
///
|
|
|
|
typedef char value_type;
|
|
|
|
///
|
|
|
|
typedef vector<value_type> TextContainer;
|
|
|
|
///
|
|
|
|
typedef int size_type;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
LyXParagraph();
|
|
|
|
/// this konstruktor inserts the new paragraph in a list
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph(LyXParagraph * par);
|
1999-09-27 18:44:28 +00:00
|
|
|
/// the destruktors removes the new paragraph from the list
|
|
|
|
~LyXParagraph();
|
|
|
|
|
2000-02-04 09:38:32 +00:00
|
|
|
///
|
|
|
|
LyXDirection getParDirection() const;
|
|
|
|
///
|
|
|
|
LyXDirection getLetterDirection(size_type pos) const;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-22 00:36:17 +00:00
|
|
|
void writeFile(ostream &, BufferParams const &, char, char) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-04 09:38:32 +00:00
|
|
|
void validate(LaTeXFeatures &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
int id() const {
|
|
|
|
return id_;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
void id(int id_arg) {
|
|
|
|
id_ = id_arg;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
1999-11-04 01:40:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void read();
|
2000-01-06 02:44:26 +00:00
|
|
|
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
|
|
|
LyXParagraph * TeXOnePar(ostream &, TexRow & texrow,
|
|
|
|
ostream & foot, TexRow & foot_texrow,
|
|
|
|
int & foot_count);
|
|
|
|
///
|
|
|
|
bool SimpleTeXOnePar(ostream &, TexRow & texrow);
|
|
|
|
|
|
|
|
///
|
|
|
|
LyXParagraph * TeXEnvironment(ostream &, TexRow & texrow,
|
|
|
|
ostream & foot, TexRow & foot_texrow,
|
|
|
|
int & foot_count);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
LyXParagraph * Clone() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-02-04 09:38:32 +00:00
|
|
|
bool HasSameLayout(LyXParagraph const * par) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
void MakeSameLayout(LyXParagraph const * par);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Is it the first par with same depth and layout?
|
1999-11-22 16:19:48 +00:00
|
|
|
bool IsFirstInSequence() const {
|
|
|
|
LyXParagraph const * dhook = DepthHook(GetDepth());
|
1999-09-27 18:44:28 +00:00
|
|
|
return (dhook == this
|
|
|
|
|| dhook->GetLayout() != GetLayout()
|
|
|
|
|| dhook->GetDepth() != GetDepth());
|
|
|
|
}
|
|
|
|
|
2000-03-10 13:22:20 +00:00
|
|
|
/// Check if the current paragraph is the last paragraph in a
|
|
|
|
/// proof environment
|
|
|
|
int GetEndLabel() const;
|
1999-11-04 01:40:20 +00:00
|
|
|
|
2000-03-16 04:29:22 +00:00
|
|
|
private:
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
TextContainer text;
|
2000-03-16 04:29:22 +00:00
|
|
|
public:
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
size_type size() const { return text.size(); }
|
2000-03-16 04:29:22 +00:00
|
|
|
///
|
|
|
|
void fitToSize() {
|
|
|
|
text.resize(text.size());
|
|
|
|
}
|
|
|
|
void setContentsFromPar(LyXParagraph * par) {
|
|
|
|
text = par->text;
|
|
|
|
}
|
|
|
|
void clearContents() {
|
|
|
|
text.clear();
|
|
|
|
}
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
VSpace added_space_top;
|
|
|
|
|
|
|
|
///
|
|
|
|
VSpace added_space_bottom;
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXTextClass::LayoutList::size_type layout;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
\begin{itemize}
|
|
|
|
\item no footnote, closed footnote,
|
|
|
|
\item open footnote, where footnote
|
|
|
|
\item means footnote-environment
|
|
|
|
\end{itemize}
|
|
|
|
*/
|
|
|
|
footnote_flag footnoteflag;
|
|
|
|
|
|
|
|
/// footnote, margin, fig, tab
|
|
|
|
footnote_kind footnotekind;
|
|
|
|
|
|
|
|
//@Man: the LyX- DTP-switches
|
|
|
|
//@{
|
|
|
|
///
|
|
|
|
bool line_top;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool line_bottom;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool pagebreak_top;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool pagebreak_bottom;
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXAlignment align;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
char depth;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool noindent;
|
|
|
|
|
|
|
|
private:
|
1999-11-22 16:19:48 +00:00
|
|
|
block<int, 10> counter_;
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
void setCounter(int i, int v) { counter_[i] = v; }
|
|
|
|
int getCounter(int i) const { return counter_[i]; }
|
|
|
|
void incCounter(int i) { counter_[i]++; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
bool start_of_appendix;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool appendix;
|
|
|
|
|
|
|
|
///
|
|
|
|
char enumdepth;
|
|
|
|
|
|
|
|
///
|
|
|
|
char itemdepth;
|
|
|
|
|
|
|
|
/* This is for the paragraph extra stuff */
|
|
|
|
///
|
|
|
|
int pextra_type;
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string pextra_width;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string pextra_widthp;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
int pextra_alignment;
|
|
|
|
///
|
|
|
|
bool pextra_hfill;
|
|
|
|
///
|
|
|
|
bool pextra_start_minipage;
|
|
|
|
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string labelstring;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string labelwidthstring;
|
1999-09-27 18:44:28 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * next;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * previous;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/* table stuff -- begin*/
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXTable * table;
|
1999-09-27 18:44:28 +00:00
|
|
|
/* table stuff -- end*/
|
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetBibKey * bibkey; // ale970302
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** these function are able to hide closed footnotes
|
|
|
|
*/
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * Next();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * Previous();
|
1999-11-22 16:19:48 +00:00
|
|
|
///
|
|
|
|
LyXParagraph const * Previous() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** these function are able to hide open and closed footnotes
|
|
|
|
*/
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * NextAfterFootnote();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
LyXParagraph const * NextAfterFootnote() const;
|
|
|
|
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * PreviousBeforeFootnote();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * LastPhysicalPar();
|
2000-03-10 13:22:20 +00:00
|
|
|
///
|
|
|
|
LyXParagraph const * LastPhysicalPar() const;
|
1999-11-22 16:19:48 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * FirstPhysicalPar();
|
1999-11-22 16:19:48 +00:00
|
|
|
///
|
|
|
|
LyXParagraph const * FirstPhysicalPar() const;
|
1999-11-04 01:40:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// returns the physical paragraph
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * ParFromPos(size_type pos);
|
|
|
|
/// returns the position in the physical par
|
1999-11-22 16:19:48 +00:00
|
|
|
int PositionInParFromPos(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// for the environments
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXParagraph * DepthHook(int depth);
|
1999-11-22 16:19:48 +00:00
|
|
|
/// for the environments
|
|
|
|
LyXParagraph const * DepthHook(int depth) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
int BeginningOfMainBody() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
string GetLabestring() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// the next two functions are for the manual labels
|
1999-11-22 16:19:48 +00:00
|
|
|
string GetLabelWidthString() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void SetLabelWidthString(string const & s);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
LyXTextClass::LayoutList::size_type GetLayout() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
char GetAlign() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
char GetDepth() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void SetLayout(LyXTextClass::LayoutList::size_type new_layout);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void SetOnlyLayout(LyXTextClass::LayoutList::size_type new_layout);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
int GetFirstCounter(int i) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
size_type Last() const;
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
void Erase(size_type pos);
|
|
|
|
/** the flag determines wether the layout should be copied
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
1999-11-04 01:40:20 +00:00
|
|
|
void BreakParagraph(size_type pos, int flag);
|
|
|
|
///
|
|
|
|
void BreakParagraphConservative(size_type pos);
|
|
|
|
/** Get unistantiated font setting. Returns the difference
|
|
|
|
between the characters font and the layoutfont.
|
|
|
|
This is what is stored in the fonttable
|
|
|
|
*/
|
1999-11-22 16:19:48 +00:00
|
|
|
LyXFont GetFontSettings(size_type pos) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
/** Get fully instantiated font. If pos == -1, use the layout
|
|
|
|
font attached to this paragraph.
|
|
|
|
If pos == -2, use the label font of the layout attached here.
|
|
|
|
In all cases, the font is instantiated, i.e. does not have any
|
|
|
|
attributes with values LyXFont::INHERIT, LyXFont::IGNORE or
|
|
|
|
LyXFont::TOGGLE.
|
|
|
|
*/
|
1999-11-22 16:19:48 +00:00
|
|
|
LyXFont getFont(size_type pos) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
char GetChar(size_type pos);
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
char GetChar(size_type pos) const;
|
2000-03-16 04:29:22 +00:00
|
|
|
/// The position must already exist.
|
|
|
|
void SetChar(size_type pos, char c) {
|
|
|
|
text[pos] = c;
|
|
|
|
}
|
|
|
|
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void SetFont(size_type pos, LyXFont const & font);
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
string GetWord(size_type &) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
/// Returns the height of the highest font in range
|
1999-11-15 12:01:38 +00:00
|
|
|
LyXFont::FONT_SIZE HighestFontInRange(size_type startpos,
|
|
|
|
size_type endpos) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
void InsertChar(size_type pos, char c);
|
|
|
|
///
|
|
|
|
void InsertInset(size_type pos, Inset * inset);
|
|
|
|
///
|
|
|
|
Inset * GetInset(size_type pos);
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
Inset const * GetInset(size_type pos) const;
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Inset * ReturnNextInsetPointer(size_type & pos);
|
|
|
|
///
|
|
|
|
void OpenFootnote(size_type pos);
|
|
|
|
///
|
|
|
|
void CloseFootnote(size_type pos);
|
|
|
|
/// important for cut and paste
|
1999-11-22 16:19:48 +00:00
|
|
|
void CopyIntoMinibuffer(size_type pos) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
void CutIntoMinibuffer(size_type pos);
|
|
|
|
///
|
|
|
|
void InsertFromMinibuffer(size_type pos);
|
1999-11-15 12:01:38 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsHfill(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsInset(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsFloat(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsNewline(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsSeparator(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsLineSeparator(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsKomma(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Used by the spellchecker
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsLetter(size_type pos) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsWord(size_type pos) const;
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
/** This one resets all layout and dtp switches but not the font
|
|
|
|
of the single characters
|
|
|
|
*/
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
/** paste this paragraph with the next one
|
|
|
|
be carefull, this doesent make any check at all
|
|
|
|
*/
|
|
|
|
void PasteParagraph();
|
|
|
|
|
|
|
|
/// used to remove the error messages
|
|
|
|
int AutoDeleteInsets();
|
|
|
|
|
|
|
|
/// returns -1 if inset not found
|
1999-11-22 16:19:48 +00:00
|
|
|
int GetPositionOfInset(Inset * inset) const;
|
1999-11-04 01:40:20 +00:00
|
|
|
|
|
|
|
/// ok and now some footnote functions
|
|
|
|
void OpenFootnotes();
|
|
|
|
|
|
|
|
///
|
|
|
|
void CloseFootnotes();
|
|
|
|
|
|
|
|
///
|
|
|
|
LyXParagraph * FirstSelfrowPar();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-02-04 09:38:32 +00:00
|
|
|
int ClearParagraph() {
|
1999-11-04 01:40:20 +00:00
|
|
|
int i = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
if (!IsDummy() && !table){
|
|
|
|
while (Last()
|
|
|
|
&& (IsNewline(0)
|
|
|
|
|| IsLineSeparator(0))){
|
|
|
|
Erase(0);
|
2000-01-24 18:34:46 +00:00
|
|
|
++i;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** A paragraph following a footnote is a "dummy". A paragraph
|
|
|
|
with a footnote in it is stored as three paragraphs:
|
|
|
|
First a paragraph with the text up to the footnote, then
|
|
|
|
one (or more) paragraphs with the footnote, and finally
|
|
|
|
the a paragraph with the text after the footnote. Only the
|
|
|
|
first paragraph keeps information about layoutparameters, */
|
2000-01-24 18:34:46 +00:00
|
|
|
bool IsDummy() const {
|
1999-09-27 18:44:28 +00:00
|
|
|
return (footnoteflag == LyXParagraph::NO_FOOTNOTE && previous
|
|
|
|
&& previous->footnoteflag != LyXParagraph::NO_FOOTNOTE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If I set a PExtra Indent on one paragraph of a ENV_LIST-TYPE
|
|
|
|
I have to set it on each of it's elements */
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
void SetPExtraType(int type, char const * width, char const * widthp);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void UnsetPExtraType();
|
2000-02-29 02:19:17 +00:00
|
|
|
#if 0
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
1999-12-07 00:44:53 +00:00
|
|
|
bool RoffContTableRows(ostream &, size_type i, int actcell);
|
2000-02-29 02:19:17 +00:00
|
|
|
#endif
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
2000-03-06 02:42:40 +00:00
|
|
|
bool linuxDocConvertChar(char c, string & sgml_string);
|
|
|
|
///
|
|
|
|
void DocBookContTableRows(ostream &, string & extra, int & desc_on,
|
1999-11-04 01:40:20 +00:00
|
|
|
size_type i,
|
|
|
|
int current_cell_number, int & column);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-06 02:42:40 +00:00
|
|
|
void SimpleDocBookOneTablePar(ostream &, string & extra,
|
|
|
|
int & desc_on, int depth);
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
/** A font entry covers a range of positions. Notice that the
|
|
|
|
entries in the list are inserted in random order.
|
|
|
|
I don't think it's worth the effort to implement a more effective
|
|
|
|
datastructure, because the number of different fonts in a paragraph
|
|
|
|
is limited. (Asger)
|
|
|
|
*/
|
|
|
|
struct FontTable {
|
1999-11-04 01:40:20 +00:00
|
|
|
/// Start position of paragraph this font attribute covers
|
|
|
|
size_type pos;
|
|
|
|
/// Ending position of paragraph this font attribute covers
|
|
|
|
size_type pos_end;
|
1999-09-27 18:44:28 +00:00
|
|
|
/** Font. Interpretation of the font values:
|
|
|
|
If a value is LyXFont::INHERIT_*, it means that the font
|
|
|
|
attribute is inherited from either the layout of this
|
|
|
|
paragraph or, in the case of nested paragraphs, from the
|
|
|
|
layout in the environment one level up until completely
|
|
|
|
resolved.
|
|
|
|
The values LyXFont::IGNORE_* and LyXFont::TOGGLE are NOT
|
|
|
|
allowed in these font tables.
|
|
|
|
*/
|
|
|
|
LyXFont font;
|
|
|
|
};
|
|
|
|
///
|
|
|
|
struct InsetTable {
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
size_type pos;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Inset * inset;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
|
|
|
typedef list<FontTable> FontList;
|
|
|
|
///
|
|
|
|
FontList fontlist;
|
2000-01-11 01:59:00 +00:00
|
|
|
///
|
|
|
|
typedef list<InsetTable> InsetList;
|
|
|
|
///
|
|
|
|
InsetList insetlist;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
|
|
|
LyXParagraph * TeXDeeper(ostream &, TexRow & texrow,
|
|
|
|
ostream & foot, TexRow & foot_texrow,
|
|
|
|
int & foot_count);
|
|
|
|
///
|
|
|
|
LyXParagraph * TeXFootnote(ostream &, TexRow & texrow,
|
|
|
|
ostream & foot, TexRow & foot_texrow,
|
|
|
|
int & foot_count,
|
|
|
|
LyXDirection par_direction);
|
|
|
|
///
|
|
|
|
bool SimpleTeXOneTablePar(ostream &, TexRow & texrow);
|
|
|
|
///
|
|
|
|
bool TeXContTableRows(ostream &, size_type i,
|
|
|
|
int current_cell_number,
|
|
|
|
int & column, TexRow & texrow);
|
|
|
|
///
|
|
|
|
void SimpleTeXBlanks(ostream &, TexRow & texrow,
|
|
|
|
size_type const i,
|
|
|
|
int & column, LyXFont const & font,
|
|
|
|
LyXLayout const & style);
|
|
|
|
///
|
|
|
|
void SimpleTeXSpecialChars(ostream &, TexRow & texrow,
|
|
|
|
LyXFont & font, LyXFont & running_font,
|
|
|
|
LyXFont & basefont, bool & open_font,
|
|
|
|
LyXLayout const & style,
|
|
|
|
size_type & i,
|
|
|
|
int & column, char const c);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
unsigned int id_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
static unsigned int paragraph_id;
|
|
|
|
};
|
|
|
|
#endif
|