lib Library API Documentation

koPictureBase.h

00001 /* This file is part of the KDE project
00002    Copyright (c) 2001 Simon Hausmann <hausmann@kde.org>
00003    Copyright (C) 2002, 2003 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., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef __koPictureBase_h__
00021 #define __koPictureBase_h__
00022 
00023 #include <qstring.h>
00024 #include <qimage.h>
00025 
00026 class QPainter;
00027 class QSize;
00028 class QIODevice;
00029 class QDragObject;
00030 
00031 const char NULL_MIME_TYPE[]="application/x-zerosize";
00032 const char UNKNOWN_MIME_TYPE[]="application/octet-stream";
00033 
00034 // TODO: fix documentation
00035 
00040 class KoPictureBase
00041 {
00042 public:
00046     KoPictureBase();
00047 
00051     virtual ~KoPictureBase();
00052 
00053     virtual KoPictureType::Type getType(void) const;
00054 
00055     virtual KoPictureBase* newCopy(void) const;
00056 
00060     virtual bool isNull(void) const;
00061 
00077     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);
00078 
00084     virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00085 
00086     virtual bool load(QIODevice* io, const QString& extension);
00087 
00088     virtual bool load(const QByteArray& array, const QString& extension);
00089 
00094     virtual bool save(QIODevice* io);
00095 
00099     virtual bool saveAsKOffice1Dot1(QIODevice* io, const QString& extension);
00100 
00101     virtual QSize getOriginalSize(void) const;
00102 
00103     virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00104 
00109     virtual bool isClipartAsKOffice1Dot1(void) const;
00110 
00111     virtual QString getMimeType(const QString& extension) const;
00112 
00113     bool isSlowResizeModeAllowed(void) const;
00114 
00119     virtual QImage generateImage(const QSize& size);
00120 
00121     virtual bool hasAlphaBuffer() const
00122         { return false; }
00123     virtual void setAlphaBuffer(bool /*enable*/)
00124         { }
00125     virtual QImage createAlphaMask(int /*conversion_flags*/ = 0) const
00126         { return QImage(); }
00127 
00128     virtual void clearCache(void);
00129 };
00130 
00131 #endif /* __koPictureBase_h__ */
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Mar 20 14:25:26 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003