* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
EM,
/// Math unit (18mu = 1em) for positioning in math mode
MU,
+ /// Percent of columnwidth both "%" or "%c"
+ PW,
+ PE,
+ /// Percent of pagewidth
+ PP,
+ /// Percent of linewidth
+ PL,
/// no unit
UNIT_NONE
};
/// conversion
virtual string const asString() const;
///
- virtual string const asLatexString() const {
- return this->asString();
- }
+ virtual string const asLatexString() const;
/** If "data" is valid, the length represented by it is
stored into "result", if that is not 0. */
extern LyXLength::UNIT unitFromString (string const & data);
///
extern bool isValidLength(string const & data, LyXLength * result);
+///
+extern const char * stringFromUnit(int unit);
/// LyXGlueLength class
class LyXGlueLength : public LyXLength {
/// VSpace class
class VSpace {
public:
- ///
+ /// The different kinds of spaces.
enum vspace_kind {
///
NONE,
///
LENGTH
};
- /// constructors
+ /// Constructor
VSpace() :
kin (NONE),
len(0.0, LyXLength::PT),
kp (false) {}
- ///
+ /// Constructor
explicit
- VSpace(vspace_kind k) :
+ VSpace(vspace_kind k) :
kin (k),
len (0.0, LyXLength::PT),
kp (false) {}
- ///
+ /// Constructor
explicit
VSpace(LyXGlueLength l) :
kin (LENGTH),
len (l),
kp (false) {}
- ///
+ /// Constructor
explicit
VSpace(float v, LyXLength::UNIT u) :
kin (LENGTH),
len (v, u),
kp (false) {}
- /// this constructor is for reading from a .lyx file
+ /// Constructor for reading from a .lyx file
explicit
VSpace(string const & data);
- // access functions
- vspace_kind kind() const { return kin; }
+ /// access functions
+ vspace_kind kind() const { return kin; }
///
- LyXLength length() const { return len; }
+ LyXGlueLength length() const { return len; }
// a flag that switches between \vspace and \vspace*
bool keep() const { return kp; }
///
int inPixels(BufferView * bv) const;
///
- int inPixels(int default_height, int default_skip) const;
+ int inPixels(int default_height, int default_skip, int default_width=0) const;
private:
- ///
+ /// This VSpace kind
vspace_kind kin;
///
LyXGlueLength len;