1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-02-14 00:41:44 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file lyxrow.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-04-01 16:55:48 +00:00
|
|
|
|
* \author Matthias Ettrich
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-02-14 00:41:44 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*
|
2003-02-14 00:41:44 +00:00
|
|
|
|
* Metrics for an on-screen text row.
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
|
#ifndef LYXROW_H
|
|
|
|
|
#define LYXROW_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-04-02 23:01:39 +00:00
|
|
|
|
#include "ParagraphList.h"
|
2001-11-26 16:42:04 +00:00
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
class Row {
|
|
|
|
|
public:
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
Row();
|
2003-03-29 23:11:20 +00:00
|
|
|
|
///
|
2003-07-22 15:12:04 +00:00
|
|
|
|
Row(ParagraphList::iterator pit, lyx::pos_type pos);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2003-04-02 23:01:39 +00:00
|
|
|
|
void par(ParagraphList::iterator pit);
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2003-04-02 23:01:39 +00:00
|
|
|
|
ParagraphList::iterator par();
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2003-04-02 23:01:39 +00:00
|
|
|
|
ParagraphList::iterator par() const;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
void pos(lyx::pos_type p);
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type pos() const;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
|
|
|
|
void fill(int f);
|
|
|
|
|
///
|
|
|
|
|
int fill() const;
|
|
|
|
|
///
|
|
|
|
|
void height(unsigned short h);
|
|
|
|
|
///
|
|
|
|
|
unsigned short height() const;
|
|
|
|
|
///
|
2000-06-26 15:10:49 +00:00
|
|
|
|
void width(unsigned int w);
|
|
|
|
|
///
|
|
|
|
|
unsigned int width() const;
|
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
void ascent_of_text(unsigned short a);
|
|
|
|
|
///
|
|
|
|
|
unsigned short ascent_of_text() const;
|
|
|
|
|
///
|
2003-02-08 19:18:01 +00:00
|
|
|
|
void top_of_text(unsigned int top);
|
|
|
|
|
///
|
|
|
|
|
unsigned int top_of_text() const;
|
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
void baseline(unsigned int b);
|
|
|
|
|
///
|
|
|
|
|
unsigned int baseline() const;
|
2003-02-26 17:04:10 +00:00
|
|
|
|
/// return true if this row is the start of a paragraph
|
|
|
|
|
bool isParStart() const;
|
2003-04-12 23:03:05 +00:00
|
|
|
|
/// return the cached y position
|
|
|
|
|
unsigned int y() const;
|
|
|
|
|
/// cache the y position
|
|
|
|
|
void y(unsigned int newy);
|
2000-06-08 23:16:16 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2003-04-02 23:01:39 +00:00
|
|
|
|
ParagraphList::iterator pit_;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type pos_;
|
2003-07-22 15:12:04 +00:00
|
|
|
|
/** what is missing to a full row. Can be negative.
|
1999-09-27 18:44:28 +00:00
|
|
|
|
Needed for hfills, flushright, block etc. */
|
2000-06-08 23:16:16 +00:00
|
|
|
|
mutable int fill_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
unsigned short height_;
|
2000-04-26 13:57:28 +00:00
|
|
|
|
///
|
2000-06-26 15:10:49 +00:00
|
|
|
|
unsigned int width_;
|
2003-04-12 23:03:05 +00:00
|
|
|
|
/// cached y position
|
|
|
|
|
unsigned int y_;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// ascent from baseline including prelude space
|
2000-06-08 23:16:16 +00:00
|
|
|
|
unsigned short ascent_of_text_;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// the top of the real text in the row
|
|
|
|
|
unsigned int top_of_text_;
|
2000-04-26 13:57:28 +00:00
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
unsigned int baseline_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|