Dash.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 __DASH_H__
11 #define __DASH_H__
12
13 #include <boost/optional.hpp>
14 #include <vector>
15
16 namespace libmspub
17 {
18 enum DotStyle
19 {
20 RECT_DOT,
21 ROUND_DOT
22 };
23 enum MSPUBDashStyle
24 {
25 MSPUB_DS_SOLID,
26 DASH_SYS,
27 DOT_SYS,
28 DASH_DOT_SYS,
29 DASH_DOT_DOT_SYS,
30 DOT_GEL,
31 DASH_GEL,
32 LONG_DASH_GEL,
33 DASH_DOT_GEL,
34 LONG_DASH_DOT_GEL,
35 LONG_DASH_DOT_DOT_GEL
36 };
37 struct Dot
38 {
39 boost::optional<double> m_length;
40 unsigned m_count;
41 Dot(unsigned count) : m_length(), m_count(count)
42 {
43 }
44 Dot(unsigned count, double length) : m_length(length), m_count(count)
45 {
46 }
47 };
48 struct Dash
49 {
50 double m_distance;
51 DotStyle m_dotStyle;
52 std::vector<Dot> m_dots; // empty vector is interpreted as solid line
53 Dash(double distance, DotStyle dotStyle) : m_distance(distance),
54 m_dotStyle(dotStyle), m_dots()
55 {
56 }
57 };
58 bool operator!=(const Dot &lhs, const Dot &rhs);
59 bool operator==(const Dot &lhs, const Dot &rhs);
60 bool operator==(const Dash &lhs, const Dash &rhs);
61 Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthInEmu,
62 DotStyle dotStyle);
63 } // namespace libmspub
64
65 #endif /* __DASH_H__ */
66 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libmspub::Dot::Dot
Dot(unsigned count, double length)
Definition: Dash.h:44
libmspub::operator==
bool operator==(const ColorReference &l, const ColorReference &r)
Definition: ColorReference.cpp:52
libmspub::Dot::m_length
boost::optional< double > m_length
Definition: Dash.h:39
libmspub::RECT_DOT
Definition: Dash.h:20
libmspub::LONG_DASH_GEL
Definition: Dash.h:32
libmspub::LONG_DASH_DOT_DOT_GEL
Definition: Dash.h:35
libmspub::DotStyle
DotStyle
Definition: Dash.h:18
libmspub::DASH_DOT_DOT_SYS
Definition: Dash.h:29
libmspub::DOT_GEL
Definition: Dash.h:30
libmspub::Dash
Definition: Dash.h:48
libmspub::Dash::m_dots
std::vector< Dot > m_dots
Definition: Dash.h:52
libmspub::DASH_DOT_SYS
Definition: Dash.h:28
libmspub::DOT_SYS
Definition: Dash.h:27
libmspub::Dot::m_count
unsigned m_count
Definition: Dash.h:40
libmspub::getDash
Dash getDash(MSPUBDashStyle style, unsigned shapeLineWidthEmu, DotStyle dotStyle)
Definition: Dash.cpp:43
libmspub::Dash::Dash
Dash(double distance, DotStyle dotStyle)
Definition: Dash.h:53
libmspub::DASH_DOT_GEL
Definition: Dash.h:33
libmspub
Definition: Arrow.h:13
libmspub::DASH_SYS
Definition: Dash.h:26
libmspub::Dot
Definition: Dash.h:37
libmspub::operator!=
bool operator!=(const Dot &lhs, const Dot &rhs)
Definition: Dash.cpp:21
libmspub::LONG_DASH_DOT_GEL
Definition: Dash.h:34
libmspub::Dot::Dot
Dot(unsigned count)
Definition: Dash.h:41
libmspub::DASH_GEL
Definition: Dash.h:31
libmspub::MSPUBDashStyle
MSPUBDashStyle
Definition: Dash.h:23
libmspub::MSPUB_DS_SOLID
Definition: Dash.h:25
libmspub::Dash::m_dotStyle
DotStyle m_dotStyle
Definition: Dash.h:51
libmspub::ROUND_DOT
Definition: Dash.h:21
libmspub::Dash::m_distance
double m_distance
Definition: Dash.h:50