QElectroTech  0.8-dev
elementprovider.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ELEMENTPROVIDER_H
19 #define ELEMENTPROVIDER_H
20 
21 #include <QUuid>
22 #include <QList>
23 #include <QAbstractTableModel>
24 
25 class QETProject;
26 class Diagram;
27 class Element;
29 
37 {
38  public:
39  ElementProvider(QETProject *prj, Diagram *diagram=nullptr);
40  ElementProvider(Diagram *diag);
41  QList <Element *> freeElement(const int filter) const;
42  QList <Element *> fromUuids(QList <QUuid>) const;
43  QList <Element *> find(const int filter) const;
44  QVector <QetGraphicsTableItem *> table(QetGraphicsTableItem *table = nullptr, QAbstractItemModel *model = nullptr);
45  QetGraphicsTableItem *tableFromUuid(const QUuid &uuid);
46 
47  private:
48  QList <Diagram *> m_diagram_list;
49 };
50 
51 #endif // ELEMENTPROVIDER_H
Diagram::elements
QList< Element * > elements() const
Diagram::elements.
Definition: diagram.cpp:2031
Element::linkType
virtual kind linkType() const
Definition: element.h:159
ElementProvider
Definition: elementprovider.h:37
QetGraphicsTableItem
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition: qetgraphicstableitem.h:43
Element::uuid
QUuid uuid() const
Element::uuid.
Definition: element.h:250
ElementProvider::find
QList< Element * > find(const int filter) const
ElementProvider::find Search and return the asked element corresponding with the given filter.
Definition: elementprovider.cpp:96
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
QETProject::diagrams
QList< Diagram * > diagrams() const
Definition: qetproject.cpp:217
elementprovider.h
QetGraphicsTableItem::Type
@ Type
Definition: qetgraphicstableitem.h:57
ElementProvider::m_diagram_list
QList< Diagram * > m_diagram_list
Definition: elementprovider.h:48
element.h
ElementProvider::freeElement
QList< Element * > freeElement(const int filter) const
ElementProvider::FreeElement Search and return the asked element corresponding with the given filter ...
Definition: elementprovider.cpp:54
Element
Definition: element.h:41
Element::isFree
bool isFree() const
Definition: element.h:230
qetproject.h
ElementProvider::ElementProvider
ElementProvider(QETProject *prj, Diagram *diagram=nullptr)
ElementProvider::ElementProvider Constructor.
Definition: elementprovider.cpp:30
QETProject
Definition: qetproject.h:51
qetgraphicstableitem.h
ElementProvider::table
QVector< QetGraphicsTableItem * > table(QetGraphicsTableItem *table=nullptr, QAbstractItemModel *model=nullptr)
ElementProvider::table.
Definition: elementprovider.cpp:120
ElementProvider::fromUuids
QList< Element * > fromUuids(QList< QUuid >) const
ElementProvider::fromUuids.
Definition: elementprovider.cpp:75
ElementProvider::tableFromUuid
QetGraphicsTableItem * tableFromUuid(const QUuid &uuid)
ElementProvider::tableFromUuid.
Definition: elementprovider.cpp:172
diagram.h