2001-06-25 00:06:33 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-06-10 21:04:06 +00:00
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
|
* \file Paragraph.h
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Asger Alstrup
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-10 21:04:06 +00:00
|
|
|
|
*/
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
#ifndef PARAGRAPH_H
|
|
|
|
|
#define PARAGRAPH_H
|
|
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
|
#include "FontEnums.h"
|
2007-10-23 21:41:17 +00:00
|
|
|
|
#include "LayoutPtr.h"
|
2002-08-07 16:31:45 +00:00
|
|
|
|
|
2007-10-13 09:48:18 +00:00
|
|
|
|
#include "insets/InsetCode.h"
|
2004-04-08 15:03:33 +00:00
|
|
|
|
|
2007-10-31 22:40:34 +00:00
|
|
|
|
#include "support/strfwd.h"
|
|
|
|
|
#include "support/types.h"
|
2002-08-07 16:31:45 +00:00
|
|
|
|
|
2007-10-18 15:29:51 +00:00
|
|
|
|
namespace lyx {
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
2007-10-18 15:29:51 +00:00
|
|
|
|
class AuthorList;
|
2003-05-28 06:47:15 +00:00
|
|
|
|
class Buffer;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
class BufferParams;
|
2007-10-18 15:29:51 +00:00
|
|
|
|
class Change;
|
2002-08-07 16:31:45 +00:00
|
|
|
|
class Counters;
|
2007-04-29 13:39:47 +00:00
|
|
|
|
class Inset;
|
2003-02-21 09:20:18 +00:00
|
|
|
|
class InsetBibitem;
|
2004-11-30 01:59:49 +00:00
|
|
|
|
class LaTeXFeatures;
|
2007-04-29 13:39:47 +00:00
|
|
|
|
class Inset_code;
|
2007-10-18 15:29:51 +00:00
|
|
|
|
class InsetList;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
class Language;
|
2007-04-29 18:17:15 +00:00
|
|
|
|
class Font;
|
|
|
|
|
class Font_size;
|
2004-11-30 01:59:49 +00:00
|
|
|
|
class MetricsInfo;
|
|
|
|
|
class OutputParams;
|
|
|
|
|
class PainterInfo;
|
2002-08-07 16:31:45 +00:00
|
|
|
|
class ParagraphParameters;
|
|
|
|
|
class TexRow;
|
2005-07-15 22:10:25 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2005-07-18 12:13:32 +00:00
|
|
|
|
class FontSpan {
|
|
|
|
|
public:
|
2005-07-18 14:25:20 +00:00
|
|
|
|
/// Invalid font span containing no character
|
|
|
|
|
FontSpan() : first(0), last(-1) {}
|
|
|
|
|
/// Span including first and last
|
2006-10-21 00:16:43 +00:00
|
|
|
|
FontSpan(pos_type f, pos_type l) : first(f), last(l) {}
|
2005-07-18 14:25:20 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/// Range including first and last.
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pos_type first, last;
|
2005-07-18 12:13:32 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-10-24 07:49:24 +00:00
|
|
|
|
///
|
|
|
|
|
enum TextCase {
|
|
|
|
|
///
|
|
|
|
|
text_lowercase = 0,
|
|
|
|
|
///
|
|
|
|
|
text_capitalization = 1,
|
|
|
|
|
///
|
|
|
|
|
text_uppercase = 2
|
|
|
|
|
};
|
|
|
|
|
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// A Paragraph holds all text, attributes and insets in a text paragraph
|
2007-10-24 15:32:43 +00:00
|
|
|
|
class Paragraph
|
|
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
Paragraph();
|
|
|
|
|
///
|
2003-05-25 08:49:48 +00:00
|
|
|
|
Paragraph(Paragraph const &);
|
|
|
|
|
///
|
2004-03-19 16:36:52 +00:00
|
|
|
|
Paragraph & operator=(Paragraph const &);
|
2004-01-26 10:13:15 +00:00
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
~Paragraph();
|
2003-10-14 13:01:49 +00:00
|
|
|
|
///
|
|
|
|
|
int id() const;
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
Language const * getParLanguage(BufferParams const &) const;
|
|
|
|
|
///
|
2007-09-04 10:27:55 +00:00
|
|
|
|
bool isRTL(BufferParams const &) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
void changeLanguage(BufferParams const & bparams,
|
|
|
|
|
Language const * from, Language const * to);
|
|
|
|
|
///
|
2004-02-25 12:00:53 +00:00
|
|
|
|
bool isMultiLingual(BufferParams const &) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2001-11-26 16:52:24 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
docstring const asString(Buffer const &, bool label) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
docstring const asString(Buffer const & buffer,
|
|
|
|
|
pos_type beg,
|
|
|
|
|
pos_type end,
|
2006-01-01 20:28:05 +00:00
|
|
|
|
bool label) const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const &, std::ostream &, BufferParams const &,
|
2003-09-06 18:38:02 +00:00
|
|
|
|
depth_type & depth) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
void validate(LaTeXFeatures &) const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-22 13:09:16 +00:00
|
|
|
|
bool latex(Buffer const &, BufferParams const &,
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const & outerfont, odocstream &,
|
2004-05-17 11:28:31 +00:00
|
|
|
|
TexRow & texrow, OutputParams const &) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2004-10-30 13:05:31 +00:00
|
|
|
|
/// Can we drop the standard paragraph wrapper?
|
2005-01-31 16:29:48 +00:00
|
|
|
|
bool emptyTag() const;
|
2004-10-30 13:05:31 +00:00
|
|
|
|
|
2006-08-23 11:16:08 +00:00
|
|
|
|
/// Get the id of the paragraph, usefull for docbook
|
2004-11-02 11:25:20 +00:00
|
|
|
|
std::string getID(Buffer const & buf,
|
|
|
|
|
OutputParams const & runparams) const;
|
2004-05-14 15:47:35 +00:00
|
|
|
|
|
2006-12-28 16:19:22 +00:00
|
|
|
|
/// Get the first word of a paragraph, return the position where it left
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pos_type getFirstWord(Buffer const & buf,
|
|
|
|
|
odocstream & os,
|
2004-10-24 23:53:42 +00:00
|
|
|
|
OutputParams const & runparams) const;
|
|
|
|
|
|
|
|
|
|
/// Writes to stream the docbook representation
|
2003-10-30 08:47:16 +00:00
|
|
|
|
void simpleDocBookOnePar(Buffer const & buf,
|
2006-10-21 00:16:43 +00:00
|
|
|
|
odocstream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const & runparams,
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const & outerfont,
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pos_type initial = 0) const;
|
2003-10-30 08:47:16 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-04-29 10:56:15 +00:00
|
|
|
|
bool hasSameLayout(Paragraph const & par) const;
|
2001-07-29 15:34:18 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-04-29 10:56:15 +00:00
|
|
|
|
void makeSameLayout(Paragraph const & par);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2004-04-08 15:03:33 +00:00
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void setInsetOwner(Inset * inset);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
|
Inset * inInset() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
|
InsetCode ownerCode() const;
|
2004-04-08 15:03:33 +00:00
|
|
|
|
///
|
|
|
|
|
bool forceDefaultParagraphs() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
pos_type size() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
bool empty() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2007-08-23 19:59:07 +00:00
|
|
|
|
LayoutPtr const & layout() const;
|
2002-03-02 16:39:54 +00:00
|
|
|
|
///
|
2007-08-23 19:59:07 +00:00
|
|
|
|
void layout(LayoutPtr const & new_layout);
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2003-10-08 17:44:32 +00:00
|
|
|
|
/// This is the item depth, only used by enumerate and itemize
|
|
|
|
|
signed char itemdepth;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// look up change at given pos
|
2007-01-08 22:21:57 +00:00
|
|
|
|
Change const & lookupChange(pos_type pos) const;
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// is there a change within the given range ?
|
2006-10-21 00:16:43 +00:00
|
|
|
|
bool isChanged(pos_type start, pos_type end) const;
|
2006-10-23 16:04:51 +00:00
|
|
|
|
/// is there an unchanged char at the given pos ?
|
2007-10-18 15:29:51 +00:00
|
|
|
|
bool isUnchanged(pos_type pos) const;
|
2006-10-22 17:02:23 +00:00
|
|
|
|
/// is there an insertion at the given pos ?
|
2007-10-18 15:29:51 +00:00
|
|
|
|
bool isInserted(pos_type pos) const;
|
2006-10-19 12:49:11 +00:00
|
|
|
|
/// is there a deletion at the given pos ?
|
2007-10-18 15:29:51 +00:00
|
|
|
|
bool isDeleted(pos_type pos) const;
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2006-11-24 21:16:46 +00:00
|
|
|
|
/// will the paragraph be physically merged with the next
|
|
|
|
|
/// one if the imaginary end-of-par character is logically deleted?
|
|
|
|
|
bool isMergedOnEndOfParDeletion(bool trackChanges) const;
|
|
|
|
|
|
2006-10-19 07:12:48 +00:00
|
|
|
|
/// set change for the entire par
|
|
|
|
|
void setChange(Change const & change);
|
|
|
|
|
|
2006-05-08 20:30:52 +00:00
|
|
|
|
/// set change at given pos
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void setChange(pos_type pos, Change const & change);
|
2003-03-04 19:52:35 +00:00
|
|
|
|
|
2006-10-24 06:11:45 +00:00
|
|
|
|
/// accept changes within the given range
|
2007-01-23 21:53:16 +00:00
|
|
|
|
void acceptChanges(BufferParams const & bparams, pos_type start, pos_type end);
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
2006-10-24 21:38:47 +00:00
|
|
|
|
/// reject changes within the given range
|
2007-01-23 21:53:16 +00:00
|
|
|
|
void rejectChanges(BufferParams const & bparams, pos_type start, pos_type end);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-05-29 11:19:52 +00:00
|
|
|
|
/// Paragraphs can contain "manual labels", for example, Description
|
|
|
|
|
/// environment. The text for this user-editable label is stored in
|
|
|
|
|
/// the paragraph alongside the text of the rest of the paragraph
|
|
|
|
|
/// (the body). This function returns the starting position of the
|
|
|
|
|
/// body of the text in the paragraph.
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pos_type beginOfBody() const;
|
2003-11-13 13:43:44 +00:00
|
|
|
|
/// recompute this value
|
|
|
|
|
void setBeginOfBody();
|
2003-03-09 12:37:22 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
docstring const & getLabelstring() const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// the next two functions are for the manual labels
|
2006-10-21 00:16:43 +00:00
|
|
|
|
docstring const getLabelWidthString() const;
|
2007-01-15 16:58:14 +00:00
|
|
|
|
/// Set label width string.
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void setLabelWidthString(docstring const & s);
|
2007-01-15 16:58:14 +00:00
|
|
|
|
/// translate \p label to the paragraph language if possible.
|
|
|
|
|
docstring const translateIfPossible(docstring const & label,
|
|
|
|
|
BufferParams const & bparams) const;
|
|
|
|
|
/// Expand the counters for the labelstring of \c layout
|
2007-08-23 19:59:07 +00:00
|
|
|
|
docstring expandLabel(LayoutPtr const &, BufferParams const &,
|
2007-01-15 16:58:14 +00:00
|
|
|
|
bool process_appendix = true) const;
|
2006-12-17 10:11:28 +00:00
|
|
|
|
/// Actual paragraph alignment used
|
2001-06-25 00:06:33 +00:00
|
|
|
|
char getAlign() const;
|
2002-02-28 15:07:11 +00:00
|
|
|
|
/// The nesting depth of a paragraph
|
2001-06-25 00:06:33 +00:00
|
|
|
|
depth_type getDepth() const;
|
2002-02-28 15:07:11 +00:00
|
|
|
|
/// The maximal possible depth of a paragraph after this one
|
2002-06-24 20:28:12 +00:00
|
|
|
|
depth_type getMaxDepthAfter() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-08-23 19:59:07 +00:00
|
|
|
|
void applyLayout(LayoutPtr const & new_layout);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2006-10-22 14:36:08 +00:00
|
|
|
|
/// (logically) erase the char at pos; return true if it was actually erased
|
2006-10-21 17:05:20 +00:00
|
|
|
|
bool eraseChar(pos_type pos, bool trackChanges);
|
2006-10-22 14:36:08 +00:00
|
|
|
|
/// (logically) erase the given range; return the number of chars actually erased
|
|
|
|
|
int eraseChars(pos_type start, pos_type end, bool trackChanges);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
|
///
|
|
|
|
|
void resetFonts(Font const & font);
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/** Get uninstantiated font setting. Returns the difference
|
2001-06-25 00:06:33 +00:00
|
|
|
|
between the characters font and the layoutfont.
|
|
|
|
|
This is what is stored in the fonttable
|
|
|
|
|
*/
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const
|
2006-10-21 00:16:43 +00:00
|
|
|
|
getFontSettings(BufferParams const &, pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const getFirstFontSettings(BufferParams const &) const;
|
2001-06-25 00:06:33 +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
|
2007-10-28 18:51:54 +00:00
|
|
|
|
attributes with values FONT_INHERIT, FONT_IGNORE or
|
|
|
|
|
FONT_TOGGLE.
|
2001-06-25 00:06:33 +00:00
|
|
|
|
*/
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const getFont(BufferParams const &, pos_type pos,
|
|
|
|
|
Font const & outerfont) const;
|
|
|
|
|
Font const getLayoutFont(BufferParams const &,
|
|
|
|
|
Font const & outerfont) const;
|
|
|
|
|
Font const getLabelFont(BufferParams const &,
|
|
|
|
|
Font const & outerfont) const;
|
2003-07-27 10:42:11 +00:00
|
|
|
|
/**
|
|
|
|
|
* The font returned by the above functions is the same in a
|
2005-06-10 14:55:01 +00:00
|
|
|
|
* span of characters. This method will return the first and
|
2005-07-18 12:13:32 +00:00
|
|
|
|
* the last positions in the paragraph for which that font is
|
2006-12-28 16:19:22 +00:00
|
|
|
|
* the same. This can be used to avoid unnecessary calls to getFont.
|
2003-07-27 10:42:11 +00:00
|
|
|
|
*/
|
2006-10-21 00:16:43 +00:00
|
|
|
|
FontSpan fontSpan(pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
char_type getChar(pos_type pos) const;
|
2005-01-31 16:29:48 +00:00
|
|
|
|
/// Get the char, but mirror all bracket characters if it is right-to-left
|
2007-10-24 07:08:55 +00:00
|
|
|
|
char_type getUChar(BufferParams const &, pos_type pos) const;
|
2002-05-30 03:37:24 +00:00
|
|
|
|
/// pos <= size() (there is a dummy font change at the end of each par)
|
2007-04-29 18:17:15 +00:00
|
|
|
|
void setFont(pos_type pos, Font const & font);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// Returns the height of the highest font in range
|
2007-10-28 18:51:54 +00:00
|
|
|
|
FontSize highestFontInRange(pos_type startpos,
|
|
|
|
|
pos_type endpos, FontSize def_size) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void insert(pos_type pos, docstring const & str,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
Font const & font, Change const & change);
|
2007-10-22 13:09:16 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
void appendString(docstring const & s, Font const & font,
|
|
|
|
|
Change const & change);
|
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
void appendChar(char_type c, Font const & font, Change const & change);
|
2003-11-04 12:01:15 +00:00
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
void insertChar(pos_type pos, char_type c, bool trackChanges);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
void insertChar(pos_type pos, char_type c,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
Font const &, bool trackChanges);
|
2006-10-20 11:44:58 +00:00
|
|
|
|
///
|
2007-10-24 07:08:55 +00:00
|
|
|
|
void insertChar(pos_type pos, char_type c,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
Font const &, Change const & change);
|
2001-07-27 12:03:36 +00:00
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void insertInset(pos_type pos, Inset * inset,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
Change const & change);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
|
void insertInset(pos_type pos, Inset * inset,
|
2007-05-28 22:27:45 +00:00
|
|
|
|
Font const &, Change const & change);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
|
bool insetAllowed(InsetCode code);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-18 15:29:51 +00:00
|
|
|
|
Inset * getInset(pos_type pos);
|
2005-01-31 16:29:48 +00:00
|
|
|
|
///
|
2007-10-18 15:29:51 +00:00
|
|
|
|
Inset const * getInset(pos_type pos) const;
|
|
|
|
|
|
|
|
|
|
/// Release inset at given position.
|
|
|
|
|
/// \warning does not honour change tracking!
|
|
|
|
|
/// Therefore, it should only be used for breaking and merging
|
|
|
|
|
/// paragraphs
|
|
|
|
|
Inset * releaseInset(pos_type pos);
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
InsetList const & insetList() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2007-10-13 09:48:18 +00:00
|
|
|
|
bool isHfill(pos_type pos) const;
|
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
/// hinted by profiler
|
2007-10-24 07:08:55 +00:00
|
|
|
|
bool isInset(pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
bool isNewline(pos_type pos) const;
|
2005-07-18 12:57:08 +00:00
|
|
|
|
/// return true if the char is a word separator
|
2007-10-24 07:08:55 +00:00
|
|
|
|
bool isSeparator(pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
bool isLineSeparator(pos_type pos) const;
|
2006-12-28 16:19:22 +00:00
|
|
|
|
/// True if the character/inset at this point can be part of a word.
|
|
|
|
|
/// Note that digits in particular are considered as letters
|
2006-10-21 00:16:43 +00:00
|
|
|
|
bool isLetter(pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2007-05-28 22:27:45 +00:00
|
|
|
|
/// returns true if at least one line break or line separator has been deleted
|
2007-01-21 21:11:27 +00:00
|
|
|
|
/// at the beginning of the paragraph (either physically or logically)
|
|
|
|
|
bool stripLeadingSpaces(bool trackChanges);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-06-07 17:45:43 +00:00
|
|
|
|
/// return true if we allow multiple spaces
|
2001-11-29 16:29:30 +00:00
|
|
|
|
bool isFreeSpacing() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-06-07 17:45:43 +00:00
|
|
|
|
/// return true if we allow this par to stay empty
|
|
|
|
|
bool allowEmpty() const;
|
2005-04-26 11:12:20 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
char_type transformChar(char_type c, pos_type pos) const;
|
2002-03-02 16:39:54 +00:00
|
|
|
|
///
|
2002-08-11 15:03:52 +00:00
|
|
|
|
ParagraphParameters & params();
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2002-08-11 15:03:52 +00:00
|
|
|
|
ParagraphParameters const & params() const;
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2007-05-19 19:29:50 +00:00
|
|
|
|
/// Check if we are in a Biblio environment and insert or
|
|
|
|
|
/// delete InsetBibitems as necessary.
|
|
|
|
|
/// \retval int 1, if we had to add an inset, in which case
|
|
|
|
|
/// the cursor will need to move cursor forward; -pos, if we deleted
|
|
|
|
|
/// an inset, in which case pos is the position from which the inset
|
|
|
|
|
/// was deleted, and the cursor will need to be moved back one if it
|
|
|
|
|
/// was previously past that position. Return 0 otherwise.
|
|
|
|
|
int checkBiblio(bool track_changes);
|
2006-12-29 23:54:48 +00:00
|
|
|
|
|
2007-07-09 20:52:34 +00:00
|
|
|
|
/// For each author, set 'used' to true if there is a change
|
|
|
|
|
/// by this author in the paragraph.
|
|
|
|
|
void checkAuthors(AuthorList const & authorList);
|
|
|
|
|
|
2007-10-24 07:49:24 +00:00
|
|
|
|
///
|
|
|
|
|
void changeCase(BufferParams const & bparams, pos_type pos,
|
2008-01-28 10:50:24 +00:00
|
|
|
|
pos_type & right, TextCase action);
|
2007-10-24 07:49:24 +00:00
|
|
|
|
|
2007-10-24 08:22:26 +00:00
|
|
|
|
/// find \param str string inside Paragraph.
|
|
|
|
|
/// \return true if the specified string is at the specified position
|
|
|
|
|
/// \param del specifies whether deleted strings in ct mode will be considered
|
|
|
|
|
bool find(
|
|
|
|
|
docstring const & str, ///< string to search
|
|
|
|
|
bool cs, ///<
|
|
|
|
|
bool mw, ///<
|
|
|
|
|
pos_type pos, ///< start from here.
|
|
|
|
|
bool del = true) const;
|
|
|
|
|
|
2007-10-21 10:50:56 +00:00
|
|
|
|
private:
|
2005-07-18 12:57:08 +00:00
|
|
|
|
/// Pimpl away stuff
|
2007-10-19 08:57:22 +00:00
|
|
|
|
class Private;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-19 08:57:22 +00:00
|
|
|
|
friend class Paragraph::Private;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2007-10-19 08:57:22 +00:00
|
|
|
|
Private * d;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
#endif // PARAGRAPH_H
|