Qwt User's Guide svn
qwt_plot_svgitem.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_PLOT_SVGITEM_H
00011 #define QWT_PLOT_SVGITEM_H
00012 
00013 #include "qwt_global.h"
00014 #include "qwt_plot_item.h"
00015 #include <qstring.h>
00016 
00017 class QSvgRenderer;
00018 class QByteArray;
00019 
00027 class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem
00028 {
00029 public:
00030     explicit QwtPlotSvgItem( const QString& title = QString::null );
00031     explicit QwtPlotSvgItem( const QwtText& title );
00032     virtual ~QwtPlotSvgItem();
00033 
00034     bool loadFile( const QRectF&, const QString &fileName );
00035     bool loadData( const QRectF&, const QByteArray & );
00036 
00037     virtual QRectF boundingRect() const;
00038 
00039     virtual void draw( QPainter *p,
00040         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00041         const QRectF &rect ) const;
00042 
00043     virtual int rtti() const;
00044 
00045 protected:
00046     const QSvgRenderer &renderer() const;
00047     QSvgRenderer &renderer();
00048 
00049     void render( QPainter *painter,
00050         const QRectF &viewBox, const QRectF &rect ) const;
00051 
00052     QRectF viewBox( const QRectF &area ) const;
00053 
00054 private:
00055     void init();
00056 
00057     class PrivateData;
00058     PrivateData *d_data;
00059 };
00060 
00061 #endif
qmi style