Quantum GIS API Documentation  master-ce49b66
src/core/composer/qgscomposerhtml.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                               qgscomposerhtml.h
00003     ------------------------------------------------------------
00004     begin                : July 2012
00005     copyright            : (C) 2012 by Marco Hugentobler
00006     email                : marco dot hugentobler at sourcepole dot ch
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 #ifndef QGSCOMPOSERHTML_H
00017 #define QGSCOMPOSERHTML_H
00018 
00019 #include "qgscomposermultiframe.h"
00020 #include <QUrl>
00021 
00022 class QWebPage;
00023 
00024 class CORE_EXPORT QgsComposerHtml: public QgsComposerMultiFrame
00025 {
00026     Q_OBJECT
00027   public:
00028     QgsComposerHtml( QgsComposition* c, bool createUndoCommands );
00029     QgsComposerHtml();
00030     ~QgsComposerHtml();
00031 
00032     void setUrl( const QUrl& url );
00033     const QUrl& url() const { return mUrl; }
00034 
00035     QSizeF totalSize() const;
00036     void render( QPainter* p, const QRectF& renderExtent );
00037 
00038     bool writeXML( QDomElement& elem, QDomDocument & doc, bool ignoreFrames = false ) const;
00039     bool readXML( const QDomElement& itemElem, const QDomDocument& doc, bool ignoreFrames = false );
00040 
00041     void addFrame( QgsComposerFrame* frame, bool recalcFrameSizes = true );
00042 
00043   private slots:
00044     void frameLoaded( bool ok );
00045 
00046   private:
00047     QUrl mUrl;
00048     QWebPage* mWebPage;
00049     bool mLoaded;
00050     QSizeF mSize; //total size in mm
00051     double mHtmlUnitsToMM;
00052 
00053     double htmlUnitsToMM(); //calculate scale factor
00054 };
00055 
00056 #endif // QGSCOMPOSERHTML_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines