mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-20 06:30:03 +03:00
Finish 1.4.115
# Conflicts: # limereport/lrpagedesignintf.h
This commit is contained in:
@@ -100,227 +100,210 @@ namespace LimeReport {
|
||||
class PageDesignIntf : public QGraphicsScene, public ObjectLoadingStateIntf{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QObject* pageItem READ pageItem())
|
||||
public:
|
||||
friend class PropertyChangedCommand;
|
||||
friend class InsertHLayoutCommand;
|
||||
friend class InsertVLayoutCommand;
|
||||
enum Orientation {Portrait, Landscape};
|
||||
enum PageSize {A4, B5, Letter, Legal, Executive,
|
||||
A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
|
||||
B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
|
||||
DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom
|
||||
};
|
||||
public:
|
||||
friend class PropertyChangedCommand;
|
||||
friend class InsertHLayoutCommand;
|
||||
friend class InsertVLayoutCommand;
|
||||
explicit PageDesignIntf(QObject* parent = 0);
|
||||
~PageDesignIntf();
|
||||
void updatePageRect();
|
||||
void startInsertMode(const QString& ItemType);
|
||||
void startEditMode();
|
||||
|
||||
explicit PageDesignIntf(QObject* parent = 0);
|
||||
~PageDesignIntf();
|
||||
void updatePageRect();
|
||||
Orientation getOrientation();
|
||||
PageItemDesignIntf *pageItem();
|
||||
void setPageItem(PageItemDesignIntf::Ptr pageItem);
|
||||
void setPageItems(QList<PageItemDesignIntf::Ptr> pages);
|
||||
QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;}
|
||||
|
||||
void setPageSize(PageSize sizeType, QSizeF sizeValue=QSizeF());
|
||||
PageSize pageSize() const;
|
||||
bool isItemInsertMode();
|
||||
ReportEnginePrivate* reportEditor();
|
||||
void setReportEditor(ReportEnginePrivate* value){m_reportEditor=value;}
|
||||
|
||||
void startInsertMode(const QString& ItemType);
|
||||
void startEditMode();
|
||||
QStringList possibleParentItems();
|
||||
void registerItem(BaseDesignIntf* item);
|
||||
void registerBand(BandDesignIntf* band);
|
||||
void removeAllItems();
|
||||
|
||||
PageItemDesignIntf *pageItem();
|
||||
void setPageItem(PageItemDesignIntf::Ptr pageItem);
|
||||
void setPageItems(QList<PageItemDesignIntf::Ptr> pages);
|
||||
QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;}
|
||||
void setItemMode(BaseDesignIntf::ItemMode state);
|
||||
BaseDesignIntf::ItemMode itemMode(){return m_itemMode;}
|
||||
BaseDesignIntf* reportItemByName(const QString& name);
|
||||
QList<BaseDesignIntf *> reportItemsByName(const QString &name);
|
||||
BandDesignIntf* bandAt(QPointF pos);
|
||||
BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size);
|
||||
BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);
|
||||
BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);
|
||||
void removeReportItem(BaseDesignIntf* item, bool createComand = true);
|
||||
CommandIf::Ptr removeReportItemCommand(BaseDesignIntf *item);
|
||||
bool saveCommand(CommandIf::Ptr command, bool runCommand = true);
|
||||
|
||||
bool isItemInsertMode();
|
||||
ReportEnginePrivate* reportEditor();
|
||||
void setReportEditor(ReportEnginePrivate* value){m_reportEditor=value;}
|
||||
bool isCanRedo();
|
||||
bool isCanUndo();
|
||||
bool isHasChanges();
|
||||
|
||||
QStringList possibleParentItems();
|
||||
void registerItem(BaseDesignIntf* item);
|
||||
void registerBand(BandDesignIntf* band);
|
||||
void removeAllItems();
|
||||
void reactivatePageItem(PageItemDesignIntf::Ptr pageItem);
|
||||
|
||||
void setItemMode(BaseDesignIntf::ItemMode state);
|
||||
BaseDesignIntf::ItemMode itemMode(){return m_itemMode;}
|
||||
BaseDesignIntf* reportItemByName(const QString& name);
|
||||
QList<BaseDesignIntf *> reportItemsByName(const QString &name);
|
||||
BandDesignIntf* bandAt(QPointF pos);
|
||||
BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size);
|
||||
BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);
|
||||
BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);
|
||||
void removeReportItem(BaseDesignIntf* item, bool createComand = true);
|
||||
CommandIf::Ptr removeReportItemCommand(BaseDesignIntf *item);
|
||||
bool saveCommand(CommandIf::Ptr command, bool runCommand = true);
|
||||
void setSettings(QSettings* settings){ m_settings = settings;}
|
||||
QSettings* settings(){ return m_settings;}
|
||||
|
||||
bool isCanRedo();
|
||||
bool isCanUndo();
|
||||
bool isHasChanges();
|
||||
QString genObjectName(const QObject& object);
|
||||
|
||||
void reactivatePageItem(PageItemDesignIntf::Ptr pageItem);
|
||||
void animateItem(BaseDesignIntf* item);
|
||||
void setSelectionRect(QRectF selectionRect);
|
||||
void emitRegisterdItem(BaseDesignIntf *item);
|
||||
void emitItemRemoved(BaseDesignIntf* item);
|
||||
|
||||
void setSettings(QSettings* settings){ m_settings = settings;}
|
||||
QSettings* settings(){ return m_settings;}
|
||||
DataSourceManager* datasourceManager();
|
||||
bool isSaved(){ return !m_hasHanges;}
|
||||
void changeSelectedGrpoupTextAlignPropperty(const bool& horizontalAlign, Qt::AlignmentFlag flag);
|
||||
|
||||
QString genObjectName(const QObject& object);
|
||||
int verticalGridStep() const;
|
||||
void setVerticalGridStep(int verticalGridStep);
|
||||
|
||||
void animateItem(BaseDesignIntf* item);
|
||||
void setSelectionRect(QRectF selectionRect);
|
||||
void emitRegisterdItem(BaseDesignIntf *item);
|
||||
void emitItemRemoved(BaseDesignIntf* item);
|
||||
int horizontalGridStep() const;
|
||||
void setHorizontalGridStep(int horizontalGridStep);
|
||||
|
||||
DataSourceManager* datasourceManager();
|
||||
bool isSaved(){ return !m_hasHanges;}
|
||||
void changeSelectedGrpoupTextAlignPropperty(const bool& horizontalAlign, Qt::AlignmentFlag flag);
|
||||
void beginUpdate(){m_updating = true;}
|
||||
bool isUpdating(){return m_updating;}
|
||||
void endUpdate();
|
||||
|
||||
int verticalGridStep() const;
|
||||
void setVerticalGridStep(int verticalGridStep);
|
||||
void itemMoved(BaseDesignIntf* item);
|
||||
bool magneticMovement() const;
|
||||
void setMagneticMovement(bool magneticMovement);
|
||||
|
||||
int horizontalGridStep() const;
|
||||
void setHorizontalGridStep(int horizontalGridStep);
|
||||
ReportSettings *getReportSettings() const;
|
||||
void setReportSettings(ReportSettings *reportSettings);
|
||||
|
||||
void beginUpdate(){m_updating = true;}
|
||||
bool isUpdating(){return m_updating;}
|
||||
void endUpdate();
|
||||
|
||||
void itemMoved(BaseDesignIntf* item);
|
||||
bool magneticMovement() const;
|
||||
void setMagneticMovement(bool magneticMovement);
|
||||
|
||||
ReportSettings *getReportSettings() const;
|
||||
void setReportSettings(ReportSettings *reportSettings);
|
||||
|
||||
void setPropertyToSelectedItems(const char *name, const QVariant &value);
|
||||
void setPropertyToSelectedItems(const char *name, const QVariant &value);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void keyPressEvent(QKeyEvent *event);
|
||||
virtual void keyReleaseEvent(QKeyEvent *event);
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void keyPressEvent(QKeyEvent *event);
|
||||
virtual void keyReleaseEvent(QKeyEvent *event);
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *);
|
||||
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *);
|
||||
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||
|
||||
LimeReport::BandDesignIntf::BandsType findPriorType(LimeReport::BandDesignIntf::BandsType bandType);
|
||||
BaseDesignIntf *findDestObject(BaseDesignIntf *item);
|
||||
LimeReport::BandDesignIntf::BandsType findPriorType(LimeReport::BandDesignIntf::BandsType bandType);
|
||||
BaseDesignIntf *findDestObject(BaseDesignIntf *item);
|
||||
|
||||
bool isExistsObjectName (const QString& objectName, QList<QGraphicsItem *> &itemsList) const;
|
||||
QRectF getRectByPageSize(PageSize pageSize);
|
||||
bool isExistsObjectName (const QString& objectName, QList<QGraphicsItem *> &itemsList) const;
|
||||
|
||||
bool isLoading();
|
||||
void objectLoadStarted();
|
||||
void objectLoadFinished();
|
||||
bool isLoading();
|
||||
void objectLoadStarted();
|
||||
void objectLoadFinished();
|
||||
|
||||
HorizontalLayout* internalAddHLayout();
|
||||
VerticalLayout* internalAddVLayout();
|
||||
QPointF placePosOnGrid(QPointF point);
|
||||
QSizeF placeSizeOnGrid(QSizeF size);
|
||||
HorizontalLayout* internalAddHLayout();
|
||||
VerticalLayout* internalAddVLayout();
|
||||
QPointF placePosOnGrid(QPointF point);
|
||||
QSizeF placeSizeOnGrid(QSizeF size);
|
||||
signals:
|
||||
void geometryChanged(QRectF newGeometry);
|
||||
void insertModeStarted();
|
||||
void itemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType);
|
||||
void itemInsertCanceled(const QString& ItemType);
|
||||
void itemSelected(LimeReport::BaseDesignIntf *item);
|
||||
void multiItemsSelected(QList<QObject*>* objectsList);
|
||||
void miltiItemsSelectionFinished();
|
||||
void commandHistoryChanged();
|
||||
void itemPropertyChanged(const QString& objectName, const QString& propertyName, const QVariant& oldValue, const QVariant& newValue);
|
||||
void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||
void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||
void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
||||
void bandRemoved(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
||||
void pageUpdateFinished(LimeReport::PageDesignIntf* page);
|
||||
public slots:
|
||||
BaseDesignIntf* addBand(const QString& bandType);
|
||||
BaseDesignIntf* addBand(BandDesignIntf::BandsType bandType);
|
||||
void removeBand(LimeReport::BandDesignIntf* band);
|
||||
void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||
void bandPosChanged(QObject* object, QPointF newPos, QPointF oldPos);
|
||||
void slotUpdateItemSize();
|
||||
void undo();
|
||||
void redo();
|
||||
void copy();
|
||||
void paste();
|
||||
void deleteSelected();
|
||||
void cut();
|
||||
void setToSaved();
|
||||
void bringToFront();
|
||||
void sendToBack();
|
||||
void alignToLeft();
|
||||
void alignToRigth();
|
||||
void alignToVCenter();
|
||||
void alignToTop();
|
||||
void alignToBottom();
|
||||
void alignToHCenter();
|
||||
void sameWidth();
|
||||
void sameHeight();
|
||||
void addHLayout();
|
||||
void addVLayout();
|
||||
void setFont(const QFont &font);
|
||||
void setTextAlign(const Qt::Alignment& alignment);
|
||||
void setBorders(const BaseDesignIntf::BorderLines& border);
|
||||
private slots:
|
||||
void slotPageGeometryChanged(QObject*, QRectF, QRectF );
|
||||
void slotItemPropertyChanged(QString propertyName, const QVariant &oldValue, const QVariant &newValue);
|
||||
void slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
||||
void bandDeleted(QObject* band);
|
||||
void slotPageItemLoaded(QObject *);
|
||||
void slotSelectionChanged();
|
||||
void slotAnimationStoped(QObject *animation);
|
||||
private:
|
||||
template <typename T>
|
||||
BaseDesignIntf* internalAddBand(T bandType);
|
||||
void finalizeInsertMode();
|
||||
void saveSelectedItemsPos();
|
||||
void saveSelectedItemsGeometry();
|
||||
void checkSizeOrPosChanges();
|
||||
CommandIf::Ptr createChangePosCommand();
|
||||
CommandIf::Ptr createChangeSizeCommand();
|
||||
void saveChangeProppertyCommand(const QString& objectName, const QString& propertyName, const QVariant& oldPropertyValue, const QVariant& newPropertyValue);
|
||||
void changeSelectedGroupProperty(const QString& name,const QVariant& value);
|
||||
void geometryChanged(QRectF newGeometry);
|
||||
void insertModeStarted();
|
||||
void itemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType);
|
||||
void itemInsertCanceled(const QString& ItemType);
|
||||
void itemSelected(LimeReport::BaseDesignIntf *item);
|
||||
void multiItemsSelected(QList<QObject*>* objectsList);
|
||||
void miltiItemsSelectionFinished();
|
||||
void commandHistoryChanged();
|
||||
void itemPropertyChanged(const QString& objectName, const QString& propertyName, const QVariant& oldValue, const QVariant& newValue);
|
||||
void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||
void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||
void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
||||
void bandRemoved(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
||||
void pageUpdateFinished(LimeReport::PageDesignIntf* page);
|
||||
public slots:
|
||||
BaseDesignIntf* addBand(const QString& bandType);
|
||||
BaseDesignIntf* addBand(BandDesignIntf::BandsType bandType);
|
||||
void removeBand(LimeReport::BandDesignIntf* band);
|
||||
void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||
void bandPosChanged(QObject* object, QPointF newPos, QPointF oldPos);
|
||||
void slotUpdateItemSize();
|
||||
void undo();
|
||||
void redo();
|
||||
void copy();
|
||||
void paste();
|
||||
void deleteSelected();
|
||||
void cut();
|
||||
void setToSaved();
|
||||
void bringToFront();
|
||||
void sendToBack();
|
||||
void alignToLeft();
|
||||
void alignToRigth();
|
||||
void alignToVCenter();
|
||||
void alignToTop();
|
||||
void alignToBottom();
|
||||
void alignToHCenter();
|
||||
void sameWidth();
|
||||
void sameHeight();
|
||||
void addHLayout();
|
||||
void addVLayout();
|
||||
void setFont(const QFont &font);
|
||||
void setTextAlign(const Qt::Alignment& alignment);
|
||||
void setBorders(const BaseDesignIntf::BorderLines& border);
|
||||
private slots:
|
||||
void slotPageGeometryChanged(QObject*, QRectF, QRectF );
|
||||
void slotItemPropertyChanged(QString propertyName, const QVariant &oldValue, const QVariant &newValue);
|
||||
void slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
||||
void bandDeleted(QObject* band);
|
||||
void slotPageItemLoaded(QObject *);
|
||||
void slotSelectionChanged();
|
||||
void slotAnimationStoped(QObject *animation);
|
||||
private:
|
||||
template <typename T>
|
||||
BaseDesignIntf* internalAddBand(T bandType);
|
||||
void finalizeInsertMode();
|
||||
void saveSelectedItemsPos();
|
||||
void saveSelectedItemsGeometry();
|
||||
void checkSizeOrPosChanges();
|
||||
CommandIf::Ptr createChangePosCommand();
|
||||
CommandIf::Ptr createChangeSizeCommand();
|
||||
void saveChangeProppertyCommand(const QString& objectName, const QString& propertyName, const QVariant& oldPropertyValue, const QVariant& newPropertyValue);
|
||||
void changeSelectedGroupProperty(const QString& name,const QVariant& value);
|
||||
|
||||
private:
|
||||
enum JoinType{Width, Height};
|
||||
PageSize m_pageSize;
|
||||
QSizeF m_pageSizeValue;
|
||||
Orientation m_orientation;
|
||||
QRectF m_geometry;
|
||||
LimeReport::PageItemDesignIntf::Ptr m_pageItem;
|
||||
QList<PageItemDesignIntf::Ptr> m_reportPages;
|
||||
ReportEnginePrivate* m_reportEditor;
|
||||
bool m_insertMode;
|
||||
QGraphicsItem * m_itemInsertRect;
|
||||
QString m_insertItemType;
|
||||
BaseDesignIntf::ItemMode m_itemMode;
|
||||
QGraphicsRectItem* m_cutterBorder;
|
||||
QGraphicsRectItem* m_pageRect;
|
||||
QVector<CommandIf::Ptr> m_commandsList;
|
||||
QVector<ReportItemPos> m_positionStamp;
|
||||
QVector<ReportItemSize> m_geometryStamp;
|
||||
BaseDesignIntf* m_firstSelectedItem;
|
||||
int m_currentCommand;
|
||||
bool m_changeSizeMode;
|
||||
bool m_changePosMode;
|
||||
bool m_changePosOrSizeMode;
|
||||
bool m_executingCommand;
|
||||
bool m_hasHanges;
|
||||
bool m_isLoading;
|
||||
bool m_executingGroupCommand;
|
||||
QSettings* m_settings;
|
||||
QList<QObject*> m_animationList;
|
||||
QPointF m_startSelectionPoint;
|
||||
QGraphicsRectItem* m_selectionRect;
|
||||
int m_verticalGridStep;
|
||||
int m_horizontalGridStep;
|
||||
bool m_updating;
|
||||
int m_currentObjectIndex;
|
||||
bool m_multiSelectStarted;
|
||||
QList<ItemProjections> m_projections;
|
||||
BaseDesignIntf* m_movedItem;
|
||||
BaseDesignIntf* m_movedItemContainer;
|
||||
BaseDesignIntf* m_joinItem;
|
||||
JoinType m_joinType;
|
||||
bool m_magneticMovement;
|
||||
ReportSettings* m_reportSettings;
|
||||
private:
|
||||
enum JoinType{Width, Height};
|
||||
LimeReport::PageItemDesignIntf::Ptr m_pageItem;
|
||||
QList<PageItemDesignIntf::Ptr> m_reportPages;
|
||||
ReportEnginePrivate* m_reportEditor;
|
||||
bool m_insertMode;
|
||||
QGraphicsItem * m_itemInsertRect;
|
||||
QString m_insertItemType;
|
||||
BaseDesignIntf::ItemMode m_itemMode;
|
||||
QGraphicsRectItem* m_cutterBorder;
|
||||
QGraphicsRectItem* m_pageRect;
|
||||
QVector<CommandIf::Ptr> m_commandsList;
|
||||
QVector<ReportItemPos> m_positionStamp;
|
||||
QVector<ReportItemSize> m_geometryStamp;
|
||||
BaseDesignIntf* m_firstSelectedItem;
|
||||
int m_currentCommand;
|
||||
bool m_changeSizeMode;
|
||||
bool m_changePosMode;
|
||||
bool m_changePosOrSizeMode;
|
||||
bool m_executingCommand;
|
||||
bool m_hasHanges;
|
||||
bool m_isLoading;
|
||||
bool m_executingGroupCommand;
|
||||
QSettings* m_settings;
|
||||
QList<QObject*> m_animationList;
|
||||
QPointF m_startSelectionPoint;
|
||||
QGraphicsRectItem* m_selectionRect;
|
||||
int m_verticalGridStep;
|
||||
int m_horizontalGridStep;
|
||||
bool m_updating;
|
||||
int m_currentObjectIndex;
|
||||
bool m_multiSelectStarted;
|
||||
QList<ItemProjections> m_projections;
|
||||
BaseDesignIntf* m_movedItem;
|
||||
BaseDesignIntf* m_movedItemContainer;
|
||||
BaseDesignIntf* m_joinItem;
|
||||
JoinType m_joinType;
|
||||
bool m_magneticMovement;
|
||||
ReportSettings* m_reportSettings;
|
||||
};
|
||||
|
||||
class AbstractPageCommand : public CommandIf{
|
||||
|
||||
Reference in New Issue
Block a user