1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-10-07 18:44:17 +00:00
|
|
|
* ======================================================
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
1999-10-07 18:44:17 +00:00
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
1999-10-07 18:44:17 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 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
|
|
|
};
|
|
|
|
///
|
2001-08-20 19:08:46 +00:00
|
|
|
Spacing() : space(Default), value(1.0) {}
|
2000-04-11 22:55:29 +00:00
|
|
|
///
|
2001-03-06 14:07:14 +00:00
|
|
|
Spacing(Spacing::Space sp, float val = 1.0) {
|
|
|
|
set(sp, val);
|
|
|
|
}
|
|
|
|
Spacing(Spacing::Space sp, string const & val) {
|
|
|
|
set(sp, val);
|
|
|
|
}
|
|
|
|
///
|
2000-04-11 22:55:29 +00:00
|
|
|
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-09-14 17:53:12 +00:00
|
|
|
void set(Spacing::Space sp, string 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-09-14 17:53:12 +00:00
|
|
|
string const writeEnvirBegin() const;
|
2000-04-19 01:42:55 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
string const writeEnvirEnd() const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
Space space;
|
|
|
|
///
|
|
|
|
float value;
|
2001-11-09 13:44:48 +00:00
|
|
|
/// names of line spacing
|
|
|
|
static string const spacing_string[];
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
2000-09-14 17:53:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
inline
|
|
|
|
bool operator==(Spacing const & a, Spacing const & b)
|
|
|
|
{
|
|
|
|
return a.getSpace() == b.getSpace()
|
|
|
|
&& a.getValue() == b.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
///
|
|
|
|
inline
|
|
|
|
bool operator!=(Spacing const & a, Spacing const & b)
|
|
|
|
{
|
|
|
|
return !(a == b);
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|