lyx_mirror/src/Spacing.h
Lars Gullik Bjønnes 45a03f4f67 use the new sstream return non-pods as const, use string instead of char * in a lot of places
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1019 a592a061-630c-0410-9148-cb99ea01b6c8
2000-09-14 17:53:12 +00:00

82 lines
1.3 KiB
C++

// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#ifndef SPACING_H
#define SPACING_H
#ifdef __GNUG__
#pragma interface
#endif
#include <iosfwd>
#include "LString.h"
///
class Spacing {
public:
///
enum Space {
///
Single,
///
Onehalf,
///
Double,
///
Other,
///
Default
};
///
Spacing() : space(Single), value(1.0) {}
///
bool isDefault() const {
return space == Default;
}
///
float getValue() const;
///
Spacing::Space getSpace() const { return space; }
///
void set(Spacing::Space sp, float val = 1.0);
///
void set(Spacing::Space sp, string const & val) ;
///
void writeFile(std::ostream &, bool para = false) const;
///
string const writeEnvirBegin() const;
///
string const writeEnvirEnd() const;
private:
///
Space space;
///
float value;
};
///
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);
}
#endif