QElectroTech  0.8-dev
fileelementcollectionitem.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 FILEELEMENTCOLLECTIONITEM2_H
19 #define FILEELEMENTCOLLECTIONITEM2_H
20 
21 #include "elementcollectionitem.h"
22 #include "elementslocation.h"
23 
30 {
31  public:
33 
34  enum { Type = UserType+2 };
35  int type() const override { return Type;}
36 
37  bool setRootPath(const QString& path,
38  bool set_data = true,
39  bool hide_element = false);
40  QString fileSystemPath() const;
41  QString dirPath() const;
42 
43  bool isDir() const override;
44  bool isElement() const override;
45  QString localName() override;
46  QString localName(const ElementsLocation &location);
47  QString name() const override;
48  QString collectionPath() const override;
49  bool isCollectionRoot() const override;
50  bool isCommonCollection() const;
51  bool isCustomCollection() const;
52  void addChildAtPath(const QString &collection_name) override;
53 
54  void setUpData() override;
55  void setUpIcon() override;
56 
57  private:
58  void setPathName(const QString& path_name,
59  bool set_data = true,
60  bool hide_element = false);
61  void populate(bool set_data = true, bool hide_element = false);
62 
63  private:
64  QString m_path;
65 };
66 
67 #endif // FILEELEMENTCOLLECTIONITEM2_H
FileElementCollectionItem::setRootPath
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...
Definition: fileelementcollectionitem.cpp:42
FileElementCollectionItem::populate
void populate(bool set_data=true, bool hide_element=false)
FileElementCollectionItem::populate Create the childs of this item.
Definition: fileelementcollectionitem.cpp:350
DiagramContext::keys
QList< QString > keys(KeyOrder=None) const
Definition: diagramcontext.cpp:49
FileElementCollectionItem::setUpIcon
void setUpIcon() override
FileElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memory,...
Definition: fileelementcollectionitem.cpp:301
QET::Icons::nl
QIcon nl
Definition: qeticons.cpp:203
FileElementCollectionItem::FileElementCollectionItem
FileElementCollectionItem()
FileElementCollectionItem::FileElementCollectionItem Constructor.
Definition: fileelementcollectionitem.cpp:30
ElementCollectionItem::collectionPath
virtual QString collectionPath() const =0
elementcollectionitem.h
FileElementCollectionItem::isDir
bool isDir() const override
FileElementCollectionItem::isDir.
Definition: fileelementcollectionitem.cpp:93
ElementCollectionItem::isCollectionRoot
virtual bool isCollectionRoot() const =0
FileElementCollectionItem::Type
@ Type
Definition: fileelementcollectionitem.h:34
ElementCollectionItem
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
Definition: elementcollectionitem.h:30
FileElementCollectionItem::name
QString name() const override
FileElementCollectionItem::name.
Definition: fileelementcollectionitem.cpp:179
qetapp.h
FileElementCollectionItem::type
int type() const override
Definition: fileelementcollectionitem.h:35
FileElementCollectionItem::setPathName
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....
Definition: fileelementcollectionitem.cpp:333
ElementsLocation::icon
QIcon icon() const
ElementLocation::icon.
Definition: elementslocation.cpp:756
FileElementCollectionItem::fileSystemPath
QString fileSystemPath() const
FileElementCollectionItem::fileSystemPath.
Definition: fileelementcollectionitem.cpp:61
qeticons.h
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
elementslocation.h
FileElementCollectionItem
The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collecti...
Definition: fileelementcollectionitem.h:30
QET::Icons::Folder
QIcon Folder
Definition: qeticons.cpp:94
QETApp::customElementsDirN
static QString customElementsDirN()
QETApp::customElementsDirN like QString QETApp::customElementsDir but without "/" at the end.
Definition: qetapp.cpp:705
DiagramContext::value
QVariant value(const QString &key) const
Definition: diagramcontext.cpp:100
FileElementCollectionItem::dirPath
QString dirPath() const
FileElementCollectionItem::dirPath.
Definition: fileelementcollectionitem.cpp:79
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
FileElementCollectionItem::isCollectionRoot
bool isCollectionRoot() const override
FileElementCollectionItem::isCollectionRoot.
Definition: fileelementcollectionitem.cpp:216
QETApp::commonElementsDirN
static QString commonElementsDirN()
QETApp::commonElementsDirN like QString QETApp::commonElementsDir but without "/" at the end.
Definition: qetapp.cpp:693
FileElementCollectionItem::setUpData
void setUpData() override
FileElementCollectionItem::setUpData SetUp the data of this item.
Definition: fileelementcollectionitem.cpp:264
NamesList
Definition: nameslist.h:30
FileElementCollectionItem::collectionPath
QString collectionPath() const override
FileElementCollectionItem::collectionPath.
Definition: fileelementcollectionitem.cpp:191
ElementsLocation::name
QString name() const
ElementLocation::name.
Definition: elementslocation.cpp:776
FileElementCollectionItem::isCustomCollection
bool isCustomCollection() const
FileElementCollectionItem::isCustomCollection.
Definition: fileelementcollectionitem.cpp:238
ElementsLocation::elementInformations
DiagramContext elementInformations() const
ElementsLocation::elementInformations.
Definition: elementslocation.cpp:811
FileElementCollectionItem::isElement
bool isElement() const override
FileElementCollectionItem::isElement.
Definition: fileelementcollectionitem.cpp:106
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
FileElementCollectionItem::addChildAtPath
void addChildAtPath(const QString &collection_name) override
FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name c...
Definition: fileelementcollectionitem.cpp:249
fileelementcollectionitem.h
FileElementCollectionItem::isCommonCollection
bool isCommonCollection() const
FileElementCollectionItem::isCommonCollection.
Definition: fileelementcollectionitem.cpp:229
FileElementCollectionItem::localName
QString localName() override
FileElementCollectionItem::localName.
Definition: fileelementcollectionitem.cpp:115
DiagramContext
Definition: diagramcontext.h:56
FileElementCollectionItem::m_path
QString m_path
Definition: fileelementcollectionitem.h:64