~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kchart/kdchart/src/KDChartFrameAttributes.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
 ** Copyright (C) 2007 Klarälvdalens Datakonsult AB.  All rights reserved.
3
 
 **
4
 
 ** This file is part of the KD Chart library.
5
 
 **
6
 
 ** This file may be used under the terms of the GNU General Public
7
 
 ** License versions 2.0 or 3.0 as published by the Free Software
8
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9
 
 ** included in the packaging of this file.  Alternatively you may (at
10
 
 ** your option) use any later version of the GNU General Public
11
 
 ** License if such license has been publicly approved by
12
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
13
 
 ** 
14
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17
 
 ** not expressly granted herein.
18
 
 ** 
19
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
 
 **
22
 
 **********************************************************************/
23
 
 
24
 
#include "KDChartFrameAttributes.h"
25
 
 
26
 
#include <KDABLibFakes>
27
 
 
28
 
#define d d_func()
29
 
 
30
 
using namespace KDChart;
31
 
 
32
 
class FrameAttributes::Private
33
 
{
34
 
    friend class FrameAttributes;
35
 
public:
36
 
    Private();
37
 
private:
38
 
    bool visible;
39
 
    QPen pen;
40
 
    int padding;
41
 
};
42
 
 
43
 
FrameAttributes::Private::Private() :
44
 
    visible( false ),
45
 
    padding( 0 )
46
 
{
47
 
}
48
 
 
49
 
 
50
 
FrameAttributes::FrameAttributes()
51
 
    : _d( new Private() )
52
 
{
53
 
}
54
 
 
55
 
FrameAttributes::FrameAttributes( const FrameAttributes& r )
56
 
    : _d( new Private( *r.d ) )
57
 
{
58
 
}
59
 
 
60
 
FrameAttributes & FrameAttributes::operator=( const FrameAttributes& r )
61
 
{
62
 
    if( this == &r )
63
 
        return *this;
64
 
 
65
 
    *d = *r.d;
66
 
 
67
 
    return *this;
68
 
}
69
 
 
70
 
FrameAttributes::~FrameAttributes()
71
 
{
72
 
    delete _d; _d = 0;
73
 
}
74
 
 
75
 
 
76
 
bool FrameAttributes::operator==( const FrameAttributes& r ) const
77
 
{
78
 
    /*
79
 
    qDebug() << "FrameAttributes:" << (isVisible() == r.isVisible())
80
 
        << (pen() == r.pen())
81
 
        << (padding() == r.padding()) << "\n";
82
 
    */
83
 
    return ( isVisible() == r.isVisible() &&
84
 
            pen() == r.pen() &&
85
 
            padding() == r.padding() );
86
 
}
87
 
 
88
 
 
89
 
 
90
 
 
91
 
void FrameAttributes::setVisible( bool visible )
92
 
{
93
 
    d->visible = visible;
94
 
}
95
 
 
96
 
bool FrameAttributes::isVisible() const
97
 
{
98
 
    return d->visible;
99
 
}
100
 
 
101
 
void FrameAttributes::setPen( const QPen & pen )
102
 
{
103
 
    d->pen = pen;
104
 
}
105
 
 
106
 
QPen FrameAttributes::pen() const
107
 
{
108
 
    return d->pen;
109
 
}
110
 
 
111
 
void FrameAttributes::setPadding( int padding )
112
 
{
113
 
    d->padding = padding;
114
 
}
115
 
 
116
 
int FrameAttributes::padding() const
117
 
{
118
 
    return d->padding;
119
 
}
120
 
 
121
 
#if !defined(QT_NO_DEBUG_STREAM)
122
 
QDebug operator<<(QDebug dbg, const KDChart::FrameAttributes& fa)
123
 
{
124
 
    dbg << "KDChart::FrameAttributes("
125
 
        << "visible="<<fa.isVisible()
126
 
        << "pen="<<fa.pen()
127
 
        << "padding="<<fa.padding()
128
 
        << ")";
129
 
    return dbg;
130
 
}
131
 
#endif /* QT_NO_DEBUG_STREAM */