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-10-22 16:30:57 +00:00
|
|
|
|
void endpos(lyx::pos_type p);
|
2003-08-22 07:49:57 +00:00
|
|
|
|
///
|
2003-10-22 16:30:57 +00:00
|
|
|
|
lyx::pos_type endpos() const;
|
2003-08-22 07:49:57 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int height() const { return ascent_ + descent_; }
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void width(int w);
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int width() const;
|
2000-06-26 15:10:49 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void ascent(int b);
|
2000-06-26 15:10:49 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int ascent() const;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void descent(int b) { descent_ = b; }
|
2000-06-08 23:16:16 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int descent() const { return descent_; }
|
2003-08-01 14:12:04 +00:00
|
|
|
|
/// current debugging only
|
|
|
|
|
void dump(const char * = "") const;
|
2004-03-01 12:23:17 +00:00
|
|
|
|
|
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_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int ascent_;
|
2000-04-26 13:57:28 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int descent_;
|
2000-04-26 13:57:28 +00:00
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int width_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2004-03-01 12:23:17 +00:00
|
|
|
|
|
|
|
|
|
class RowMetrics {
|
|
|
|
|
public:
|
|
|
|
|
RowMetrics();
|
|
|
|
|
/// width of a separator (i.e. space)
|
|
|
|
|
double separator;
|
|
|
|
|
/// width of hfills in the body
|
|
|
|
|
double hfill;
|
|
|
|
|
/// width of hfills in the label
|
|
|
|
|
double label_hfill;
|
|
|
|
|
/// the x position of the row
|
|
|
|
|
double x;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|