1 /***************************************************************************
2 * This file is part of the Lime Report project *
3 * Copyright (C) 2015 by Alexander Arin *
4 * arin_a@bk.ru *
5 * *
6 ** GNU General Public License Usage **
7 * *
8 * This library is free software: you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation, either version 3 of the License, or *
11 * (at your option) any later version. *
12 * You should have received a copy of the GNU General Public License *
13 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
14 * *
15 ** GNU Lesser General Public License **
16 * *
17 * This library is free software: you can redistribute it and/or modify *
18 * it under the terms of the GNU Lesser General Public License as *
19 * published by the Free Software Foundation, either version 3 of the *
20 * License, or (at your option) any later version. *
21 * You should have received a copy of the GNU Lesser General Public *
22 * License along with this library. *
23 * If not, see <http://www.gnu.org/licenses/>. *
24 * *
25 * This library is distributed in the hope that it will be useful, *
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28 * GNU General Public License for more details. *
29 ****************************************************************************/
30 #include "lrreportfooter.h"
31 #include "lrdesignelementsfactory.h"
32 #include "lrglobal.h"
33
34 const QString xmlTag ="ReportFooter";
35
36 namespace{
37
createBand(QObject * owner,LimeReport::BaseDesignIntf * parent)38 LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
39 return new LimeReport::ReportFooter(owner,parent);
40 }
41 bool VARIABLE_IS_NOT_USED registred = LimeReport::DesignElementsFactory::instance().registerCreator(
42 xmlTag,
43 LimeReport::ItemAttribs(QObject::tr("Report Footer"),LimeReport::Const::bandTAG),
44 createBand
45 );
46 }
47
48 namespace LimeReport{
49
ReportFooter(QObject * owner,QGraphicsItem * parent)50 ReportFooter::ReportFooter(QObject *owner, QGraphicsItem *parent)
51 : BandDesignIntf(LimeReport::BandDesignIntf::ReportFooter,xmlTag,owner,parent) {
52 setBandTypeText(tr("Report Footer"));
53 setMarkerColor(bandColor());
54 }
55
createSameTypeItem(QObject * owner,QGraphicsItem * parent)56 BaseDesignIntf *ReportFooter::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
57 {
58 return new ReportFooter(owner,parent);
59 }
60
bandColor() const61 QColor ReportFooter::bandColor() const
62 {
63 return QColor(152,69,167);
64 }
65
isFooter() const66 bool ReportFooter::isFooter() const
67 {
68 return true;
69 }
70
71 }
72