LibreOffice Module svx (master) 1
xdash.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice 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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SVX_XDASH_HXX
21#define INCLUDED_SVX_XDASH_HXX
22
23
24
25
26#include <svx/svxdllapi.h>
27#include <com/sun/star/drawing/DashStyle.hpp>
28
29#include <vector>
30
32{
33 css::drawing::DashStyle eDash;
34 sal_uInt16 nDots;
35 sal_uInt16 nDashes;
36 double nDotLen;
37 double nDashLen;
38 double nDistance;
39
40public:
41 XDash(css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT,
42 sal_uInt16 nDots = 1, double nDotLen = 20,
43 sal_uInt16 nDashes = 1, double nDashLen = 20, double nDistance = 20);
44
45 bool operator==(const XDash& rDash) const;
46
47 void SetDashStyle(css::drawing::DashStyle eNewStyle) { eDash = eNewStyle; }
48 void SetDots(sal_uInt16 nNewDots) { nDots = nNewDots; }
49 void SetDotLen(double nNewDotLen) { nDotLen = nNewDotLen; }
50 void SetDashes(sal_uInt16 nNewDashes) { nDashes = nNewDashes; }
51 void SetDashLen(double nNewDashLen) { nDashLen = nNewDashLen; }
52 void SetDistance(double nNewDistance) { nDistance = nNewDistance; }
53
54 css::drawing::DashStyle GetDashStyle() const { return eDash; }
55 sal_uInt16 GetDots() const { return nDots; }
56 double GetDotLen() const { return nDotLen; }
57 sal_uInt16 GetDashes() const { return nDashes; }
58 double GetDashLen() const { return nDashLen; }
59 double GetDistance() const { return nDistance; }
60
61 // XDash is translated into an array of doubles which describe the lengths of the
62 // dashes, dots and empty passages. It returns the complete length of the full DashDot
63 // sequence and fills the given vector of doubles accordingly (also resizing, so deleting it).
64 double CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const;
65};
66
67#endif
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: xdash.hxx:32
void SetDashLen(double nNewDashLen)
Definition: xdash.hxx:51
double nDotLen
Definition: xdash.hxx:36
css::drawing::DashStyle eDash
Definition: xdash.hxx:33
void SetDots(sal_uInt16 nNewDots)
Definition: xdash.hxx:48
double GetDotLen() const
Definition: xdash.hxx:56
css::drawing::DashStyle GetDashStyle() const
Definition: xdash.hxx:54
void SetDotLen(double nNewDotLen)
Definition: xdash.hxx:49
double nDistance
Definition: xdash.hxx:38
double GetDashLen() const
Definition: xdash.hxx:58
void SetDistance(double nNewDistance)
Definition: xdash.hxx:52
double nDashLen
Definition: xdash.hxx:37
void SetDashes(sal_uInt16 nNewDashes)
Definition: xdash.hxx:50
sal_uInt16 nDashes
Definition: xdash.hxx:35
double GetDistance() const
Definition: xdash.hxx:59
void SetDashStyle(css::drawing::DashStyle eNewStyle)
Definition: xdash.hxx:47
sal_uInt16 GetDots() const
Definition: xdash.hxx:55
sal_uInt16 nDots
Definition: xdash.hxx:34
sal_uInt16 GetDashes() const
Definition: xdash.hxx:57
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)