This commit is contained in:
Sergey Popovichev
2016-02-17 10:11:00 +03:00
parent 9720c7bc4f
commit 1e8f2f79c7
525 changed files with 35338 additions and 3 deletions

74
src/bands/lrdataband.cpp Normal file
View File

@@ -0,0 +1,74 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrdataband.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
const QString xmlTag ="Data";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataBand(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Data"),LimeReport::bandTAG),
createBand
);
}
namespace LimeReport {
DataBand::DataBand(QObject *owner, QGraphicsItem *parent)
: DataBandDesignIntf(LimeReport::BandDesignIntf::Data,xmlTag,owner,parent) {
setBandTypeText(tr("Data"));
setFixedPos(false);
setMarkerColor(bandColor());
}
bool DataBand::isUnique() const
{
return false;
}
QColor DataBand::bandColor() const
{
return QColor(Qt::darkGreen);
}
BaseDesignIntf *DataBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new DataBand(owner,parent);
}
}

55
src/bands/lrdataband.h Normal file
View File

@@ -0,0 +1,55 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRDATABAND_H
#define LRDATABAND_H
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
#include <QObject>
namespace LimeReport{
class DataBand : public DataBandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool keepSubdetailTogether READ tryToKeepTogether WRITE setTryToKeepTogether)
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable )
Q_PROPERTY(bool keepFooterTogether READ keepFooterTogether WRITE setKeepFooterTogether)
Q_PROPERTY(bool sliceLastRow READ sliceLastRow WRITE setSliceLastRow)
public:
DataBand(QObject* owner = 0, QGraphicsItem* parent=0);
bool isUnique() const;
bool isData() const {return true;}
protected:
QColor bandColor() const;
private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
};
}
#endif // LRDATABAND_H

156
src/bands/lrgroupbands.cpp Normal file
View File

@@ -0,0 +1,156 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrgroupbands.h"
#include "lrglobal.h"
#include "lrdatasourcemanager.h"
const QString xmlTagHeader = QLatin1String("GroupHeader");
const QString xmlTagFooter = QLatin1String("GroupFooter");
namespace{
LimeReport::BaseDesignIntf* createHeader(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::GroupBandHeader(owner,parent);
}
bool registredHeader = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagHeader,
LimeReport::ItemAttribs(QObject::tr("GroupHeader"),LimeReport::bandTAG),
createHeader
);
LimeReport::BaseDesignIntf * createFooter(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::GroupBandFooter(owner,parent);
}
bool registredFooter = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagFooter,
LimeReport::ItemAttribs(QObject::tr("GroupFooter"),LimeReport::bandTAG),
createFooter
);
}
namespace LimeReport{
GroupBandHeader::GroupBandHeader(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(BandDesignIntf::GroupHeader, xmlTagHeader, owner,parent),
m_groupFiledName(""), m_groupStarted(false)
{
setBandTypeText(tr("GroupHeader"));
setFixedPos(false);
setMarkerColor(bandColor());
}
bool GroupBandHeader::isUnique() const
{
return false;
}
//bool GroupBandHeader::tryToKeepTogether()
//{
// return m_tryToKeepTogether;
//}
BaseDesignIntf *GroupBandHeader::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new GroupBandHeader(owner, parent);
}
void GroupBandHeader::startGroup()
{
m_groupStarted=true;
DataSourceManager* dm = DataSourceManager::instance();
if ((dm->dataSource(parentBand()->datasourceName()))){
IDataSource* ds = dm->dataSource(parentBand()->datasourceName());
if (ds->columnIndexByName(m_groupFiledName)!=-1)
m_groupFieldValue=ds->data(m_groupFiledName);
}
}
QColor GroupBandHeader::bandColor() const
{
return QColor(Qt::darkBlue);
}
bool GroupBandHeader::isNeedToClose()
{
if (m_groupFieldValue.isNull()) return false;
DataSourceManager* dm = DataSourceManager::instance();
if ((dm->dataSource(parentBand()->datasourceName()))){
IDataSource* ds = dm->dataSource(parentBand()->datasourceName());
return ds->data(m_groupFiledName)!=m_groupFieldValue;
}
return false;
}
bool GroupBandHeader::isStarted()
{
return !m_groupFieldValue.isNull();
}
void GroupBandHeader::closeGroup()
{
m_groupFieldValue=QVariant();
m_groupStarted=false;
}
int GroupBandHeader::index()
{
return bandIndex();
}
GroupBandFooter::GroupBandFooter(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::GroupFooter, xmlTagFooter, owner,parent)
{
setBandTypeText(tr("GroupFooter"));
setFixedPos(false);
setMarkerColor(bandColor());
}
bool GroupBandFooter::isUnique() const
{
return false;
}
QColor GroupBandFooter::bandColor() const
{
return QColor(Qt::darkBlue);
}
BaseDesignIntf *GroupBandFooter::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new GroupBandFooter(owner,parent);
}
} //namespace LimeReport

