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 #ifndef LRDESIGNELEMENTSFACTORY_H
31 #define LRDESIGNELEMENTSFACTORY_H
32 
33 #include "lrbanddesignintf.h"
34 #include "lrattribsabstractfactory.h"
35 #include "lrsimpleabstractfactory.h"
36 #include "lrsingleton.h"
37 
38 namespace LimeReport{
39 
40 typedef BaseDesignIntf* (*CreateBand)(QObject* owner, BaseDesignIntf*  parent);
41 
42 struct ItemAttribs{
43     QString m_alias;
44     QString m_tag;
ItemAttribsItemAttribs45     ItemAttribs(){}
ItemAttribsItemAttribs46     ItemAttribs(const QString& alias, const QString& tag):m_alias(alias),m_tag(tag){}
47     bool operator==( const ItemAttribs &right) const {
48         return (m_alias==right.m_alias) && (m_tag==right.m_tag);
49     }
50 };
51 
52 class DesignElementsFactory : public AttribsAbstractFactory<LimeReport::BaseDesignIntf, QString, CreateBand, ItemAttribs>
53 {
54 private:
55     friend class Singleton<DesignElementsFactory>;
56 private:
DesignElementsFactory()57     DesignElementsFactory(){}
~DesignElementsFactory()58     ~DesignElementsFactory(){}
DesignElementsFactory(const DesignElementsFactory &)59     DesignElementsFactory(const DesignElementsFactory&){}
60     DesignElementsFactory& operator = (const DesignElementsFactory&){return *this;}
61 };
62 
63 }
64 #endif // LRDESIGNELEMENTSFACTORY_H
65