Dash.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libmspub project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_DASH_H
#define INCLUDED_DASH_H
#include <vector>
#include <boost/optional.hpp>
namespace libmspub
{
enum DotStyle
{
RECT_DOT,
ROUND_DOT
};
enum MSPUBDashStyle
{
MSPUB_DS_SOLID,
DASH_SYS,
DOT_SYS,
DASH_DOT_SYS,
DASH_DOT_DOT_SYS,
DOT_GEL,
DASH_GEL,
LONG_DASH_GEL,
DASH_DOT_GEL,
LONG_DASH_DOT_GEL,
LONG_DASH_DOT_DOT_GEL
};
struct Dot
{
boost::optional<double> m_length;
unsigned m_count;
Dot(unsigned count) : m_length(), m_count(count)
{
}
Dot(unsigned count, double length) : m_length(length), m_count(count)
{
}
};
struct Dash
{
double m_distance;
DotStyle m_dotStyle;
std::vector<Dot> m_dots; // empty vector is interpreted as solid line
Dash(double distance, DotStyle dotStyle) : m_distance(distance),
m_dotStyle(dotStyle), m_dots()
{
}
};
bool operator!=(const Dot &lhs, const Dot &rhs);
bool operator==(const Dot &lhs, const Dot &rhs);
bool operator==(const Dash &lhs, const Dash &rhs);
Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthInEmu,
DotStyle dotStyle);
} // namespace libmspub
#endif /* INCLUDED_DASH_H */
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libmspub
Definition Arrow.h:14
libmspub::DotStyle
DotStyle
Definition Dash.h:20
libmspub::RECT_DOT
@ RECT_DOT
Definition Dash.h:21
libmspub::ROUND_DOT
@ ROUND_DOT
Definition Dash.h:22
libmspub::MSPUBDashStyle
MSPUBDashStyle
Definition Dash.h:25
libmspub::DOT_SYS
@ DOT_SYS
Definition Dash.h:28
libmspub::DASH_DOT_GEL
@ DASH_DOT_GEL
Definition Dash.h:34
libmspub::DASH_DOT_SYS
@ DASH_DOT_SYS
Definition Dash.h:29
libmspub::MSPUB_DS_SOLID
@ MSPUB_DS_SOLID
Definition Dash.h:26
libmspub::DASH_DOT_DOT_SYS
@ DASH_DOT_DOT_SYS
Definition Dash.h:30
libmspub::DASH_GEL
@ DASH_GEL
Definition Dash.h:32
libmspub::LONG_DASH_DOT_GEL
@ LONG_DASH_DOT_GEL
Definition Dash.h:35
libmspub::LONG_DASH_GEL
@ LONG_DASH_GEL
Definition Dash.h:33
libmspub::LONG_DASH_DOT_DOT_GEL
@ LONG_DASH_DOT_DOT_GEL
Definition Dash.h:36
libmspub::DASH_SYS
@ DASH_SYS
Definition Dash.h:27
libmspub::DOT_GEL
@ DOT_GEL
Definition Dash.h:31
libmspub::operator==
bool operator==(const ColorReference &l, const ColorReference &r)
Definition ColorReference.cpp:52
libmspub::operator!=
bool operator!=(const Dot &lhs, const Dot &rhs)
Definition Dash.cpp:23
libmspub::getDash
Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthEmu, DotStyle dotStyle)
Definition Dash.cpp:45
libmspub::Underline::Dash
@ Dash
Definition MSPUBTypes.h:48
libmspub::Dash::m_distance
double m_distance
Definition Dash.h:51
libmspub::Dash::Dash
Dash(double distance, DotStyle dotStyle)
Definition Dash.h:54
libmspub::Dash::m_dots
std::vector< Dot > m_dots
Definition Dash.h:53
libmspub::Dash::m_dotStyle
DotStyle m_dotStyle
Definition Dash.h:52
libmspub::Dot::Dot
Dot(unsigned count, double length)
Definition Dash.h:45
libmspub::Dot::m_count
unsigned m_count
Definition Dash.h:41
libmspub::Dot::m_length
boost::optional< double > m_length
Definition Dash.h:40
libmspub::Dot::Dot
Dot(unsigned count)
Definition Dash.h:42