76
src/bands/lrgroupbands.h Normal file
View File

@@ -0,0 +1,76 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRGROUPBANDS_H
#define LRGROUPBANDS_H
#include "lrbanddesignintf.h"
#include "lrdesignelementsfactory.h"
namespace LimeReport{
class GroupBandHeader : public BandDesignIntf, public IGropBand{
Q_OBJECT
Q_PROPERTY(QString groupFieldName READ groupFieldName WRITE setGroupFieldName)
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable )
Q_PROPERTY(bool keepGroupTogether READ tryToKeepTogether WRITE setTryToKeepTogether)
public:
GroupBandHeader(QObject* owner = 0, QGraphicsItem* parent=0);
virtual bool isUnique() const;
QVariant groupFieldValue(){return m_groupFieldValue;}
void setGroupFieldValue(QVariant value){m_groupFieldValue=value;}
QString groupFieldName(){return m_groupFiledName;}
void setGroupFieldName(QString fieldName){m_groupFiledName=fieldName;}
QColor bandColor() const;
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
virtual void startGroup();
virtual bool isNeedToClose();
virtual bool isStarted();
virtual void closeGroup();
virtual int index();
private:
QVariant m_groupFieldValue;
QString m_groupFiledName;
bool m_groupStarted;
};
class GroupBandFooter : public BandDesignIntf{
Q_OBJECT
public:
GroupBandFooter(QObject* owner = 0, QGraphicsItem* parent=0);
virtual bool isUnique() const;
QColor bandColor() const;
virtual bool isFooter() const{return true;}
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
};
} // namespace LimeReport
#endif // LRGROUPBANDS_H

View File

@@ -0,0 +1,66 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrpagefooter.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
const QString xmlTag ="PageFooter";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::PageFooter(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Page Footer"),LimeReport::bandTAG),
createBand
);
}
namespace LimeReport{
PageFooter::PageFooter(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(LimeReport::BandDesignIntf::PageFooter,xmlTag,owner,parent) {
setBandTypeText( tr("Page Footer") );
setMarkerColor(bandColor());
}
BaseDesignIntf *PageFooter::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new PageFooter(owner,parent);
}
QColor PageFooter::bandColor() const
{
return QColor(246,120,12);
}
} // namespace LimeReport

50
src/bands/lrpagefooter.h Normal file
View File

@@ -0,0 +1,50 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRPAGEFOOTER_H
#define LRPAGEFOOTER_H
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
#include <QObject>
namespace LimeReport{
class PageFooter : public LimeReport::BandDesignIntf
{
Q_OBJECT
public:
PageFooter(QObject* owner = 0, QGraphicsItem* parent=0);
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
virtual bool isFooter() const {return true;}
protected:
QColor bandColor() const;
};
}
#endif // LRPAGEFOOTER_H

View File

