Dash.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libmspub project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_DASH_H
11 #define INCLUDED_DASH_H
12 
13 #include <vector>
14 
15 #include <boost/optional.hpp>
16 
17 namespace libmspub
18 {
20 {
23 };
25 {
37 };
38 struct Dot
39 {
40  boost::optional<double> m_length;
41  unsigned m_count;
42  Dot(unsigned count) : m_length(), m_count(count)
43  {
44  }
45  Dot(unsigned count, double length) : m_length(length), m_count(count)
46  {
47  }
48 };
49 struct Dash
50 {
51  double m_distance;
53  std::vector<Dot> m_dots; // empty vector is interpreted as solid line
54  Dash(double distance, DotStyle dotStyle) : m_distance(distance),
55  m_dotStyle(dotStyle), m_dots()
56  {
57  }
58 };
59 bool operator!=(const Dot &lhs, const Dot &rhs);
60 bool operator==(const Dot &lhs, const Dot &rhs);
61 bool operator==(const Dash &lhs, const Dash &rhs);
62 Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthInEmu,
63  DotStyle dotStyle);
64 } // namespace libmspub
65 
66 #endif /* INCLUDED_DASH_H */
67 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Dot(unsigned count, double length)
Definition: Dash.h:45
bool operator==(const ColorReference &l, const ColorReference &r)
Definition: ColorReference.cpp:52
boost::optional< double > m_length
Definition: Dash.h:40
Definition: Dash.h:21
Definition: Dash.h:33
Definition: Dash.h:36
DotStyle
Definition: Dash.h:19
Definition: Dash.h:30
Definition: Dash.h:31
Definition: Dash.h:49
std::vector< Dot > m_dots
Definition: Dash.h:53
Definition: Dash.h:29
Definition: Dash.h:28
unsigned m_count
Definition: Dash.h:41
Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthEmu, DotStyle dotStyle)
Definition: Dash.cpp:45
Dash(double distance, DotStyle dotStyle)
Definition: Dash.h:54
Definition: Dash.h:34
Definition: Arrow.h:13
Definition: Dash.h:27
Definition: Dash.h:38
bool operator!=(const Dot &lhs, const Dot &rhs)
Definition: Dash.cpp:23
Definition: Dash.h:35
Dot(unsigned count)
Definition: Dash.h:42
Definition: Dash.h:32
MSPUBDashStyle
Definition: Dash.h:24
Definition: Dash.h:26
DotStyle m_dotStyle
Definition: Dash.h:52
Definition: Dash.h:22
double m_distance
Definition: Dash.h:51

Generated for libmspub by doxygen 1.8.14