2017-09-27 13:04:56 +03:00
|
|
|
#ifndef LRITEMSCONTAINERDESIGNITF_H
|
|
|
|
#define LRITEMSCONTAINERDESIGNITF_H
|
2017-04-05 00:58:04 +03:00
|
|
|
|
|
|
|
#include "lrbasedesignintf.h"
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
namespace LimeReport {
|
2017-04-05 00:58:04 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class LIMEREPORT_EXPORT Segment {
|
2017-04-05 00:58:04 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
Segment(qreal segmentStart, qreal segmentEnd): m_begin(segmentStart), m_end(segmentEnd) { }
|
2017-04-05 00:58:04 +03:00
|
|
|
bool intersect(Segment value);
|
|
|
|
qreal intersectValue(Segment value);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2017-04-05 00:58:04 +03:00
|
|
|
private:
|
|
|
|
qreal m_begin;
|
|
|
|
qreal m_end;
|
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class LIMEREPORT_EXPORT VSegment: public Segment {
|
2017-04-05 00:58:04 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
VSegment(QRectF rect): Segment(rect.top(), rect.bottom()) { }
|
2017-04-05 00:58:04 +03:00
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
struct LIMEREPORT_EXPORT HSegment: public Segment {
|
2017-04-05 00:58:04 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
HSegment(QRectF rect): Segment(rect.left(), rect.right()) { }
|
2017-04-05 00:58:04 +03:00
|
|
|
};
|
|
|
|
|
2022-10-30 20:44:59 +03:00
|
|
|
struct LIMEREPORT_EXPORT ItemSortContainer {
|
2017-04-05 00:58:04 +03:00
|
|
|
QRectF m_rect;
|
2024-09-04 17:31:16 +03:00
|
|
|
BaseDesignIntf* m_item;
|
|
|
|
ItemSortContainer(BaseDesignIntf* item)
|
|
|
|
{
|
|
|
|
m_item = item;
|
|
|
|
m_rect = item->geometry();
|
2017-04-05 00:58:04 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
typedef QSharedPointer<ItemSortContainer> PItemSortContainer;
|
|
|
|
bool LIMEREPORT_EXPORT itemSortContainerLessThen(const PItemSortContainer c1,
|
|
|
|
const PItemSortContainer c2);
|
2017-04-05 00:58:04 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class LIMEREPORT_EXPORT ItemsContainerDesignInft: public BookmarkContainerDesignIntf {
|
2019-02-12 22:45:35 +03:00
|
|
|
Q_OBJECT
|
2017-04-05 00:58:04 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0,
|
|
|
|
QGraphicsItem* parent = 0):
|
|
|
|
BookmarkContainerDesignIntf(xmlTypeName, owner, parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
enum SnapshotType {
|
|
|
|
Full,
|
|
|
|
IgnoreBands
|
|
|
|
};
|
|
|
|
|
2017-04-05 00:58:04 +03:00
|
|
|
protected:
|
2024-09-04 17:31:16 +03:00
|
|
|
void snapshotItemsLayout(SnapshotType type = Full);
|
|
|
|
void arrangeSubItems(RenderPass pass, DataSourceManager* dataManager,
|
|
|
|
ArrangeType type = AsNeeded);
|
|
|
|
qreal findMaxBottom() const;
|
|
|
|
qreal findMaxHeight() const;
|
|
|
|
qreal findMinTop() const;
|
2017-04-05 00:58:04 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
private:
|
|
|
|
QVector<PItemSortContainer> m_containerItems;
|
2017-04-05 00:58:04 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace LimeReport
|
|
|
|
|
|
|
|
#endif // ITEMSCONTAINERDESIGNITF_H
|