QElectroTech  0.70
fileelementcollectionitem.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 FILEELEMENTCOLLECTIONITEM2_H
19 #define FILEELEMENTCOLLECTIONITEM2_H
20 
21 #include "elementcollectionitem.h"
22 
29 {
30  public:
32 
33  enum { Type = UserType+2 };
34  int type() const override { return Type;}
35 
36  bool setRootPath(const QString& path, bool set_data = true, bool hide_element = false);
37  QString fileSystemPath() const;
38  QString dirPath() const;
39 
40  bool isDir() const override;
41  bool isElement() const override;
42  QString localName() override;
43  QString name() const override;
44  QString collectionPath() const override;
45  bool isCollectionRoot() const override;
46  bool isCommonCollection() const;
47  bool isCustomCollection() const;
48  void addChildAtPath(const QString &collection_name) override;
49 
50  void setUpData() override;
51  void setUpIcon() override;
52 
53  void hire();
54 
55 
56  private:
57  void setPathName(const QString& path_name, bool set_data = true, bool hide_element = false);
58  void populate(bool set_data = true, bool hide_element = false);
59 
60  private:
61  QString m_path;
62 };
63 
64 #endif // FILEELEMENTCOLLECTIONITEM2_H
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
bool isCustomCollection() const
FileElementCollectionItem::isCustomCollection.
QString collectionPath() const override
FileElementCollectionItem::collectionPath.
void addChildAtPath(const QString &collection_name) override
FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name ...
void populate(bool set_data=true, bool hide_element=false)
FileElementCollectionItem::populate Create the childs of this item.
void setPathName(const QString &path_name, bool set_data=true, bool hide_element=false)
FileElementCollectionItem::setPathName Set the name of this item in the file system path...
void setUpIcon() override
FileElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memory...
FileElementCollectionItem()
FileElementCollectionItem::FileElementCollectionItem Constructor.
bool isCommonCollection() const
FileElementCollectionItem::isCommonCollection.
void setUpData() override
FileElementCollectionItem::setUpData SetUp the data of this item.
QString name() const override
FileElementCollectionItem::name.
The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collecti...
bool setRootPath(const QString &path, bool set_data=true, bool hide_element=false)
FileElementCollectionItem::setRootPath Set path has root path for this file item. Use this function o...
QString localName() override
FileElementCollectionItem::localName.
QString dirPath() const
FileElementCollectionItem::dirPath.
QString fileSystemPath() const
FileElementCollectionItem::fileSystemPath.
bool isCollectionRoot() const override
FileElementCollectionItem::isCollectionRoot.
bool isElement() const override
FileElementCollectionItem::isElement.
bool isDir() const override
FileElementCollectionItem::isDir.