Skip to content

Commit 682d8b3

Browse files
committedJul 24, 2012
Add composer html class
1 parent 1e2e9c4 commit 682d8b3

File tree

5 files changed

+113
-16
lines changed

5 files changed

+113
-16
lines changed
 

‎src/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ SET(QGIS_CORE_SRCS
133133
composer/qgsnumericscalebarstyle.cpp
134134
composer/qgssingleboxscalebarstyle.cpp
135135
composer/qgsticksscalebarstyle.cpp
136+
composer/qgscomposerhtml.cpp
136137
composer/qgscomposermultiframe.cpp
137138
composer/qgscomposition.cpp
138139

‎src/core/composer/qgscomposerhtml.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/***************************************************************************
2+
qgscomposerhtml.cpp
3+
------------------------------------------------------------
4+
begin : Julli 2012
5+
copyright : (C) 2012 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#include "qgscomposerhtml.h"
17+
18+
QgsComposerHtml::QgsComposerHtml( QgsComposition* c ): QgsComposerMultiFrame( c )
19+
{
20+
}
21+
22+
QgsComposerHtml::~QgsComposerHtml()
23+
{
24+
}
25+
26+
QSizeF QgsComposerHtml::totalSize() const
27+
{
28+
return QSizeF(); //soon...
29+
}

‎src/core/composer/qgscomposerhtml.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/***************************************************************************
2+
qgscomposerhtml.h
3+
------------------------------------------------------------
4+
begin : Julli 2012
5+
copyright : (C) 2012 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#ifndef QGSCOMPOSERHTML_H
17+
#define QGSCOMPOSERHTML_H
18+
19+
#include "qgscomposermultiframe.h"
20+
#include <QUrl>
21+
22+
class QgsComposerHtml: public QgsComposerMultiFrame
23+
{
24+
public:
25+
QgsComposerHtml( QgsComposition* c );
26+
~QgsComposerHtml();
27+
28+
void setUrl( const QUrl& url ) { mUrl = url; }
29+
const QUrl& url() const { return mUrl; }
30+
31+
QSizeF totalSize() const;
32+
33+
private:
34+
QUrl mUrl;
35+
};
36+
37+
#endif // QGSCOMPOSERHTML_H

‎src/core/composer/qgscomposermultiframe.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgscomposermultiframe.cpp
3+
------------------------------------------------------------
4+
begin : Julli 2012
5+
copyright : (C) 2012 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgscomposermultiframe.h"
217

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

1530
void QgsComposerMultiFrame::recalculateFrameSizes()
1631
{
17-
//todo...
32+
//todo...
1833
}
Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgscomposermultiframe.h
3+
------------------------------------------------------------
4+
begin : Julli 2012
5+
copyright : (C) 2012 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSCOMPOSERMULTIFRAME_H
217
#define QGSCOMPOSERMULTIFRAME_H
318

@@ -11,26 +26,26 @@ class QgsComposition;
1126
class QgsComposerMultiFrame: public QObject
1227
{
1328
Q_OBJECT
14-
public:
29+
public:
1530

16-
enum ResizeMode
17-
{
18-
ExtendToNextPage = 0, //duplicates last frame to next page to fit the total size
19-
UseExistingFrames //
20-
};
31+
enum ResizeMode
32+
{
33+
ExtendToNextPage = 0, //duplicates last frame to next page to fit the total size
34+
UseExistingFrames //
35+
};
2136

22-
QgsComposerMultiFrame( QgsComposition* c );
23-
virtual ~QgsComposerMultiFrame();
24-
virtual QSizeF totalSize() = 0;
37+
QgsComposerMultiFrame( QgsComposition* c );
38+
virtual ~QgsComposerMultiFrame();
39+
virtual QSizeF totalSize() const = 0;
2540

26-
protected:
27-
QgsComposition* mComposition;
28-
QList<QgsComposerItem*> mFrameItems;
41+
protected:
42+
QgsComposition* mComposition;
43+
QList<QgsComposerItem*> mFrameItems;
2944

30-
void recalculateFrameSizes();
45+
void recalculateFrameSizes();
3146

32-
private:
33-
QgsComposerMultiFrame(); //forbidden
47+
private:
48+
QgsComposerMultiFrame(); //forbidden
3449
};
3550

3651
#endif // QGSCOMPOSERMULTIFRAME_H

0 commit comments

Comments
 (0)
Please sign in to comment.