0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 08:29:07 +03:00

Change to subforder project model.

This commit is contained in:
newsages
2016-03-21 02:12:30 +01:00
parent 9797b30d0a
commit 598d4f10ed
531 changed files with 167 additions and 2522 deletions

View File

@@ -0,0 +1,107 @@
/***************************************************************************
* 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";
const QString xmlTagHeader = "DataHeader";
const QString xmlTagFooter = "DataFooter";
namespace{
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataBand(owner,parent);
}
LimeReport::BaseDesignIntf * createHeader(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataHeaderBand(owner,parent);
}
LimeReport::BaseDesignIntf * createFooter(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataFooterBand(owner,parent);
}
bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Data"),LimeReport::Const::bandTAG),
createBand
);
bool registredHeader = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagHeader,
LimeReport::ItemAttribs(QObject::tr("DataHeader"),LimeReport::Const::bandTAG),
createHeader
);
bool registredFooter = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagFooter,
LimeReport::ItemAttribs(QObject::tr("DataFooter"),LimeReport::Const::bandTAG),
createFooter
);
}
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);
}
DataHeaderBand::DataHeaderBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::DataHeader,xmlTagHeader,owner,parent)
{
setBandTypeText(tr("DataHeader"));
setMarkerColor(bandColor());
}
DataFooterBand::DataFooterBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::DataFooter,xmlTagFooter,owner,parent)
{
setBandTypeText(tr("DataFooter"));
setMarkerColor(bandColor());
}
}

View File

@@ -0,0 +1,90 @@
/***************************************************************************
* 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)
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
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);
};
class DataHeaderBand : public BandDesignIntf
{
Q_OBJECT
Q_PROPERTY(bool reprintOnEachPage READ reprintOnEachPage WRITE setReprintOnEachPage)
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
public:
DataHeaderBand(QObject* owner=0, QGraphicsItem* parent=0);
bool isUnique() const {return false;}
bool isHeader() const {return true;}
QColor bandColor() const {return QColor(Qt::darkGreen);}
private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){
return new DataHeaderBand(owner,parent);
}
};
class DataFooterBand : public BandDesignIntf
{
Q_OBJECT
public:
DataFooterBand(QObject* owner=0, QGraphicsItem* parent=0);
bool isUnique() const {return false;}
bool isFooter() const {return true;}
QColor bandColor() const{return QColor(Qt::darkGreen);}
private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){
return new DataFooterBand(owner,parent);
}
};
}
#endif // LRDATABAND_H

View File

@@ -0,0 +1,182 @@
/***************************************************************************
* 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::Const::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::Const::bandTAG),
createFooter
);
}
namespace LimeReport{
GroupBandHeader::GroupBandHeader(QObject *owner, QGraphicsItem *parent)
: BandDesignIntf(BandDesignIntf::GroupHeader, xmlTagHeader, owner,parent),
m_groupFiledName(""), m_groupStarted(false), m_resetPageNumber(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(DataSourceManager* dataManager)
{
m_groupStarted=true;
QString lineVar = QLatin1String("line_")+objectName().toLower();
dataManager->setReportVariable(lineVar,1);
if ((dataManager->dataSource(parentBand()->datasourceName()))){
IDataSource* ds = dataManager->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(DataSourceManager* dataManager)
{
//if (m_groupFieldValue.isNull()) return false;
if (!m_groupStarted) return false;
if (m_groupFiledName.isNull() || m_groupFiledName.isEmpty())
dataManager->putError("Group Field Not found");
if ((dataManager->dataSource(parentBand()->datasourceName()))){
IDataSource* ds = dataManager->dataSource(parentBand()->datasourceName());
if (ds->data(m_groupFiledName).isNull() && m_groupFieldValue.isNull()) return false;
return ds->data(m_groupFiledName)!=m_groupFieldValue;
}
return false;
}
bool GroupBandHeader::isStarted()
{
return m_groupStarted;//!m_groupFieldValue.isNull();
}
void GroupBandHeader::closeGroup()
{
m_groupFieldValue=QVariant();
m_groupStarted=false;
}
int GroupBandHeader::index()
{
return bandIndex();
}
bool GroupBandHeader::startNewPage() const
{
return BandDesignIntf::startNewPage();
}
void GroupBandHeader::setStartNewPage(bool startNewPage)
{
BandDesignIntf::setStartNewPage(startNewPage);
}
bool GroupBandHeader::resetPageNumber() const
{
return m_resetPageNumber;
}
void GroupBandHeader::setResetPageNumber(bool resetPageNumber)
{
m_resetPageNumber = resetPageNumber;
}
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

View File

@@ -0,0 +1,87 @@
/***************************************************************************
* 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 IGroupBand{
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)
Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
Q_PROPERTY(bool resetPageNumber READ resetPageNumber WRITE setResetPageNumber)
Q_PROPERTY(bool reprintOnEachPage READ reprintOnEachPage WRITE setReprintOnEachPage)
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;
bool startNewPage() const;
void setStartNewPage(bool startNewPage);
bool resetPageNumber() const;
void setResetPageNumber(bool resetPageNumber);
bool isHeader() const{return true;}
bool isGroupHeader() const {return true;}
private:
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
void startGroup(DataSourceManager* dataManager);
bool isNeedToClose(DataSourceManager *dataManager);
bool isStarted();
void closeGroup();
int index();
private:
QVariant m_groupFieldValue;
QString m_groupFiledName;
bool m_groupStarted;
//bool m_startNewPage;
bool m_resetPageNumber;
};
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::Const::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

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::Const::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);
}
}

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::Const::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::Const::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,154 @@
/***************************************************************************
* 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::Const::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::Const::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::Const::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)
{
setBandTypeText(tr("SubDetailHeader"));
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,91 @@
/***************************************************************************
* 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)
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
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);
bool isUnique() const;
void setPrintAlways(bool value){m_printAlways=value;}
bool printAlways(){return m_printAlways;}
protected:
QColor bandColor() const;
private:
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;
bool isFooter() const{return true;}
protected:
QColor bandColor() const;
private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
private:
bool m_printAlways;
};
}
#endif // LRSUBDETAILBAND_H