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-08-23 00:17:00 +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
|
|
|
|
|
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-08-14 08:34:13 +00:00
|
|
|
|
Row(lyx::pos_type pos);
|
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
|
|
|
|
///
|
2003-08-22 07:49:57 +00:00
|
|
|
|
void end(lyx::pos_type p);
|
|
|
|
|
///
|
|
|
|
|
lyx::pos_type end() const;
|
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
|
void fill(int f);
|
|
|
|
|
///
|
|
|
|
|
int fill() const;
|
|
|
|
|
///
|
2003-08-26 14:50:16 +00:00
|
|
|
|
void height(unsigned int h) { height_ = h; }
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2003-08-26 14:50:16 +00:00
|
|
|
|
unsigned int height() const { return height_; }
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2000-06-26 15:10:49 +00:00
|
|
|
|
void width(unsigned int w);
|
|
|
|
|
///
|
|
|
|
|
unsigned int width() const;
|
|
|
|
|
///
|
2003-08-26 14:50:16 +00:00
|
|
|
|
void ascent_of_text(unsigned int a);
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2003-08-26 14:50:16 +00:00
|
|
|
|
unsigned int ascent_of_text() const;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
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
|
2003-08-26 14:50:16 +00:00
|
|
|
|
unsigned int y() const { return y_; }
|
2003-04-12 23:03:05 +00:00
|
|
|
|
/// cache the y position
|
2003-08-26 14:50:16 +00:00
|
|
|
|
void y(unsigned int newy) { y_ = newy; }
|
2003-08-22 09:40:56 +00:00
|
|
|
|
///
|
|
|
|
|
float x() const;
|
|
|
|
|
///
|
|
|
|
|
void x(float);
|
|
|
|
|
///
|
|
|
|
|
float fill_separator() const;
|
|
|
|
|
///
|
|
|
|
|
void fill_separator(float);
|
|
|
|
|
///
|
|
|
|
|
float fill_hfill() const;
|
|
|
|
|
///
|
|
|
|
|
void fill_hfill(float);
|
|
|
|
|
///
|
|
|
|
|
float fill_label_hfill() const;
|
|
|
|
|
///
|
|
|
|
|
void fill_label_hfill(float);
|
2003-08-01 14:12:04 +00:00
|
|
|
|
/// current debugging only
|
|
|
|
|
void dump(const char * = "") const;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
private:
|
2003-08-22 07:49:57 +00:00
|
|
|
|
/// first pos covered by this row
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type pos_;
|
2003-08-22 07:49:57 +00:00
|
|
|
|
/// one behind last pos covered by this row
|
|
|
|
|
lyx::pos_type end_;
|
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
|
|
|
|
///
|
2003-08-26 14:50:16 +00:00
|
|
|
|
unsigned int 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_;
|
2003-08-22 09:40:56 +00:00
|
|
|
|
/// offet from left border
|
|
|
|
|
float x_;
|
|
|
|
|
///
|
|
|
|
|
float fill_separator_;
|
|
|
|
|
///
|
|
|
|
|
float fill_hfill_;
|
|
|
|
|
///
|
|
|
|
|
float fill_label_hfill_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|