kspread

kspread_pen.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2005 Peter Simonsson
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20#include "kspread_pen.h"
21
22#include <KoTextZoomHandler.h>
23
24KSpreadPen::KSpreadPen()
25 : TQPen()
26{
27 m_pointWidth = 1.0;
28}
29
30KSpreadPen::KSpreadPen(const TQColor& _color, double _pointWidth, TQt::PenStyle _style)
31 : TQPen()
32{
33 setColor(_color);
34 setPointWidth(_pointWidth);
35 setStyle(_style);
36}
37
38KSpreadPen::KSpreadPen(const TQColor& _color)
39 : TQPen(_color)
40{
41 m_pointWidth = 1.0;
42}
43
44KSpreadPen::~KSpreadPen()
45{
46}
47
48bool KSpreadPen::operator==( const KSpreadPen &p ) const
49{
50 return color() == p.color() && style() == p.style() && m_pointWidth == p.pointWidth();
51}
52
53bool KSpreadPen::operator!=( const KSpreadPen &p ) const
54{
55 return color() != p.color() || style() != p.style() || m_pointWidth != p.pointWidth();
56}
57
59{
60 m_pointWidth = w;
61}
62
63TQPen KSpreadPen::zoomedPen(KoZoomHandler* zoomHandler)
64{
65 TQPen pen = *this;
66 pen.setWidth(zoomHandler->zoomItY(m_pointWidth));
67
68 return pen;
69}
double pointWidth() const
KSpreadPen width in points.
Definition kspread_pen.h:59
bool operator!=(const KSpreadPen &p) const
Compare pens if they differ.
void setPointWidth(double width)
Set the pen width in points.
bool operator==(const KSpreadPen &p) const
Compare pens if they are equal.
TQPen zoomedPen(KoZoomHandler *zoomHandler)
Returns a zoomed TQPen.