0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-03-14 22:33:48 +03:00
LimeReport/limereport/lritemdesignintf.h

93 lines
4.2 KiB
C
Raw Normal View History

2016-02-17 10:11:00 +03:00
/***************************************************************************
* 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 LRITEMDESIGNITTF_H
#define LRITEMDESIGNITTF_H
#include <QObject>
#include "lrbasedesignintf.h"
namespace LimeReport{
class BaseDesignIntf;
class ItemDesignIntf : public BaseDesignIntf
{
Q_OBJECT
Q_PROPERTY(LocationType itemLocation READ itemLocation WRITE setItemLocation)
Q_PROPERTY(bool stretchToMaxHeight READ stretchToMaxHeight WRITE setStretchToMaxHeight)
2016-02-17 10:39:17 +03:00
Q_PROPERTY(ItemAlign itemAlign READ itemAlign WRITE setItemAlign)
2016-02-17 10:11:00 +03:00
Q_ENUMS(LocationType)
public:
enum LocationType{Band,Page};
ItemDesignIntf(const QString& xmlTypeName, QObject* owner = 0,QGraphicsItem* parent = 0);
LocationType itemLocation(){return m_itemLocation;}
void setItemLocation(LocationType location);
void setStretchToMaxHeight(bool value);
bool stretchToMaxHeight(){return m_stretchToMaxHeight;}
BaseDesignIntf* cloneEmpty(int height, QObject *owner, QGraphicsItem *parent);
protected:
QGraphicsItem* bandByPos();
virtual void initFlags();
private:
LocationType m_itemLocation;
bool m_stretchToMaxHeight;
};
class Spacer :public ItemDesignIntf{
public:
Spacer(QObject* owner,QGraphicsItem* parent);
protected:
BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent){
return new Spacer(owner, parent);
}
};
class ContentItemDesignIntf : public ItemDesignIntf
{
Q_OBJECT
public:
ContentItemDesignIntf(const QString& xmlTypeName, QObject* owner = 0,QGraphicsItem* parent = 0)
:ItemDesignIntf(xmlTypeName,owner,parent){}
virtual QString content() const = 0;
virtual void setContent(const QString& value) = 0;
QMap<QString, QString> getStringForTranslation();
2016-02-17 10:11:00 +03:00
};
class LayoutDesignIntf : public ItemDesignIntf{
public:
LayoutDesignIntf(const QString& xmlTypeName, QObject* owner = 0,QGraphicsItem* parent = 0):
ItemDesignIntf(xmlTypeName,owner,parent){}
virtual void addChild(BaseDesignIntf *item,bool updateSize=true) = 0;
virtual void restoreChild(BaseDesignIntf *item) = 0;
virtual int childrenCount() = 0;
friend class BaseDesignIntf;
};
}
#endif // LRITEMDESIGNITTF_H