QElectroTech
0.70
|
#include <elementslocation.h>
Public Member Functions | |
ElementsLocation () | |
ElementsLocation::ElementsLocation Constructor. More... | |
ElementsLocation (const QString &path, QETProject *project=nullptr) | |
ElementsLocation (const ElementsLocation &) | |
ElementsLocation (const QMimeData *data) | |
ElementsLocation::ElementLocation Constructor, build an ElementLocation from a QMimeData, the mime data format must be "application/x-qet-element-uri" or "application/x-qet-category-uri". This location can be null even if format is valid. More... | |
virtual | ~ElementsLocation () |
ElementsLocation & | operator= (const ElementsLocation &) |
bool | operator== (const ElementsLocation &) const |
bool | operator!= (const ElementsLocation &) const |
QString | baseName () const |
ElementsLocation::baseName. More... | |
int | projectId () const |
ElementsLocation::projectId This method is used to know if an element belongs to a project or not. More... | |
QString | collectionPath (bool protocol=true) const |
QString | projectCollectionPath () const |
ElementsLocation::projectCollectionPath. More... | |
QString | fileSystemPath () const |
ElementsLocation::fileSystemPath. More... | |
QString | path () const |
ElementsLocation::path. More... | |
void | setPath (const QString &path) |
ElementsLocation::setPath Set the path of this item. The path can be relative to a collection (start by common:// , custom:// or embed://) or not. More... | |
bool | addToPath (const QString &) |
ElementsLocation::addToPath Add a string to the actual path of this location. More... | |
ElementsLocation | parent () const |
QETProject * | project () const |
void | setProject (QETProject *) |
bool | isNull () const |
QString | toString () const |
bool | isElement () const |
ElementsLocation::isElement. More... | |
bool | isDirectory () const |
ElementsLocation::isDirectory. More... | |
bool | isFileSystem () const |
ElementsLocation::isFileSystem. More... | |
bool | isCommonCollection () const |
ElementsLocation::isCommonCollection. More... | |
bool | isCustomCollection () const |
ElementsLocation::isCustomCollection. More... | |
bool | isProject () const |
ElementsLocation::isProject. More... | |
bool | exist () const |
ElementsLocation::exist. More... | |
bool | isWritable () const |
ElementsLocation::isWritable. More... | |
XmlElementCollection * | projectCollection () const |
ElementsLocation::projectCollection. More... | |
NamesList | nameList () |
ElementsLocation::nameList. More... | |
QDomElement | xml () const |
ElementsLocation::xml. More... | |
bool | setXml (const QDomDocument &xml_document) const |
ElementsLocation::setXml Replace the current xml description by ; The document element of must have tagname "definition" to be written This definition must be writable. More... | |
QUuid | uuid () const |
ElementsLocation::uuid. More... | |
QIcon | icon () const |
ElementLocation::icon. More... | |
QString | name () const |
ElementLocation::name. More... | |
QString | fileName () const |
ElementLocation::fileName. More... | |
DiagramContext | elementInformations () const |
ElementsLocation::elementInformations. More... | |
Static Public Attributes | |
static int | MetaTypeId = qRegisterMetaType<ElementsLocation>("ElementsLocation") |
Id of the corresponding Qt meta type. More... | |
Private Attributes | |
QString | m_collection_path |
QString | m_file_system_path |
QETProject * | m_project = nullptr |
Cette classe represente la localisation, l'emplacement d'un element ou d'une categorie, voire d'une collection... dans une collection. Elle encapsule un chemin virtuel.
Definition at line 34 of file elementslocation.h.
ElementsLocation::ElementsLocation | ( | ) |
ElementsLocation::ElementsLocation Constructor.
Definition at line 35 of file elementslocation.cpp.
ElementsLocation::ElementsLocation | ( | const QString & | path, |
QETProject * | project = nullptr |
||
) |
Constructeur
p | Chemin de l'emplacement de l'element |
pr | Projet de l'emplacement de l'element |
Definition at line 43 of file elementslocation.cpp.
ElementsLocation::ElementsLocation | ( | const ElementsLocation & | other | ) |
Constructeur de copie
other | Autre emplacement d'element a copier |
Definition at line 59 of file elementslocation.cpp.
ElementsLocation::ElementsLocation | ( | const QMimeData * | data | ) |
ElementsLocation::ElementLocation Constructor, build an ElementLocation from a QMimeData, the mime data format must be "application/x-qet-element-uri" or "application/x-qet-category-uri". This location can be null even if format is valid.
data |
Definition at line 72 of file elementslocation.cpp.
References setPath().
|
virtual |
Destructeur
Definition at line 52 of file elementslocation.cpp.
bool ElementsLocation::addToPath | ( | const QString & | string | ) |
ElementsLocation::addToPath Add a string to the actual path of this location.
string |
Definition at line 300 of file elementslocation.cpp.
References isFileSystem(), m_collection_path, and m_file_system_path.
Referenced by ElementsCategoryEditor::acceptCreation(), ElementDialog::checkCurrentLocation(), ElementCollectionHandler::createDir(), NewElementWizard::createNewElement(), ElementCollectionHandler::importFromProject(), ElementDialog::location(), and NewElementWizard::validStep2().
QString ElementsLocation::baseName | ( | ) | const |
Definition at line 120 of file elementslocation.cpp.
References m_collection_path.
Referenced by Element::name().
QString ElementsLocation::collectionPath | ( | bool | protocol = true | ) | const |
Definition at line 146 of file elementslocation.cpp.
References m_collection_path, and path().
Referenced by XmlElementCollection::addElement(), ElementsCollectionModel::addLocation(), XmlElementCollection::cleanUnusedElement(), ECHSXmlToFile::copyDirectory(), XmlElementCollection::copyDirectory(), XmlElementCollection::copyElement(), ElementCollectionHandler::createDir(), exist(), QETProject::importElement(), ElementCollectionHandler::importFromProject(), ElementsCollectionModel::indexFromLocation(), nameList(), operator<<(), projectCollectionPath(), and setXml().
DiagramContext ElementsLocation::elementInformations | ( | ) | const |
ElementsLocation::elementInformations.
Definition at line 689 of file elementslocation.cpp.
References DiagramContext::fromXml(), isDirectory(), and xml().
Referenced by XmlProjectElementCollectionItem::setUpData(), and FileElementCollectionItem::setUpData().
bool ElementsLocation::exist | ( | ) | const |
Definition at line 435 of file elementslocation.cpp.
References collectionPath(), QETProject::embeddedElementCollection(), XmlElementCollection::exist(), fileSystemPath(), isDirectory(), isElement(), and m_project.
Referenced by ElementsCategoryEditor::acceptCreation(), XmlElementCollection::addElement(), DiagramEventAddElement::buildElement(), ElementDialog::checkAccept(), ElementDialog::checkCurrentLocation(), XmlElementCollection::copy(), ECHSToXml::copy(), ElementCollectionHandler::copy(), ECHSXmlToFile::copyDirectory(), ECHSXmlToFile::copyElement(), ElementCollectionHandler::createDir(), ElementFactory::createElement(), DiagramEventAddElement::DiagramEventAddElement(), ElementsCollectionModel::dropMimeData(), Element::Element(), ElementsCategoryEditor::ElementsCategoryEditor(), XmlElementCollection::elementsLocation(), QETElementEditor::fromLocation(), ElementPictureFactory::getPictures(), QETProject::importElement(), ElementCollectionHandler::importFromProject(), ElementsCollectionWidget::locationWasSaved(), operator<<(), QETElementEditor::pasteFromElement(), ElementsCollectionWidget::setCurrentLocation(), ElementCollectionHandler::setNames(), setXml(), ElementsTreeView::startElementDrag(), and NewElementWizard::validStep2().
QString ElementsLocation::fileName | ( | ) | const |
ElementLocation::fileName.
Definition at line 675 of file elementslocation.cpp.
References m_collection_path.
Referenced by ECHSFileToFile::copy(), ECHSXmlToFile::copy(), ECHSToXml::copy(), ECHSXmlToFile::copyDirectory(), XmlElementCollection::copyDirectory(), ECHSFileToFile::copyElement(), XmlElementCollection::copyElement(), ECHSXmlToFile::copyElement(), autonum::elementPrefixForLocation(), QETProject::importElement(), ElementCollectionHandler::importFromProject(), and name().
QString ElementsLocation::fileSystemPath | ( | ) | const |
ElementsLocation::fileSystemPath.
Definition at line 175 of file elementslocation.cpp.
References m_file_system_path, and m_project.
Referenced by XmlElementCollection::addElement(), ECHSFileToFile::copy(), ECHSXmlToFile::copy(), ECHSFileToFile::copyDirectory(), XmlElementCollection::copyDirectory(), ECHSXmlToFile::copyDirectory(), ECHSFileToFile::copyElement(), XmlElementCollection::copyElement(), ECHSXmlToFile::copyElement(), ElementCollectionHandler::createDir(), ElementsCategoryEditor::ElementsCategoryEditor(), exist(), isCommonCollection(), isCustomCollection(), isWritable(), nameList(), ElementCollectionHandler::setNames(), and setXml().
QIcon ElementsLocation::icon | ( | ) | const |
ElementLocation::icon.
Definition at line 640 of file elementslocation.cpp.
References QETApp::collectionCache(), ElementsCollectionCache::fetchElement(), ElementPictureFactory::instance(), m_project, and ElementsCollectionCache::pixmap().
Referenced by XmlProjectElementCollectionItem::setUpIcon(), and FileElementCollectionItem::setUpIcon().
bool ElementsLocation::isCommonCollection | ( | ) | const |
ElementsLocation::isCommonCollection.
Definition at line 405 of file elementslocation.cpp.
References QETApp::commonElementsDirN(), and fileSystemPath().
Referenced by ElementsCollectionModel::indexFromLocation().
bool ElementsLocation::isCustomCollection | ( | ) | const |
ElementsLocation::isCustomCollection.
Definition at line 414 of file elementslocation.cpp.
References QETApp::customElementsDirN(), and fileSystemPath().
Referenced by ElementsCollectionModel::addLocation(), and ElementsCollectionModel::indexFromLocation().
bool ElementsLocation::isDirectory | ( | ) | const |
ElementsLocation::isDirectory.
Definition at line 386 of file elementslocation.cpp.
References isElement(), and m_collection_path.
Referenced by ElementDialog::checkCurrentLocation(), XmlElementCollection::copy(), ECHSToXml::copy(), ElementCollectionHandler::createDir(), elementInformations(), exist(), ElementDialog::location(), nameList(), ElementCollectionHandler::setNames(), and ElementsTreeView::startElementDrag().
bool ElementsLocation::isElement | ( | ) | const |
Definition at line 378 of file elementslocation.cpp.
References m_collection_path.
Referenced by XmlElementCollection::addElement(), ElementDialog::checkAccept(), ElementDialog::checkCurrentLocation(), ECHSFileToFile::copy(), XmlElementCollection::copy(), ECHSXmlToFile::copy(), ElementCollectionHandler::copy(), ElementFactory::createElement(), DiagramEventAddElement::DiagramEventAddElement(), Element::Element(), ElementsCategoryEditor::ElementsCategoryEditor(), exist(), QETElementEditor::fromLocation(), QETProject::importElement(), ElementCollectionHandler::importFromProject(), isDirectory(), ElementDialog::location(), nameList(), QETElementEditor::pasteFromElement(), ElementCollectionHandler::setNames(), ElementsTreeView::startElementDrag(), QETProject::unusedElements(), and xml().
bool ElementsLocation::isFileSystem | ( | ) | const |
ElementsLocation::isFileSystem.
Definition at line 394 of file elementslocation.cpp.
References m_file_system_path, and m_project.
Referenced by XmlElementCollection::addElement(), addToPath(), ElementCollectionHandler::copy(), XmlElementCollection::copyDirectory(), XmlElementCollection::copyElement(), ElementCollectionHandler::createDir(), QETProject::importElement(), isWritable(), projectCollectionPath(), ElementCollectionHandler::setNames(), and setXml().
bool ElementsLocation::isNull | ( | ) | const |
Definition at line 355 of file elementslocation.cpp.
References m_collection_path.
Referenced by ElementsCategoryEditor::acceptCreation(), QETApp::elementEditors(), QETElementEditor::pasteFromElement(), QETElementEditor::slot_open(), QETElementEditor::slot_save(), QETElementEditor::slot_saveAs(), and QETElementEditor::slot_updateTitle().
bool ElementsLocation::isProject | ( | ) | const |
Definition at line 423 of file elementslocation.cpp.
References m_collection_path, and m_project.
Referenced by XmlElementCollection::addElement(), ElementsCollectionModel::addLocation(), XmlElementCollection::copy(), ECHSToXml::copy(), ElementCollectionHandler::copy(), ElementCollectionHandler::createDir(), autonum::elementPrefixForLocation(), ElementsCollectionCache::fetchElement(), QETProject::importElement(), ElementCollectionHandler::importFromProject(), operator<<(), ElementCollectionHandler::setNames(), and setXml().
bool ElementsLocation::isWritable | ( | ) | const |
Definition at line 461 of file elementslocation.cpp.
References QETApp::commonElementsDirN(), fileSystemPath(), isFileSystem(), QETProject::isReadOnly(), and m_project.
Referenced by ElementsCategoryEditor::acceptCreation(), ElementsCategoryEditor::acceptUpdate(), ElementCollectionHandler::createDir(), ElementsCategoryEditor::ElementsCategoryEditor(), QETElementEditor::fromLocation(), QETElementEditor::setLocation(), ElementCollectionHandler::setNames(), and setXml().
QString ElementsLocation::name | ( | ) | const |
ElementLocation::name.
Definition at line 660 of file elementslocation.cpp.
References fileName(), QET::Icons::nl, and xml().
Referenced by XmlProjectElementCollectionItem::localName(), and FileElementCollectionItem::localName().
NamesList ElementsLocation::nameList | ( | ) |
Definition at line 493 of file elementslocation.cpp.
References collectionPath(), XmlElementCollection::directory(), QETProject::embeddedElementCollection(), fileSystemPath(), isDirectory(), isElement(), m_project, QET::Icons::nl, and xml().
Referenced by XmlElementCollection::addElement(), ECHSXmlToFile::copyDirectory(), and ElementsCategoryEditor::ElementsCategoryEditor().
bool ElementsLocation::operator!= | ( | const ElementsLocation & | other | ) | const |
Operateur de comparaison
other | Autre emplacement d'element a comparer |
Definition at line 106 of file elementslocation.cpp.
References m_collection_path, and m_project.
ElementsLocation & ElementsLocation::operator= | ( | const ElementsLocation & | other | ) |
Operateur d'affectation
other | Autre emplacement d'element a affecter |
Definition at line 82 of file elementslocation.cpp.
References m_collection_path, m_file_system_path, and m_project.
bool ElementsLocation::operator== | ( | const ElementsLocation & | other | ) | const |
Operateur de comparaison
other | Autre emplacement d'element a comparer |
Definition at line 94 of file elementslocation.cpp.
References m_collection_path, and m_project.
ElementsLocation ElementsLocation::parent | ( | ) | const |
Definition at line 324 of file elementslocation.cpp.
References m_collection_path, and setPath().
Referenced by autonum::elementPrefixForLocation(), QETProject::importElement(), and ElementCollectionHandler::importFromProject().
QString ElementsLocation::path | ( | ) | const |
Definition at line 188 of file elementslocation.cpp.
References m_collection_path.
Referenced by collectionPath(), ElementsLocation(), Diagram::fromXml(), setPath(), and Element::toXml().
QETProject * ElementsLocation::project | ( | ) | const |
Definition at line 340 of file elementslocation.cpp.
References m_project.
Referenced by XmlElementCollection::addElement(), ElementsCollectionModel::addLocation(), QETApp::elementEditors(), QETProject::importElement(), setPath(), setProject(), and setXml().
XmlElementCollection * ElementsLocation::projectCollection | ( | ) | const |
ElementsLocation::projectCollection.
Definition at line 480 of file elementslocation.cpp.
References QETProject::embeddedElementCollection(), and m_project.
Referenced by XmlElementCollection::addElement(), XmlElementCollection::copy(), ECHSToXml::copy(), ECHSXmlToFile::copyDirectory(), XmlElementCollection::copyDirectory(), and ElementCollectionHandler::createDir().
QString ElementsLocation::projectCollectionPath | ( | ) | const |
ElementsLocation::projectCollectionPath.
Definition at line 162 of file elementslocation.cpp.
References collectionPath(), isFileSystem(), m_project, and QETApp::projectId().
Referenced by DiagramEventAddElement::buildElement(), XmlProjectElementCollectionItem::collectionPath(), ECHSToXml::copy(), ECHSXmlToFile::copyDirectory(), XmlElementCollection::copyDirectory(), XmlElementCollection::copyElement(), QETProject::importElement(), and operator<<().
int ElementsLocation::projectId | ( | ) | const |
ElementsLocation::projectId This method is used to know if an element belongs to a project or not.
Definition at line 134 of file elementslocation.cpp.
References m_project, and QETApp::projectId().
void ElementsLocation::setPath | ( | const QString & | path | ) |
ElementsLocation::setPath Set the path of this item. The path can be relative to a collection (start by common:// , custom:// or embed://) or not.
path |
Definition at line 198 of file elementslocation.cpp.
References QETApp::commonElementsDirN(), QETApp::customElementsDirN(), m_collection_path, m_file_system_path, m_project, path(), project(), and QETApp::project().
Referenced by XmlElementCollection::copyDirectory(), ElementsLocation(), and parent().
void ElementsLocation::setProject | ( | QETProject * | project | ) |
project | le nouveau projet pointe par cet emplacement Indiquer 0 pour que cet emplacement ne soit plus lie a un projet. |
Definition at line 348 of file elementslocation.cpp.
bool ElementsLocation::setXml | ( | const QDomDocument & | xml_document | ) | const |
ElementsLocation::setXml Replace the current xml description by ; The document element of must have tagname "definition" to be written This definition must be writable.
xml_element |
Definition at line 565 of file elementslocation.cpp.
References XmlElementCollection::addElementDefinition(), collectionPath(), QETProject::embeddedElementCollection(), exist(), fileSystemPath(), isFileSystem(), isProject(), isWritable(), project(), QETXML::writeXmlFile(), and xml().
Referenced by QETElementEditor::toLocation().
QString ElementsLocation::toString | ( | ) | const |
Definition at line 362 of file elementslocation.cpp.
References m_collection_path, m_project, and QETApp::projectId().
Referenced by ElementsCollectionCache::fetchData(), ElementsCollectionCache::fetchElement(), QETElementEditor::isEditing(), qHash(), and ElementsTreeView::startElementDrag().
QUuid ElementsLocation::uuid | ( | ) | const |
Definition at line 624 of file elementslocation.cpp.
References QET::findInDomElement(), and xml().
Referenced by ElementPictureFactory::build(), ElementsCollectionCache::fetchElement(), ElementPictureFactory::getPictures(), ElementPictureFactory::getPrimitives(), QETProject::importElement(), and ElementPictureFactory::pixmap().
QDomElement ElementsLocation::xml | ( | ) | const |
Definition at line 530 of file elementslocation.cpp.
References XmlElementCollection::directory(), XmlElementCollection::element(), QETProject::embeddedElementCollection(), isElement(), m_collection_path, m_file_system_path, and m_project.
Referenced by XmlElementCollection::addElement(), ElementPictureFactory::build(), XmlElementCollection::copyElement(), ECHSXmlToFile::copyElement(), ElementFactory::createElement(), Element::Element(), elementInformations(), QETElementEditor::fromLocation(), name(), nameList(), QETElementEditor::pasteFromElement(), ElementPictureFactory::pixmap(), ElementCollectionHandler::setNames(), setXml(), and uuid().
|
private |
Definition at line 84 of file elementslocation.h.
Referenced by addToPath(), baseName(), collectionPath(), fileName(), isDirectory(), isElement(), isNull(), isProject(), operator!=(), operator=(), operator==(), parent(), path(), setPath(), toString(), and xml().
|
private |
Definition at line 85 of file elementslocation.h.
Referenced by addToPath(), fileSystemPath(), isFileSystem(), operator=(), setPath(), and xml().
|
private |
Definition at line 86 of file elementslocation.h.
Referenced by exist(), fileSystemPath(), icon(), isFileSystem(), isProject(), isWritable(), nameList(), operator!=(), operator=(), operator==(), project(), projectCollection(), projectCollectionPath(), projectId(), setPath(), setProject(), toString(), and xml().
|
static |
Id of the corresponding Qt meta type.
Definition at line 89 of file elementslocation.h.