-inline
-bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2)
-{
- return l1.value() == l2.value()
- && l1.unit() == l2.unit()
- && l1.plusValue() == l2.plusValue()
- && l1.plusUnit() == l2.plusUnit()
- && l1.minusValue() == l2.minusValue()
- && l1.minusUnit() == l2.minusUnit();
-}
-
-
-
-extern bool isValidGlueLength(string const & data, LyXGlueLength * result);
-
-/// VSpace class
-class VSpace {
-public:
- ///
- enum vspace_kind { NONE, DEFSKIP,
- SMALLSKIP, MEDSKIP, BIGSKIP,
- VFILL, LENGTH };
- /// constructors
- VSpace() :
- kin (NONE),
- len(0.0, LyXLength::PT),
- kp (false) {}
- ///
- explicit
- VSpace(vspace_kind k) :
- kin (k),
- len (0.0, LyXLength::PT),
- kp (false) {}
- ///
- explicit
- VSpace(LyXGlueLength l) :
- kin (LENGTH),
- len (l),
- kp (false) {}
-
- ///
- explicit
- VSpace(float v, LyXLength::UNIT u) :
- kin (LENGTH),
- len (v, u),
- kp (false) {}
-
- /// this constructor is for reading from a .lyx file
- explicit
- VSpace(string const & data);
-
- // access functions
- vspace_kind kind() const { return kin; }
- ///
- LyXLength length() const { return len; }
-
- // a flag that switches between \vspace and \vspace*
- bool keep() const { return kp; }
- ///
- void setKeep(bool val) { kp = val; }
- ///
- bool operator == (VSpace const &) const;
-
- // conversion
- ///
- string asLyXCommand() const; // how it goes into the LyX file
- ///
- string asLatexCommand(BufferParams const & params) const;
- ///
- int inPixels(BufferView * bv) const;
- ///
- int inPixels(int default_height, int default_skip) const;
-private:
- ///
- vspace_kind kin;
- ///
- LyXGlueLength len;
- ///
- bool kp;
-};