2002-08-20 19:41:13 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-12 14:58:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file paragraph_funcs.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-21 17:35:24 +00:00
|
|
|
|
*
|
2002-09-12 14:58:06 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-08-21 17:35:24 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-12 14:58:06 +00:00
|
|
|
|
*/
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
|
|
|
|
#ifndef PARAGRAPH_FUNCS_H
|
|
|
|
|
#define PARAGRAPH_FUNCS_H
|
|
|
|
|
|
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2003-03-03 21:15:49 +00:00
|
|
|
|
class Buffer;
|
2002-08-20 19:41:13 +00:00
|
|
|
|
class BufferParams;
|
2007-04-29 13:39:47 +00:00
|
|
|
|
class Inset;
|
2007-04-29 18:17:15 +00:00
|
|
|
|
class Font;
|
2004-03-25 09:16:36 +00:00
|
|
|
|
class Paragraph;
|
2007-04-26 08:30:11 +00:00
|
|
|
|
class ParagraphList;
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2005-01-31 16:29:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* This breaks a paragraph at the specified position.
|
|
|
|
|
* The new paragraph will:
|
2007-10-08 13:35:16 +00:00
|
|
|
|
* - Decrease depth by one (or chenge layout to default layout when
|
|
|
|
|
* keep_layout == false
|
|
|
|
|
* - keep current depth and layout when keep_layout == true
|
2005-01-31 16:29:48 +00:00
|
|
|
|
* Be aware that the old or new paragraph does not contain any rows
|
|
|
|
|
* after this.
|
|
|
|
|
*/
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void breakParagraph(BufferParams const & bparams,
|
|
|
|
|
ParagraphList & paragraphs,
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pit_type par,
|
|
|
|
|
pos_type pos,
|
2007-10-08 13:35:16 +00:00
|
|
|
|
bool keep_layout);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void breakParagraphConservative(BufferParams const & bparams,
|
|
|
|
|
ParagraphList & paragraphs,
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pit_type par,
|
|
|
|
|
pos_type pos);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2002-10-21 16:21:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* Append the next paragraph onto the tail of this one.
|
|
|
|
|
* Be careful, this doesent make any check at all.
|
|
|
|
|
*/
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void mergeParagraph(BufferParams const & bparams,
|
2006-10-21 00:16:43 +00:00
|
|
|
|
ParagraphList & paragraphs, pit_type par);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2003-04-16 08:12:22 +00:00
|
|
|
|
|
2002-08-20 19:41:13 +00:00
|
|
|
|
/// for the environments
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pit_type depthHook(pit_type par,
|
|
|
|
|
ParagraphList const & plist, depth_type depth);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pit_type outerHook(pit_type par, ParagraphList const & plist);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
|
|
|
|
/// Is it the first par with same depth and layout?
|
2006-10-21 00:16:43 +00:00
|
|
|
|
bool isFirstInSequence(pit_type par, ParagraphList const & plist);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
|
|
|
|
/** Check if the current paragraph is the last paragraph in a
|
|
|
|
|
proof environment */
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int getEndLabel(pit_type par, ParagraphList const & plist);
|
2003-03-12 11:52:23 +00:00
|
|
|
|
|
2007-01-07 17:58:36 +00:00
|
|
|
|
/**
|
|
|
|
|
* Get the font of the "environment" of paragraph \p par_offset in \p pars.
|
|
|
|
|
* All font changes of the paragraph are relative to this font.
|
|
|
|
|
*/
|
2007-04-29 18:17:15 +00:00
|
|
|
|
Font const outerFont(pit_type par_offset, ParagraphList const & pars);
|
2003-08-26 14:50:16 +00:00
|
|
|
|
|
2004-11-19 16:17:52 +00:00
|
|
|
|
/// return the number of InsetOptArg in a paragraph
|
|
|
|
|
int numberOfOptArgs(Paragraph const & par);
|
|
|
|
|
|
2007-06-26 14:11:42 +00:00
|
|
|
|
/// accept the changes within the complete ParagraphList
|
|
|
|
|
void acceptChanges(ParagraphList & pars, BufferParams const & bparams);
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2002-09-12 14:58:06 +00:00
|
|
|
|
#endif // PARAGRAPH_FUNCS_H
|