2016-02-17 10:11:00 +03:00
|
|
|
/***************************************************************************
|
|
|
|
* This file is part of the Lime Report project *
|
2021-08-18 20:21:36 +03:00
|
|
|
* Copyright (C) 2021 by Alexander Arin *
|
2016-02-17 10:11:00 +03:00
|
|
|
* 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 LROBJECTBROWSER_H
|
|
|
|
#define LROBJECTBROWSER_H
|
|
|
|
|
|
|
|
#include "lrbasedesignintf.h"
|
2024-09-04 17:31:16 +03:00
|
|
|
#include "lrreportdesignwidget.h"
|
|
|
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QWidget>
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
namespace LimeReport {
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class ObjectBrowserNode: public QTreeWidgetItem {
|
2016-02-17 10:11:00 +03:00
|
|
|
public:
|
|
|
|
void setObject(QObject* value);
|
|
|
|
QObject* object() const;
|
2024-09-04 17:31:16 +03:00
|
|
|
explicit ObjectBrowserNode(QTreeWidget* view);
|
|
|
|
explicit ObjectBrowserNode(QTreeWidgetItem* parent = 0);
|
|
|
|
bool operator<(const QTreeWidgetItem& other) const;
|
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
private:
|
|
|
|
QObject* m_object;
|
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class ObjectBrowser: public QWidget {
|
2016-02-17 10:11:00 +03:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
ObjectBrowser(QWidget* parent = 0);
|
2018-05-31 18:49:57 +03:00
|
|
|
void setReportEditor(LimeReport::ReportDesignWidget* designerWidget);
|
2016-02-17 10:11:00 +03:00
|
|
|
void setMainWindow(QMainWindow* mainWindow);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
protected:
|
2024-09-04 17:31:16 +03:00
|
|
|
void fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* reportItem,
|
|
|
|
BaseDesignIntf* ignoredItem = 0);
|
|
|
|
void buildTree(BaseDesignIntf* ignoredItem = 0);
|
2016-02-17 10:11:00 +03:00
|
|
|
void removeItem(BaseDesignIntf* item);
|
2024-09-04 17:31:16 +03:00
|
|
|
void findAndRemove(QTreeWidgetItem* node, BaseDesignIntf* item);
|
2018-04-24 15:51:06 +03:00
|
|
|
void moveItemNode(BaseDesignIntf* item, BaseDesignIntf* parent);
|
2016-02-17 10:11:00 +03:00
|
|
|
private slots:
|
2024-09-04 17:31:16 +03:00
|
|
|
// void slotObjectNameChanged(const QString& objectName);
|
2016-02-17 10:11:00 +03:00
|
|
|
void slotPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
|
|
|
void slotClear();
|
|
|
|
void slotReportLoaded();
|
|
|
|
void slotActivePageChanged();
|
|
|
|
void slotBandAdded(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*);
|
2024-09-04 17:31:16 +03:00
|
|
|
void slotBandDeleted(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf* item);
|
|
|
|
void slotItemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf*);
|
|
|
|
void slotItemDeleted(LimeReport::PageDesignIntf*, LimeReport::BaseDesignIntf* item);
|
2016-02-17 10:11:00 +03:00
|
|
|
void slotObjectTreeItemSelectionChanged();
|
|
|
|
void slotItemSelected(LimeReport::BaseDesignIntf* item);
|
|
|
|
void slotMultiItemSelected();
|
2024-09-04 17:31:16 +03:00
|
|
|
void slotItemDoubleClicked(QTreeWidgetItem* item, int);
|
2016-04-21 00:06:08 +03:00
|
|
|
void slotActivePageUpdated(LimeReport::PageDesignIntf*);
|
2017-10-12 22:00:17 +03:00
|
|
|
void slotItemParentChanged(BaseDesignIntf* item, BaseDesignIntf* parent);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
private:
|
2018-05-31 18:49:57 +03:00
|
|
|
ReportDesignWidget* m_designerWidget;
|
2024-09-04 17:31:16 +03:00
|
|
|
QMainWindow* m_mainWindow;
|
|
|
|
QTreeWidget* m_treeView;
|
2016-02-17 10:11:00 +03:00
|
|
|
QMap<QObject*, ObjectBrowserNode*> m_itemsMap;
|
|
|
|
bool m_changingItemSelection;
|
2018-04-24 15:51:06 +03:00
|
|
|
bool m_movingItem;
|
|
|
|
QList<QObject*> m_defferedItems;
|
2016-02-17 10:11:00 +03:00
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
} // namespace LimeReport
|
2016-02-17 10:11:00 +03:00
|
|
|
#endif // LROBJECTBROWSER_H
|