lib

KoPictureClipart.h

00001 /* This file is part of the KDE project
00002    Copyright (c) 2001 Simon Hausmann <hausmann@kde.org>
00003    Copyright (C) 2002, 2004 Nicolas GOUTTE <goutte@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 #ifndef __koPictureClipart_h__
00021 #define __koPictureClipart_h__
00022 
00023 #include <qstring.h>
00024 #include <qpicture.h>
00025 
00026 class QPainter;
00027 class QSize;
00028 
00029 // TODO: fix documentation
00030 
00035 class KoPictureClipart : public KoPictureBase
00036 {
00037 public:
00041     KoPictureClipart();
00042 
00046     virtual ~KoPictureClipart();
00047 
00048     virtual KoPictureType::Type getType(void) const;
00049 
00050     virtual KoPictureBase* newCopy(void) const;
00051 
00052 
00056     virtual bool isNull(void) const;
00057 
00073     virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false);
00074 
00075     virtual bool loadData(const QByteArray& array, const QString& extension);
00076 
00081     virtual bool save(QIODevice* io) const;
00082 
00083     virtual QSize getOriginalSize(void) const;
00084 
00085     virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00086 
00087     virtual QString getMimeType(const QString& extension) const;
00088 
00089 protected:
00090     QPixmap getPixmap(QImage& image);
00095     void drawQPicture(QPicture& clipart, QPainter& painter,
00096         int x, int y, int width, int height, int sx, int sy, int sw, int sh);
00097 protected:
00098     QPicture m_clipart; 
00099     QByteArray m_rawData; 
00100 };
00101 
00102 #endif /* __koPictureClipart_h__ */
KDE Home | KDE Accessibility Home | Description of Access Keys