QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementslocation.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 ELEMENTS_LOCATION_H
19#define ELEMENTS_LOCATION_H
20
21#include "../NameList/nameslist.h"
22#include "../diagramcontext.h"
23#include "pugixml/src/pugixml.hpp"
24
25#include <QIcon>
26#include <QString>
27
28#ifndef Q_OS_LINUX
29#include "sstream"
30#endif
31
32class QETProject;
34
47{
48 public:
50 ElementsLocation(const QString &path,
51 QETProject *project = nullptr);
53 ElementsLocation(const QMimeData *data);
54 virtual ~ElementsLocation();
56 bool operator==(const ElementsLocation &) const;
57 bool operator!=(const ElementsLocation &) const;
58
59 public:
60 QString baseName() const;
61
62 QString collectionPath(bool protocol = true) const;
63 QString projectCollectionPath() const;
64 QString fileSystemPath() const;
65 QString path() const;
66 void setPath(const QString &path);
67 bool addToPath(const QString &);
68
70 QETProject *project() const;
71 void setProject(QETProject *);
72 bool isNull() const;
73 QString toString() const;
74
75 bool isElement() const;
76 bool isDirectory() const;
77 bool isFileSystem() const;
78 bool isCommonCollection() const;
79 bool isCompanyCollection() const;
80 bool isCustomCollection() const;
81 bool isProject() const;
82 bool exist() const;
83 bool isWritable() const;
84
87
88 QDomElement xml() const;
89 pugi::xml_document pugiXml() const;
90 bool setXml(const QDomDocument &xml_document) const;
91 QUuid uuid() const;
92 QIcon icon() const;
93 QString name() const;
94 QString fileName() const;
96
97 private:
101#ifndef Q_OS_LINUX
102 mutable std::stringstream m_string_stream;
103#endif
104
105 public:
106 static int MetaTypeId;
107};
108
109QDebug operator<<(QDebug debug, const ElementsLocation &location);
110
112//uint qHash(const ElementsLocation &);
113#endif
Definition diagramcontext.h:57
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition elementslocation.h:47
QDomElement xml() const
ElementsLocation::xml.
Definition elementslocation.cpp:653
bool isNull() const
ElementsLocation::isNull.
Definition elementslocation.cpp:451
bool isCompanyCollection() const
ElementsLocation::isCompanyCollection.
Definition elementslocation.cpp:518
bool setXml(const QDomDocument &xml_document) const
ElementsLocation::setXml Replace the current xml description by xml_document; The document element of...
Definition elementslocation.cpp:741
bool operator==(const ElementsLocation &) const
ElementsLocation::operator ==.
Definition elementslocation.cpp:115
ElementsLocation parent() const
ElementsLocation::parent.
Definition elementslocation.cpp:398
QString m_file_system_path
Definition elementslocation.h:99
bool isElement() const
ElementsLocation::isElement.
Definition elementslocation.cpp:478
bool isCustomCollection() const
ElementsLocation::isCustomCollection.
Definition elementslocation.cpp:528
QUuid uuid() const
ElementsLocation::uuid.
Definition elementslocation.cpp:836
bool isWritable() const
ElementsLocation::isWritable.
Definition elementslocation.cpp:577
QString fileSystemPath() const
ElementsLocation::fileSystemPath.
Definition elementslocation.cpp:210
bool addToPath(const QString &)
ElementsLocation::addToPath Add a string to the actual path of this location.
Definition elementslocation.cpp:372
QIcon icon() const
ElementLocation::icon.
Definition elementslocation.cpp:855
bool isDirectory() const
ElementsLocation::isDirectory.
Definition elementslocation.cpp:487
QString baseName() const
ElementsLocation::baseName.
Definition elementslocation.cpp:146
pugi::xml_document pugiXml() const
ElementsLocation::pugiXml.
Definition elementslocation.cpp:688
QString m_collection_path
Definition elementslocation.h:98
virtual ~ElementsLocation()
ElementsLocation::~ElementsLocation Destructeur.
Definition elementslocation.cpp:57
void setProject(QETProject *)
ElementsLocation::setProject.
Definition elementslocation.cpp:441
QETProject * m_project
Definition elementslocation.h:100
void setPath(const QString &path)
ElementsLocation::setPath Set the path of this item. The path can be relative to a collection (start ...
Definition elementslocation.cpp:235
QString name() const
ElementLocation::name.
Definition elementslocation.cpp:875
QString projectCollectionPath() const
ElementsLocation::projectCollectionPath.
Definition elementslocation.cpp:193
bool isFileSystem() const
ElementsLocation::isFileSystem.
Definition elementslocation.cpp:496
ElementsLocation()
ElementsLocation::ElementsLocation Constructor.
Definition elementslocation.cpp:37
std::stringstream m_string_stream
Definition elementslocation.h:102
bool operator!=(const ElementsLocation &) const
ElementsLocation::operator != Operateur de comparaison.
Definition elementslocation.cpp:130
DiagramContext elementInformations() const
ElementsLocation::elementInformations.
Definition elementslocation.cpp:910
QString toString() const
ElementsLocation::toString.
Definition elementslocation.cpp:461
XmlElementCollection * projectCollection() const
ElementsLocation::projectCollection.
Definition elementslocation.cpp:597
QString fileName() const
ElementLocation::fileName.
Definition elementslocation.cpp:892
QString path() const
ElementsLocation::path.
Definition elementslocation.cpp:223
QETProject * project() const
ElementsLocation::project.
Definition elementslocation.cpp:428
bool exist() const
ElementsLocation::exist.
Definition elementslocation.cpp:550
bool isProject() const
ElementsLocation::isProject.
Definition elementslocation.cpp:537
ElementsLocation & operator=(const ElementsLocation &)
ElementsLocation::operator = Assignment operator.
Definition elementslocation.cpp:98
NamesList nameList()
ElementsLocation::nameList.
Definition elementslocation.cpp:610
static int MetaTypeId
Id of the corresponding Qt meta type.
Definition elementslocation.h:106
QString collectionPath(bool protocol=true) const
ElementsLocation::collectionPath Return the path of the represented element relative to collection if...
Definition elementslocation.cpp:177
bool isCommonCollection() const
ElementsLocation::isCommonCollection.
Definition elementslocation.cpp:508
Definition nameslist.h:31
Definition qetproject.h:62
The XmlElementCollection class This class represent a collection of elements stored to xml.
Definition xmlelementcollection.h:34
QDebug operator<<(QDebug debug, const ElementsLocation &location)
operator << debug for processing ElementsLocation
Definition elementslocation.cpp:929
Q_DECLARE_METATYPE(NamesList)