1
/* This file is part of the KDE project
2
Copyright (c) 2001 David Faure <faure@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
20
#include "koClipart.h"
25
class KoClipartPrivate : public QShared
33
KoClipart::KoClipart()
38
KoClipart::KoClipart( const KoClipartKey &key, const QPicture &pic )
40
d = new KoClipartPrivate;
41
d->m_picture.setData( pic.data(), pic.size() ); // make a copy
45
KoClipart::KoClipart( const KoClipart &other )
51
KoClipart::~KoClipart()
53
if ( d && d->deref() )
57
KoClipart &KoClipart::operator=( const KoClipart &_other )
59
KoClipart &other = const_cast<KoClipart &>( _other );
64
if ( d && d->deref() )
72
QPicture * KoClipart::picture() const
78
KoClipartKey KoClipart::key() const
80
if ( !d ) return KoClipartKey();
85
bool KoClipart::isNull() const
87
return d == 0 || d->m_picture.isNull();