Skip to content
Permalink
Browse files

Add QgsComposerMultiFrame as base class for multi-frame composer content

  • Loading branch information
mhugent committed Jul 24, 2012
1 parent 840e280 commit 1e2e9c4d6e075b092905b5e939625bf55b130090
Showing with 56 additions and 0 deletions.
  1. +2 −0 src/core/CMakeLists.txt
  2. +18 −0 src/core/composer/qgscomposermultiframe.cpp
  3. +36 −0 src/core/composer/qgscomposermultiframe.h
@@ -133,6 +133,7 @@ SET(QGIS_CORE_SRCS
composer/qgsnumericscalebarstyle.cpp
composer/qgssingleboxscalebarstyle.cpp
composer/qgsticksscalebarstyle.cpp
composer/qgscomposermultiframe.cpp
composer/qgscomposition.cpp

pal/costcalculator.cpp
@@ -280,6 +281,7 @@ SET(QGIS_CORE_MOC_HDRS
composer/qgscomposerlabel.h
composer/qgscomposershape.h
composer/qgscomposerattributetable.h
composer/qgscomposermultiframe.h
composer/qgscomposition.h

composer/qgslegendmodel.h
@@ -0,0 +1,18 @@
#include "qgscomposermultiframe.h"

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

QgsComposerMultiFrame::QgsComposerMultiFrame(): mComposition( 0 )
{
}

QgsComposerMultiFrame::~QgsComposerMultiFrame()
{
}

void QgsComposerMultiFrame::recalculateFrameSizes()
{
//todo...
}
@@ -0,0 +1,36 @@
#ifndef QGSCOMPOSERMULTIFRAME_H
#define QGSCOMPOSERMULTIFRAME_H

#include <QObject>
#include <QSizeF>

class QgsComposerItem;
class QgsComposition;

/**Abstract base class for composer entries with the ability to distribute the content to several frames (items)*/
class QgsComposerMultiFrame: public QObject
{
Q_OBJECT
public:

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;

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

void recalculateFrameSizes();

private:
QgsComposerMultiFrame(); //forbidden
};

#endif // QGSCOMPOSERMULTIFRAME_H

0 comments on commit 1e2e9c4

Please sign in to comment.
You can’t perform that action at this time.