QElectroTech  0.70
xmlprojectelementcollectionitem.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 
31 {
32  public:
34 
35  enum {Type = UserType+3};
36  int type() const override { return Type; }
37 
38  bool isDir() const override;
39  bool isElement() const override;
40  QString localName() override;
41  QString name() const override;
42  QString collectionPath() const override;
43  virtual QString embeddedPath() const;
44  bool isCollectionRoot() const override;
45  void addChildAtPath(const QString &collection_name) override;
46  QETProject * project() const;
47 
48  void setProject (QETProject *project, bool set_data = true, bool hide_element = false);
49  void setUpData() override;
50  void setUpIcon() override;
51 
52  private:
53  void populate(bool set_data = true, bool hide_element = false);
54  void setXmlElement(const QDomElement& element, QETProject *project, bool set_data = true, bool hide_element = false);
55 
56  private:
57  QETProject *m_project = nullptr;
58  QDomElement m_dom_element;
59 };
60 
61 #endif // XMLPROJECTELEMENTCOLLECTIONITEM2_H
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
XmlProjectElementCollectionItem()
XmlProjectElementCollectionItem::XmlProjectElementCollectionItem Constructor.
bool isDir() const override
XmlProjectElementCollectionItem::isDir.
QString collectionPath() const override
XmlProjectElementCollectionItem::collectionPath.
void setUpData() override
XmlProjectElementCollectionItem::setUpData SetUp the data of this item.
void setUpIcon() override
XmlProjectElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memo...
The XmlProjectElementCollectionItem class This class specialise ElementCollectionItem for manage an x...
QString name() const override
XmlProjectElementCollectionItem::name.
QETProject * project() const
XmlProjectElementCollectionItem::project.
void setXmlElement(const QDomElement &element, QETProject *project, bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::setXmlElement Set the managed content of this item.
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...
void addChildAtPath(const QString &collection_name) override
XmlProjectElementCollectionItem::addChildAtPath Ask to this item item to add a new child with collect...
QString localName() override
XmlProjectElementCollectionItem::localName.
bool isCollectionRoot() const override
XmlProjectElementCollectionItem::isCollectionRoot.
virtual QString embeddedPath() const
XmlProjectElementCollectionItem::embeddedPath.
bool isElement() const override
XmlProjectElementCollectionItem::isElement.
void populate(bool set_data=true, bool hide_element=false)
XmlProjectElementCollectionItem::populate Create the childs of this item.