1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-10-07 18:44:17 +00:00
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
2000-02-04 09:38:32 +00:00
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-10-07 18:44:17 +00:00
|
|
|
*
|
1999-11-15 12:01:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-07 18:44:17 +00:00
|
|
|
#ifndef SPACING_H
|
|
|
|
#define SPACING_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-03-28 02:18:55 +00:00
|
|
|
#include <iosfwd>
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2000-04-19 01:42:55 +00:00
|
|
|
#include "LString.h"
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
class Spacing {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
enum Space {
|
|
|
|
///
|
|
|
|
Single,
|
|
|
|
///
|
|
|
|
Onehalf,
|
|
|
|
///
|
|
|
|
Double,
|
|
|
|
///
|
2000-04-11 22:55:29 +00:00
|
|
|
Other,
|
|
|
|
///
|
|
|
|
Default
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
///
|
2000-04-11 22:55:29 +00:00
|
|
|
Spacing() : space(Single), value(1.0) {}
|
|
|
|
///
|
|
|
|
bool isDefault() const {
|
|
|
|
return space == Default;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
///
|
2000-03-28 02:18:55 +00:00
|
|
|
float getValue() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-28 02:18:55 +00:00
|
|
|
Spacing::Space getSpace() const { return space; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-28 02:18:55 +00:00
|
|
|
void set(Spacing::Space sp, float val = 1.0);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-28 02:18:55 +00:00
|
|
|
void set(Spacing::Space sp, char const * val) ;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-04-11 22:55:29 +00:00
|
|
|
void writeFile(std::ostream &, bool para = false) const;
|
|
|
|
///
|
2000-04-19 01:42:55 +00:00
|
|
|
string writeEnvirBegin() const;
|
|
|
|
///
|
|
|
|
string writeEnvirEnd() const;
|
|
|
|
///
|
2000-04-11 22:55:29 +00:00
|
|
|
friend bool operator==(Spacing const & a, Spacing const & b) {
|
2000-06-08 23:16:16 +00:00
|
|
|
return a.space == b.space && a.getValue() == b.getValue();
|
2000-04-11 22:55:29 +00:00
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-04 09:38:32 +00:00
|
|
|
friend bool operator!=(Spacing const & a, Spacing const & b) {
|
2000-06-08 23:16:16 +00:00
|
|
|
return !(a == b);
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
Space space;
|
|
|
|
///
|
|
|
|
float value;
|
|
|
|
};
|
|
|
|
#endif
|