2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice 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/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-04-11 15:49:58 +00:00
|
|
|
|
2013-10-23 19:08:11 +02:00
|
|
|
#ifndef INCLUDED_SVX_XDASH_HXX
|
|
|
|
#define INCLUDED_SVX_XDASH_HXX
|
2007-04-11 15:49:58 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2007-04-11 15:49:58 +00:00
|
|
|
// class XDash
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2007-04-11 15:49:58 +00:00
|
|
|
|
|
|
|
#include <svx/xenum.hxx>
|
2013-11-09 15:28:54 -06:00
|
|
|
#include <svx/svxdllapi.h>
|
2014-11-29 12:50:37 +02:00
|
|
|
#include <com/sun/star/drawing/DashStyle.hpp>
|
2007-04-11 15:49:58 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class SVX_DLLPUBLIC XDash
|
|
|
|
{
|
|
|
|
protected:
|
2014-11-29 12:50:37 +02:00
|
|
|
css::drawing::DashStyle eDash;
|
|
|
|
sal_uInt16 nDots;
|
|
|
|
sal_uIntPtr nDotLen;
|
|
|
|
sal_uInt16 nDashes;
|
|
|
|
sal_uIntPtr nDashLen;
|
|
|
|
sal_uIntPtr nDistance;
|
2007-04-11 15:49:58 +00:00
|
|
|
|
|
|
|
public:
|
2014-11-29 12:50:37 +02:00
|
|
|
XDash(css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT,
|
2011-01-10 16:11:35 +01:00
|
|
|
sal_uInt16 nDots = 1, sal_uIntPtr nDotLen = 20,
|
|
|
|
sal_uInt16 nDashes = 1, sal_uIntPtr nDashLen = 20, sal_uIntPtr nDistance = 20);
|
2007-04-11 15:49:58 +00:00
|
|
|
|
|
|
|
bool operator==(const XDash& rDash) const;
|
|
|
|
|
2014-11-29 12:50:37 +02:00
|
|
|
void SetDashStyle(css::drawing::DashStyle eNewStyle) { eDash = eNewStyle; }
|
|
|
|
void SetDots(sal_uInt16 nNewDots) { nDots = nNewDots; }
|
|
|
|
void SetDotLen(sal_uIntPtr nNewDotLen) { nDotLen = nNewDotLen; }
|
|
|
|
void SetDashes(sal_uInt16 nNewDashes) { nDashes = nNewDashes; }
|
|
|
|
void SetDashLen(sal_uIntPtr nNewDashLen) { nDashLen = nNewDashLen; }
|
|
|
|
void SetDistance(sal_uIntPtr nNewDistance) { nDistance = nNewDistance; }
|
2007-04-11 15:49:58 +00:00
|
|
|
|
2014-11-29 12:50:37 +02:00
|
|
|
css::drawing::DashStyle GetDashStyle() const { return eDash; }
|
|
|
|
sal_uInt16 GetDots() const { return nDots; }
|
|
|
|
sal_uIntPtr GetDotLen() const { return nDotLen; }
|
|
|
|
sal_uInt16 GetDashes() const { return nDashes; }
|
|
|
|
sal_uIntPtr GetDashLen() const { return nDashLen; }
|
|
|
|
sal_uIntPtr GetDistance() const { return nDistance; }
|
2007-04-11 15:49:58 +00:00
|
|
|
|
|
|
|
// XDash is translated into an array of doubles which describe the lengths of the
|
|
|
|
// dashes, dots and empty passages. It returns the complete length of the full DashDot
|
|
|
|
// sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it).
|
|
|
|
double CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|