@@ -0,0 +1,70 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrpageheader.h"
#include "lrdesignelementsfactory.h"
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
#include "lrpageitemdesignintf.h"
#include "lrglobal.h"
const QString xmlTag ="PageHeader";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::PageHeader(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Page Header"),LimeReport::bandTAG),
createBand
);
}
namespace LimeReport{
PageHeader::PageHeader(QObject* owner, QGraphicsItem *parent)
: BandDesignIntf(LimeReport::BandDesignIntf::PageHeader,xmlTag,owner,parent) {
setBandTypeText(tr("Page Header"));
setMarkerColor(bandColor());
}
BaseDesignIntf *PageHeader::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new PageHeader(owner,parent);
}
QColor PageHeader::bandColor() const
{
return QColor(246,120,12);
}
}

48
src/bands/lrpageheader.h Normal file
View File

@@ -0,0 +1,48 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRPAGEHEADER_H
#define LRPAGEHEADER_H
#include <QObject>
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
namespace LimeReport {
class PageHeader : public LimeReport::BandDesignIntf
{
Q_OBJECT
public:
PageHeader(QObject* owner = 0, QGraphicsItem* parent=0);
protected:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
QColor bandColor() const;
};
}
#endif // LRPAGEHEADER_H

View File

@@ -0,0 +1,71 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrreportfooter.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
const QString xmlTag ="ReportFooter";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::ReportFooter(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Report Footer"),LimeReport::bandTAG),
createBand
);
}
namespace LimeReport{
ReportFooter::ReportFooter(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(LimeReport::BandDesignIntf::ReportFooter,xmlTag,owner,parent) {
setBandTypeText(tr("Report Footer"));
setMarkerColor(bandColor());
}
BaseDesignIntf *ReportFooter::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new ReportFooter(owner,parent);
}
QColor ReportFooter::bandColor() const
{
return QColor(152,69,167);
}
bool ReportFooter::isFooter() const
{
return true;
}
}

View File

@@ -0,0 +1,51 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRREPORTFOOTER_H
#define LRREPORTFOOTER_H
#include <QObject>
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
namespace LimeReport{
class ReportFooter : public BandDesignIntf
{
Q_OBJECT
Q_PROPERTY(int maxScalePercent READ maxScalePercent WRITE setMaxScalePercent)
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable)
public:
ReportFooter(QObject* owner=0, QGraphicsItem* parent=0);
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
protected:
QColor bandColor() const;
bool isFooter() const;
};
}
#endif // LRREPORTFOOTER_H

View File

@@ -0,0 +1,64 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrreportheader.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
const QString xmlTag ="ReportHeader";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::ReportHeader(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Report Header"),LimeReport::bandTAG),
createBand
);
}
namespace LimeReport {
ReportHeader::ReportHeader(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(LimeReport::BandDesignIntf::ReportHeader,xmlTag,owner,parent) {
setBandTypeText(tr("Report Header"));
setMarkerColor(bandColor());
}
BaseDesignIntf *ReportHeader::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new ReportHeader(owner,parent);
}
QColor ReportHeader::bandColor() const
{
return QColor(152,69,167);
}
}

View File

@@ -0,0 +1,49 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRREPORTHEADER_H
#define LRREPORTHEADER_H
#include <QObject>
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
namespace LimeReport{
class ReportHeader : public LimeReport::BandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable )
public:
ReportHeader(QObject* owner = 0, QGraphicsItem *parent=0);
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
protected:
QColor bandColor() const;
};
}
#endif // LRREPORTHEADER_H

View File

