QElectroTech  0.8-dev
xmlprojectelementcollectionitem.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 XMLPROJECTELEMENTCOLLECTIONITEM2_H
19 #define XMLPROJECTELEMENTCOLLECTIONITEM2_H
20 
21 #include "elementcollectionitem.h"
22 #include <QDomElement>
23 
24 class QETProject;
25 
32 {
33  public:
35 
36  enum {Type = UserType+3};
37  int type() const override { return Type; }
38 
39  bool isDir() const override;
40  bool isElement() const override;
41  QString localName() override;
42  QString name() const override;
43  QString collectionPath() const override;
44  virtual QString embeddedPath() const;
45  bool isCollectionRoot() const override;
46  void addChildAtPath(const QString &collection_name) override;
47  QETProject * project() const;
48 
50  bool set_data = true,
51  bool hide_element = false);
52  void setUpData() override;
53  void setUpIcon() override;
54 
55  private:
56  void populate(bool set_data = true, bool hide_element = false);
57  void setXmlElement(const QDomElement& element,
59  bool set_data = true,
60  bool hide_element = false);
61 
62  private:
63  QETProject *m_project = nullptr;
64  QDomElement m_dom_element;
65 };
66 
67 #endif // XMLPROJECTELEMENTCOLLECTIONITEM2_H
XmlProjectElementCollectionItem::localName
QString localName() override
XmlProjectElementCollectionItem::localName.
Definition: xmlprojectelementcollectionitem.cpp:54
DiagramContext::keys
QList< QString > keys(KeyOrder=None) const
Definition: diagramcontext.cpp:49
QETProject::embeddedElementCollection
XmlElementCollection * embeddedElementCollection() const
QETProject::embeddedCollection.
Definition: qetproject.cpp:236
QETProject::title
QString title() const
Definition: qetproject.cpp:366
XmlProjectElementCollectionItem::isElement
bool isElement() const override
XmlProjectElementCollectionItem::isElement.
Definition: xmlprojectelementcollectionitem.cpp:44
XmlProjectElementCollectionItem::XmlProjectElementCollectionItem
XmlProjectElementCollectionItem()
XmlProjectElementCollectionItem::XmlProjectElementCollectionItem Constructor.
Definition: xmlprojectelementcollectionitem.cpp:27
XmlProjectElementCollectionItem::populate
void populate(bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::populate Create the childs of this item.
Definition: xmlprojectelementcollectionitem.cpp:244
XmlProjectElementCollectionItem::isDir
bool isDir() const override
XmlProjectElementCollectionItem::isDir.
Definition: xmlprojectelementcollectionitem.cpp:34
elementcollectionitem.h
XmlProjectElementCollectionItem::name
QString name() const override
XmlProjectElementCollectionItem::name.
Definition: xmlprojectelementcollectionitem.cpp:77
XmlProjectElementCollectionItem::collectionPath
QString collectionPath() const override
XmlProjectElementCollectionItem::collectionPath.
Definition: xmlprojectelementcollectionitem.cpp:86
xmlelementcollection.h
XmlProjectElementCollectionItem::project
QETProject * project() const
XmlProjectElementCollectionItem::project.
Definition: xmlprojectelementcollectionitem.cpp:162
ElementCollectionItem
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
Definition: elementcollectionitem.h:30
XmlProjectElementCollectionItem::m_dom_element
QDomElement m_dom_element
Definition: xmlprojectelementcollectionitem.h:64
XmlProjectElementCollectionItem::setXmlElement
void setXmlElement(const QDomElement &element, QETProject *project, bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::setXmlElement Set the managed content of this item.
Definition: xmlprojectelementcollectionitem.cpp:283
ElementsLocation::icon
QIcon icon() const
ElementLocation::icon.
Definition: elementslocation.cpp:756
qeticons.h
XmlProjectElementCollectionItem::embeddedPath
virtual QString embeddedPath() const
XmlProjectElementCollectionItem::embeddedPath.
Definition: xmlprojectelementcollectionitem.cpp:100
XmlProjectElementCollectionItem::setUpData
void setUpData() override
XmlProjectElementCollectionItem::setUpData SetUp the data of this item.
Definition: xmlprojectelementcollectionitem.cpp:191
ElementCollectionItem::rowForInsertItem
int rowForInsertItem(const QString &name)
ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with ...
Definition: elementcollectionitem.cpp:116
XmlProjectElementCollectionItem::addChildAtPath
void addChildAtPath(const QString &collection_name) override
XmlProjectElementCollectionItem::addChildAtPath Ask to this item item to add a new child with collect...
Definition: xmlprojectelementcollectionitem.cpp:136
ElementsLocation::projectCollectionPath
QString projectCollectionPath() const
ElementsLocation::projectCollectionPath.
Definition: elementslocation.cpp:176
XmlElementCollection::root
QDomElement root() const
XmlElementCollection::root The root is the first DOM-Element the xml collection, the tag name of the ...
Definition: xmlelementcollection.cpp:110
QET::Icons::ProjectFileGP
QIcon ProjectFileGP
Definition: qeticons.cpp:148
QET::Icons::Folder
QIcon Folder
Definition: qeticons.cpp:94
XmlProjectElementCollectionItem::Type
@ Type
Definition: xmlprojectelementcollectionitem.h:36
DiagramContext::value
QVariant value(const QString &key) const
Definition: diagramcontext.cpp:100
qetproject.h
xmlprojectelementcollectionitem.h
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
QETProject
Definition: qetproject.h:51
XmlProjectElementCollectionItem::setProject
void setProject(QETProject *project, bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::setProject Set the project for this item. Use this method for set th...
Definition: xmlprojectelementcollectionitem.cpp:175
XmlElementCollection::directories
QList< QDomElement > directories(const QDomElement &parent_element) const
XmlElementCollection::directories.
Definition: xmlelementcollection.cpp:203
XmlProjectElementCollectionItem::isCollectionRoot
bool isCollectionRoot() const override
XmlProjectElementCollectionItem::isCollectionRoot.
Definition: xmlprojectelementcollectionitem.cpp:120
ElementsLocation::name
QString name() const
ElementLocation::name.
Definition: elementslocation.cpp:776
XmlProjectElementCollectionItem
The XmlProjectElementCollectionItem class This class specialise ElementCollectionItem for manage an x...
Definition: xmlprojectelementcollectionitem.h:32
XmlElementCollection::elements
QList< QDomElement > elements(const QDomElement &parent_element) const
XmlElementCollection::elements.
Definition: xmlelementcollection.cpp:247
ElementsLocation::elementInformations
DiagramContext elementInformations() const
ElementsLocation::elementInformations.
Definition: elementslocation.cpp:811
XmlProjectElementCollectionItem::m_project
QETProject * m_project
Definition: xmlprojectelementcollectionitem.h:63
XmlProjectElementCollectionItem::type
int type() const override
Definition: xmlprojectelementcollectionitem.h:37
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
DiagramContext
Definition: diagramcontext.h:56
XmlProjectElementCollectionItem::setUpIcon
void setUpIcon() override
XmlProjectElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memo...
Definition: xmlprojectelementcollectionitem.cpp:223