-/// 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) {}
-
- 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;
-};