// -*- C++ -*- /* This file is part of *====================================================== * *LyX,TheDocumentProcessor * *Copyright(C)1995MatthiasEttrich *Copyright(C)1995-1998TheLyXTeam. *
*======================================================*/ #ifndef _LYXPARAGRAPH_H #define _LYXPARAGRAPH_H
#ifdef __GNUG__ #pragma interface #endif
#include"definitions.h" #include"lyxinset.h" #include"table.h" #include"textutils.h" #include"vspace.h" #include"insetbib.h" //#include "LString.h" class BufferParams; class LyXBuffer; class LyXLayout; class TexRow; struct LaTeXFeatures;
/// A LyXParagraph holds all text, attributes and insets in a text paragraph class LyXParagraph { public:
///
LyXParagraph(); /// this konstruktor inserts the new paragraph in a list
LyXParagraph(LyXParagraph *par); /// the destruktors removes the new paragraph from the list
~LyXParagraph();
/// int GetID(){ return id;
} /// void SetID(int id_arg){
id = id_arg;
}
/** allocates more memory for the specified paragraph posisneededtospecifytheparagraphcorrectly.Rememberthe closedfootnotes
*/ void Enlarge(int pos, int number);
/** make the allocated memory fit to the needed size usedtomakeaparagraphsmaller
*/ void FitSize();
/// Is it the first par with same depth and layout? bool IsFirstInSequence() {
LyXParagraph *dhook = DepthHook(GetDepth()); return (dhook == this
|| dhook->GetLayout() != GetLayout()
|| dhook->GetDepth() != GetDepth());
}
//@Man: the LyX- DTP-switches //@{ /// bool line_top;
/// bool line_bottom;
/// bool pagebreak_top;
/// bool pagebreak_bottom;
/// char align;
/// char depth;
/// bool noindent;
/// unsignedchar counter[10];
/// bool start_of_appendix;
/// bool appendix;
/// char enumdepth;
/// char itemdepth;
/* This is for the paragraph extra stuff */ /// int pextra_type; ///
LString pextra_width; ///
LString pextra_widthp; /// int pextra_alignment; /// bool pextra_hfill; /// bool pextra_start_minipage;
///
LString labelstring;
///
LString labelwidthstring; //@}
/// int last; ///
LyXParagraph *next; ///
LyXParagraph *previous;
/** these function are able to hide closed footnotes
*/
LyXParagraph *Next();
///
LyXParagraph *Previous();
/** these function are able to hide open and closed footnotes
*/
LyXParagraph *NextAfterFootnote(); ///
LyXParagraph *PreviousBeforeFootnote(); ///
LyXParagraph *LastPhysicalPar(); ///
LyXParagraph *FirstPhysicalPar();
/// returns the physical paragraph
LyXParagraph *ParFromPos(int pos); /// returns the position in the physical par int PositionInParFromPos(int pos);
/// for the environments
LyXParagraph* DepthHook(int depth); /// int BeginningOfMainBody(); ///
LString GetLabelString();
/// the next two functions are for the manual labels
LString GetLabelWidthString(); /// void SetLabelWidthString(const LString &s); /// int GetLayout(); /// char GetAlign(); /// char GetDepth(); /// void SetLayout(char new_layout); /// void SetOnlyLayout(char new_layout); /// unsignedchar GetCounter(int i); /// int Last();
/** This one resets all layout and dtp switches but not the font ofthesinglecharacters
*/ void Clear(); /// void Erase(int pos);
/** the flag determines wether the layout should be copied
*/ void BreakParagraph(int pos, int flag); /// void BreakParagraphConservative(int pos);
/** paste this paragraph with the next one becarefull,thisdoesentmakeanycheckatall
*/ void PasteParagraph();
/** Get unistantiated font setting. Returns the difference betweenthecharactersfontandthelayoutfont. Thisiswhatisstoredinthefonttable
*/
LyXFont GetFontSettings(int pos);
/** Get fully instantiated font. If pos == -1, use the layout fontattachedtothisparagraph. Ifpos==-2,usethelabelfontofthelayoutattachedhere. Inallcases,thefontisinstantiated,i.e.doesnothaveany attributeswithvaluesLyXFont::INHERIT,LyXFont::IGNOREor LyXFont::TOGGLE.
*/
LyXFont getFont(int pos);
/// char GetChar(int pos); ///
LString GetWord(int &); /// void SetFont(int pos, LyXFont const & font); /// Returns the height of the highest font in range
LyXFont::FONT_SIZE HighestFontInRange(int startpos, int endpos) const; /// void InsertChar(int pos, char c); /// void InsertInset(int pos, Inset *inset); ///
Inset* GetInset(int pos);
/// used to remove the error messages int AutoDeleteInsets();
///
Inset* ReturnNextInsetPointer(int &pos);
/// returns -1 if inset not found int GetPositionOfInset(Inset* inset);
/// ok and now some footnote functions void OpenFootnotes(); /// void OpenFootnote(int pos); /// void CloseFootnotes(); /// void CloseFootnote(int pos);
/// important for cut and paste void CopyIntoMinibuffer(int pos); /// void CutIntoMinibuffer(int pos); /// void InsertFromMinibuffer(int pos);
/// int ClearParagraph(){ int i=0; if (!IsDummy() && !table){ while (Last()
&& (IsNewline(0)
|| IsLineSeparator(0))){
Erase(0);
i++;
}
} return i;
}
/** A paragraph following a footnote is a "dummy". A paragraph withafootnoteinitisstoredasthreeparagraphs: Firstaparagraphwiththetextuptothefootnote,then one(ormore)paragraphswiththefootnote,andfinally theaparagraphwiththetextafterthefootnote.Onlythe
first paragraph keeps information about layoutparameters, */ bool IsDummy(){ 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 */ /// void SetPExtraType(int type, constchar *width, constchar *widthp); /// void UnsetPExtraType(); /// bool RoffContTableRows(FILE *file, int i, int actcell); private: /** A font entry covers a range of positions. Notice that the entriesinthelistareinsertedinrandomorder. Idon'tthinkit'sworththeefforttoimplementamoreeffective datastructure,becausethenumberofdifferentfontsinaparagraph islimited.(Asger)
*/ struct FontTable { /// Start position of paragraph this font attribute covers int pos; /// Ending position of paragraph this font attribute covers int pos_end;
/** Font. Interpretation of the font values: IfavalueisLyXFont::INHERIT_*,itmeansthatthefont attributeisinheritedfromeitherthelayoutofthis paragraphor,inthecaseofnestedparagraphs,fromthe layoutintheenvironmentonelevelupuntilcompletely resolved. ThevaluesLyXFont::IGNORE_*andLyXFont::TOGGLEareNOT allowedinthesefonttables.
*/
LyXFont font; /// Pointer to next font entry
FontTable *next;
}; /// struct InsetTable { /// int pos; ///
Inset *inset; ///
InsetTable *next;
}; ///
FontTable *fonttable; ///
InsetTable *insettable; ///
LyXParagraph * TeXDeeper(LString &file, TexRow &texrow,
LString &foot, TexRow &foot_texrow, int &foot_count); ///
LyXParagraph * TeXFootnote(LString &file, TexRow &texrow,
LString &foot, TexRow &foot_texrow, int &foot_count); /// bool SimpleTeXOnePar(LString &file, TexRow &texrow); /// bool SimpleTeXOneTablePar(LString &file, TexRow &texrow); /// bool TeXContTableRows(LString &file, int i, int current_cell_number, int &column, TexRow &texrow); /// void SimpleTeXBlanks(LString &file, TexRow &texrow, intconst i, int &column, LyXFont const &font,
LyXLayout const * const style); /// void SimpleTeXSpecialChars(LString &file, TexRow &texrow,
LyXFont &font, LyXFont &running_font,
LyXFont &basefont, bool &open_font,
LyXLayout const * const style, int &i, int &column, charconst c); /// int id; /// staticunsignedint paragraph_id;
};
#endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.