QElectroTech  0.8-dev
elementcollectionitem.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 ELEMENTCOLLECTIONITEM2_H
19 #define ELEMENTCOLLECTIONITEM2_H
20 
21 #include <QStandardItem>
22 
29 class ElementCollectionItem : public QStandardItem
30 {
31  public:
33 
34  enum {Type = UserType+1};
35  int type() const override { return Type; }
36 
37  virtual bool isDir() const = 0;
38  virtual bool isElement() const = 0;
39  virtual QString localName() = 0;
40  virtual QString name() const = 0;
41  virtual QString collectionPath() const = 0;
42  virtual bool isCollectionRoot() const = 0;
43  virtual void addChildAtPath(const QString &collection_name) = 0;
44  virtual void setUpData() = 0;
45  virtual void setUpIcon() = 0;
46  virtual void clearData();
47 
48  ElementCollectionItem *lastItemForPath(const QString &path, QString &no_found_path);
49  ElementCollectionItem *childWithCollectionName(const QString& name) const;
50  QList<QStandardItem *> directChilds() const;
51  int rowForInsertItem(const QString &name);
52  ElementCollectionItem *itemAtPath(const QString &path);
53 
54  QList<ElementCollectionItem *> elementsDirectChild() const;
55  QList<ElementCollectionItem *> directoriesDirectChild() const;
56  QList<ElementCollectionItem *> elementsChild() const;
57  QList<ElementCollectionItem *> directoriesChild() const;
58  QList<ElementCollectionItem *> items() const;
59 };
60 
62 
63 #endif // ELEMENTCOLLECTIONITEM2_H
ElementCollectionItem::items
QList< ElementCollectionItem * > items() const
ElementCollectionItem::items.
Definition: elementcollectionitem.cpp:237
setUpData
void setUpData(ElementCollectionItem *eci)
Definition: elementcollectionitem.cpp:250
ElementCollectionItem::directoriesChild
QList< ElementCollectionItem * > directoriesChild() const
ElementCollectionItem::directoriesChild.
Definition: elementcollectionitem.cpp:221
ElementCollectionItem::elementsChild
QList< ElementCollectionItem * > elementsChild() const
ElementCollectionItem::elementsChild.
Definition: elementcollectionitem.cpp:207
ElementCollectionItem::lastItemForPath
ElementCollectionItem * lastItemForPath(const QString &path, QString &no_found_path)
ElementCollectionItem::lastItemForPath Return the last existing item in this ElementCollectionItem hi...
Definition: elementcollectionitem.cpp:52
ElementCollectionItem::ElementCollectionItem
ElementCollectionItem()
ElementCollectionItem::ElementCollectionItem Constructor.
Definition: elementcollectionitem.cpp:25
ElementCollectionItem::collectionPath
virtual QString collectionPath() const =0
ElementCollectionItem::directChilds
QList< QStandardItem * > directChilds() const
ElementCollectionItem::directChilds Return the direct child of this item.
Definition: elementcollectionitem.cpp:99
elementcollectionitem.h
ElementCollectionItem::clearData
virtual void clearData()
ElementCollectionItem::clearData Reset the data.
Definition: elementcollectionitem.cpp:32
ElementCollectionItem::isCollectionRoot
virtual bool isCollectionRoot() const =0
ElementCollectionItem
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
Definition: elementcollectionitem.h:30
ElementCollectionItem::addChildAtPath
virtual void addChildAtPath(const QString &collection_name)=0
ElementCollectionItem::directoriesDirectChild
QList< ElementCollectionItem * > directoriesDirectChild() const
ElementCollectionItem::directoriesDirectChild.
Definition: elementcollectionitem.cpp:190
ElementCollectionItem::setUpData
virtual void setUpData()=0
ElementCollectionItem::isDir
virtual bool isDir() const =0
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
ElementCollectionItem::localName
virtual QString localName()=0
ElementCollectionItem::Type
@ Type
Definition: elementcollectionitem.h:34
ElementCollectionItem::itemAtPath
ElementCollectionItem * itemAtPath(const QString &path)
ElementCollectionItem::itemAtPath.
Definition: elementcollectionitem.cpp:151
ElementCollectionItem::childWithCollectionName
ElementCollectionItem * childWithCollectionName(const QString &name) const
ElementCollectionItem::childWithCollectionName Return the child with the collection name name,...
Definition: elementcollectionitem.cpp:81
ElementCollectionItem::type
int type() const override
Definition: elementcollectionitem.h:35
setUpData
void setUpData(ElementCollectionItem *eci)
Definition: elementcollectionitem.cpp:250
ElementCollectionItem::elementsDirectChild
QList< ElementCollectionItem * > elementsDirectChild() const
ElementCollectionItem::elementsDirectChild.
Definition: elementcollectionitem.cpp:173
ElementCollectionItem::isElement
virtual bool isElement() const =0
ElementCollectionItem::name
virtual QString name() const =0
ElementCollectionItem::setUpIcon
virtual void setUpIcon()=0