Skip to content

Commit

Permalink
Add composer html class
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 24, 2012
1 parent 1e2e9c4 commit 682d8b3
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ SET(QGIS_CORE_SRCS
composer/qgsnumericscalebarstyle.cpp
composer/qgssingleboxscalebarstyle.cpp
composer/qgsticksscalebarstyle.cpp
composer/qgscomposerhtml.cpp
composer/qgscomposermultiframe.cpp
composer/qgscomposition.cpp

Expand Down
29 changes: 29 additions & 0 deletions src/core/composer/qgscomposerhtml.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/***************************************************************************
qgscomposerhtml.cpp
------------------------------------------------------------
begin : Julli 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgscomposerhtml.h"

QgsComposerHtml::QgsComposerHtml( QgsComposition* c ): QgsComposerMultiFrame( c )
{
}

QgsComposerHtml::~QgsComposerHtml()
{
}

QSizeF QgsComposerHtml::totalSize() const
{
return QSizeF(); //soon...
}
37 changes: 37 additions & 0 deletions src/core/composer/qgscomposerhtml.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/***************************************************************************
qgscomposerhtml.h
------------------------------------------------------------
begin : Julli 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSCOMPOSERHTML_H
#define QGSCOMPOSERHTML_H

#include "qgscomposermultiframe.h"
#include <QUrl>

class QgsComposerHtml: public QgsComposerMultiFrame
{
public:
QgsComposerHtml( QgsComposition* c );
~QgsComposerHtml();

void setUrl( const QUrl& url ) { mUrl = url; }
const QUrl& url() const { return mUrl; }

QSizeF totalSize() const;

private:
QUrl mUrl;
};

#endif // QGSCOMPOSERHTML_H
17 changes: 16 additions & 1 deletion src/core/composer/qgscomposermultiframe.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/***************************************************************************
qgscomposermultiframe.cpp
------------------------------------------------------------
begin : Julli 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgscomposermultiframe.h"

QgsComposerMultiFrame::QgsComposerMultiFrame( QgsComposition* c ): mComposition( c )
Expand All @@ -14,5 +29,5 @@ QgsComposerMultiFrame::~QgsComposerMultiFrame()

void QgsComposerMultiFrame::recalculateFrameSizes()
{
//todo...
//todo...
}
45 changes: 30 additions & 15 deletions src/core/composer/qgscomposermultiframe.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/***************************************************************************
qgscomposermultiframe.h
------------------------------------------------------------
begin : Julli 2012
copyright : (C) 2012 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSCOMPOSERMULTIFRAME_H
#define QGSCOMPOSERMULTIFRAME_H

Expand All @@ -11,26 +26,26 @@ class QgsComposition;
class QgsComposerMultiFrame: public QObject
{
Q_OBJECT
public:
public:

enum ResizeMode
{
ExtendToNextPage = 0, //duplicates last frame to next page to fit the total size
UseExistingFrames //
};
enum ResizeMode
{
ExtendToNextPage = 0, //duplicates last frame to next page to fit the total size
UseExistingFrames //
};

QgsComposerMultiFrame( QgsComposition* c );
virtual ~QgsComposerMultiFrame();
virtual QSizeF totalSize() = 0;
QgsComposerMultiFrame( QgsComposition* c );
virtual ~QgsComposerMultiFrame();
virtual QSizeF totalSize() const = 0;

protected:
QgsComposition* mComposition;
QList<QgsComposerItem*> mFrameItems;
protected:
QgsComposition* mComposition;
QList<QgsComposerItem*> mFrameItems;

void recalculateFrameSizes();
void recalculateFrameSizes();

private:
QgsComposerMultiFrame(); //forbidden
private:
QgsComposerMultiFrame(); //forbidden
};

#endif // QGSCOMPOSERMULTIFRAME_H

0 comments on commit 682d8b3

Please sign in to comment.