F:/KPlato/koffice/libs/kofficecore/KoPictureBase.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (c) 2001 Simon Hausmann <hausmann@kde.org>
00003    Copyright (C) 2002, 2003, 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 __koPictureBase_h__
00021 #define __koPictureBase_h__
00022 
00023 #include "KoPictureKey.h" // for KoPictureType
00024 
00025 #include <QString>
00026 #include <QImage>
00027 //Added by qt3to4:
00028 #include <QPixmap>
00029 
00030 class KoXmlWriter;
00031 class QPainter;
00032 class QSize;
00033 class QIODevice;
00034 class Q3DragObject;
00035 
00036 const char NULL_MIME_TYPE[]="application/x-zerosize";
00037 
00038 // TODO: fix documentation
00039 
00044 class KoPictureBase
00045 {
00046 public:
00050     KoPictureBase();
00051 
00055     virtual ~KoPictureBase();
00056 
00057     virtual KoPictureType::Type getType(void) const;
00058 
00059     virtual KoPictureBase* newCopy(void) const;
00060 
00064     virtual bool isNull(void) const;
00065 
00081     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);
00082 
00088     virtual Q3DragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00089 
00090     virtual bool load(QIODevice* io, const QString& extension);
00091 
00092     virtual bool loadData(const QByteArray& array, const QString& extension);
00093 
00098     virtual bool save(QIODevice* io) const;
00099 
00104     virtual bool saveAsBase64( KoXmlWriter& writer ) const;
00105 
00106     virtual QSize getOriginalSize(void) const;
00107 
00108     virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00109 
00110     virtual QString getMimeType(const QString& extension) const;
00111 
00112     bool isSlowResizeModeAllowed(void) const;
00113 
00118     virtual QImage generateImage(const QSize& size);
00119 
00120     virtual bool hasAlphaBuffer() const
00121         { return false; }
00122     virtual void setAlphaBuffer(bool /*enable*/)
00123         { }
00124     virtual QImage createAlphaMask(Qt::ImageConversionFlags = Qt::AutoColor) const
00125         { return QImage(); }
00126 
00127     virtual void clearCache(void);
00128 };
00129 
00130 #endif /* __koPictureBase_h__ */

Généré le Wed Nov 22 23:41:03 2006 pour KPlato par  doxygen 1.5.1-p1