@@ -0,0 +1,153 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include "lrsubdetailband.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
const QString xmlTagBand = QLatin1String("SubDetail");
const QString xmlTagHeader = QLatin1String("SubDetailHeader");
const QString xmlTagFooter = QLatin1String("SubDetailFooter");
const QColor BAND_COLOR = Qt::red;
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::SubDetailBand(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagBand,
LimeReport::ItemAttribs(QObject::tr("SubDetail"),LimeReport::bandTAG),
createBand
);
LimeReport::BaseDesignIntf * createHeader(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::SubDetailHeaderBand(owner,parent);
}
bool registredHeader = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagHeader,
LimeReport::ItemAttribs(QObject::tr("SubDetailHeader"),LimeReport::bandTAG),
createHeader
);
LimeReport::BaseDesignIntf * createFooter(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::SubDetailFooterBand(owner,parent);
}
bool registredFooter = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagFooter,
LimeReport::ItemAttribs(QObject::tr("SubDetailFooter"),LimeReport::bandTAG),
createFooter
);
} // namespace
namespace LimeReport{
//SubDetailBand
SubDetailBand::SubDetailBand(QObject *owner, QGraphicsItem *parent)
: DataBandDesignIntf(BandDesignIntf::SubDetailBand, xmlTagBand, owner,parent)
{
setBandTypeText(tr("SubDetail"));
setFixedPos(false);
setMarkerColor(bandColor());
}
bool SubDetailBand::isHasHeader() const
{
return isConnectedToBand(BandDesignIntf::SubDetailHeader);
}
bool SubDetailBand::isHasFooter() const
{
return isConnectedToBand(BandDesignIntf::SubDetailFooter);
}
BaseDesignIntf *SubDetailBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new SubDetailBand(owner,parent);
}
QColor SubDetailBand::bandColor() const
{
return BAND_COLOR;
}
//SubDetailHeaderBand
SubDetailHeaderBand::SubDetailHeaderBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::SubDetailHeader,xmlTagHeader,owner,parent), m_printAlways(false)
{
setMarkerColor(bandColor());
}
bool SubDetailHeaderBand::isUnique() const
{
return false;
}
QColor SubDetailHeaderBand::bandColor() const
{
return BAND_COLOR;
}
BaseDesignIntf *SubDetailHeaderBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new SubDetailHeaderBand(owner,parent);
}
//SubDetailFooterBand
SubDetailFooterBand::SubDetailFooterBand(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(BandDesignIntf::SubDetailFooter,xmlTagFooter,owner,parent), m_printAlways(false)
{
setMarkerColor(bandColor());
}
bool SubDetailFooterBand::isUnique() const
{
return false;
}
QColor SubDetailFooterBand::bandColor() const
{
return BAND_COLOR;
}
BaseDesignIntf *SubDetailFooterBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{
return new SubDetailFooterBand(owner,parent);
}
}

View File

@@ -0,0 +1,89 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library 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 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRSUBDETAILBAND_H
#define LRSUBDETAILBAND_H
#include "lrbanddesignintf.h"
#include "lrbasedesignintf.h"
namespace LimeReport{
class SubDetailBand : public DataBandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable)
public:
SubDetailBand(QObject* owner = 0, QGraphicsItem* parent=0);
bool isUnique() const {return false;}
bool isHasHeader() const;
bool isHasFooter() const;
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
protected:
virtual QColor bandColor() const;
};
class SubDetailHeaderBand : public BandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool printAlways READ printAlways() WRITE setPrintAlways())
public:
SubDetailHeaderBand(QObject* owner = 0, QGraphicsItem* parent=0);
virtual bool isUnique() const;
void setPrintAlways(bool value){m_printAlways=value;}
bool printAlways(){return m_printAlways;}
protected:
virtual QColor bandColor() const;
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
private:
bool m_printAlways;
};
class SubDetailFooterBand : public BandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool printAlways READ printAlways() WRITE setPrintAlways())
public:
SubDetailFooterBand(QObject* owner = 0, QGraphicsItem* parent=0);
void setPrintAlways(bool value){m_printAlways=value;}
bool printAlways(){return m_printAlways;}
virtual bool isUnique() const;
virtual bool isFooter() const{return true;}
protected:
virtual QColor bandColor() const;
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
private:
bool m_printAlways;
};
}
#endif // LRSUBDETAILBAND_H