F:/KPlato/koffice/libs/kofficecore/KoPictureEps.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 __koPictureEps_h__
00021 #define __koPictureEps_h__
00022 
00023 #include <QString>
00024 //Added by qt3to4:
00025 #include <QPixmap>
00026 
00027 class QPainter;
00028 class QSize;
00029 class KoPictureEpsPrivate;
00030 
00031 // TODO: fix documentation
00032 
00037 class KoPictureEps : public KoPictureBase
00038 {
00039 public:
00043     KoPictureEps();
00044 
00048     virtual ~KoPictureEps();
00049 
00050     KoPictureType::Type getType(void) const;
00051 
00052     KoPictureBase* newCopy(void) const;
00053 
00057     virtual bool isNull(void) const;
00058 
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 
00079     virtual bool loadData(const QByteArray& array, const QString& extension);
00080 
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 
00093     virtual QImage generateImage(const QSize& size);
00094 
00095     virtual void clearCache(void);
00096 protected:
00097     QPixmap getPixmap(QImage& image);
00098     void scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony );
00099     QImage scaleWithGhostScript( const QSize& size, const int resolutionx, const int resolutiony );
00100     bool extractPostScriptStream( void );
00101 
00102 private:
00103     int tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device );
00118     QString readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr );
00119 
00120 private:
00124     QByteArray m_rawData;
00125     QPixmap m_cachedPixmap; 
00126     QSize m_originalSize; 
00127     QSize m_cachedSize; 
00128     QRect m_boundingBox; 
00129     uint m_psStreamStart; 
00130     uint m_psStreamLength; 
00131 
00135     bool m_cacheIsInFastMode;
00136 };
00137 
00138 #endif /* __koPictureEps_h__ */

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