/**************************************************************************** ** ** Copyright (C) 2013 Sandro S. Andrade ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtUml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qumlpackageimportobject_p.h" #include "private/qmodelingobject_p.h" #include #include #include #include #include QT_BEGIN_NAMESPACE QUmlPackageImportObject::QUmlPackageImportObject(QUmlPackageImport *modelingElement) { setProperty("modelingElement", QVariant::fromValue(static_cast(modelingElement))); setGroupProperties(); setPropertyData(); } // OWNED ATTRIBUTES [Element] const QSet QUmlPackageImportObject::ownedComments() const { QSet set; foreach (QUmlComment *element, qmodelingelementproperty_cast(this)->ownedComments()) set.insert(element->asQModelingObject()); return set; } const QSet QUmlPackageImportObject::ownedElements() const { QSet set; foreach (QUmlElement *element, qmodelingelementproperty_cast(this)->ownedElements()) set.insert(element->asQModelingObject()); return set; } QObject *QUmlPackageImportObject::owner() const { if (!qmodelingelementproperty_cast(this)->owner()) return 0; else return qmodelingelementproperty_cast(this)->owner()->asQModelingObject(); } // OWNED ATTRIBUTES [Relationship] const QSet QUmlPackageImportObject::relatedElements() const { QSet set; foreach (QUmlElement *element, qmodelingelementproperty_cast(this)->relatedElements()) set.insert(element->asQModelingObject()); return set; } // OWNED ATTRIBUTES [DirectedRelationship] const QSet QUmlPackageImportObject::sources() const { QSet set; foreach (QUmlElement *element, qmodelingelementproperty_cast(this)->sources()) set.insert(element->asQModelingObject()); return set; } const QSet QUmlPackageImportObject::targets() const { QSet set; foreach (QUmlElement *element, qmodelingelementproperty_cast(this)->targets()) set.insert(element->asQModelingObject()); return set; } // OWNED ATTRIBUTES [PackageImport] QObject *QUmlPackageImportObject::importedPackage() const { if (!qmodelingelementproperty_cast(this)->importedPackage()) return 0; else return qmodelingelementproperty_cast(this)->importedPackage()->asQModelingObject(); } QObject *QUmlPackageImportObject::importingNamespace() const { if (!qmodelingelementproperty_cast(this)->importingNamespace()) return 0; else return qmodelingelementproperty_cast(this)->importingNamespace()->asQModelingObject(); } QtUml::VisibilityKind QUmlPackageImportObject::visibility() const { return qmodelingelementproperty_cast(this)->visibility(); } // OPERATIONS [Element] QSet QUmlPackageImportObject::allOwnedElements() const { QSet set; foreach (QUmlElement *element, qmodelingelementproperty_cast(this)->allOwnedElements()) set.insert(element->asQModelingObject()); return set; } bool QUmlPackageImportObject::mustBeOwned() const { return qmodelingelementproperty_cast(this)->mustBeOwned(); } // SLOTS FOR OWNED ATTRIBUTES [Element] void QUmlPackageImportObject::addOwnedComment(QObject *ownedComment) { qmodelingelementproperty_cast(this)->addOwnedComment(qmodelingelementproperty_cast(ownedComment)); emit ownedCommentsChanged(this->ownedComments()); } void QUmlPackageImportObject::removeOwnedComment(QObject *ownedComment) { qmodelingelementproperty_cast(this)->removeOwnedComment(qmodelingelementproperty_cast(ownedComment)); emit ownedCommentsChanged(this->ownedComments()); } void QUmlPackageImportObject::addOwnedElement(QObject *ownedElement) { qmodelingelementproperty_cast(this)->addOwnedElement(qmodelingelementproperty_cast(ownedElement)); emit ownedElementsChanged(this->ownedElements()); } void QUmlPackageImportObject::removeOwnedElement(QObject *ownedElement) { qmodelingelementproperty_cast(this)->removeOwnedElement(qmodelingelementproperty_cast(ownedElement)); emit ownedElementsChanged(this->ownedElements()); } void QUmlPackageImportObject::setOwner(QObject *owner) { qmodelingelementproperty_cast(this)->setOwner(qmodelingelementproperty_cast(owner)); emit ownerChanged(this->owner()); } // SLOTS FOR OWNED ATTRIBUTES [Relationship] void QUmlPackageImportObject::addRelatedElement(QObject *relatedElement) { qmodelingelementproperty_cast(this)->addRelatedElement(qmodelingelementproperty_cast(relatedElement)); emit relatedElementsChanged(this->relatedElements()); } void QUmlPackageImportObject::removeRelatedElement(QObject *relatedElement) { qmodelingelementproperty_cast(this)->removeRelatedElement(qmodelingelementproperty_cast(relatedElement)); emit relatedElementsChanged(this->relatedElements()); } // SLOTS FOR OWNED ATTRIBUTES [DirectedRelationship] void QUmlPackageImportObject::addSource(QObject *source) { qmodelingelementproperty_cast(this)->addSource(qmodelingelementproperty_cast(source)); emit sourcesChanged(this->sources()); } void QUmlPackageImportObject::removeSource(QObject *source) { qmodelingelementproperty_cast(this)->removeSource(qmodelingelementproperty_cast(source)); emit sourcesChanged(this->sources()); } void QUmlPackageImportObject::addTarget(QObject *target) { qmodelingelementproperty_cast(this)->addTarget(qmodelingelementproperty_cast(target)); emit targetsChanged(this->targets()); } void QUmlPackageImportObject::removeTarget(QObject *target) { qmodelingelementproperty_cast(this)->removeTarget(qmodelingelementproperty_cast(target)); emit targetsChanged(this->targets()); } // SLOTS FOR OWNED ATTRIBUTES [PackageImport] void QUmlPackageImportObject::setImportedPackage(QObject *importedPackage) { qmodelingelementproperty_cast(this)->setImportedPackage(qmodelingelementproperty_cast(importedPackage)); emit importedPackageChanged(this->importedPackage()); } void QUmlPackageImportObject::setImportingNamespace(QObject *importingNamespace) { qmodelingelementproperty_cast(this)->setImportingNamespace(qmodelingelementproperty_cast(importingNamespace)); emit importingNamespaceChanged(this->importingNamespace()); } void QUmlPackageImportObject::setVisibility(QtUml::VisibilityKind visibility) { qmodelingelementproperty_cast(this)->setVisibility(visibility); emit visibilityChanged(this->visibility()); } void QUmlPackageImportObject::unsetVisibility() { Q_D(QModelingObject); setVisibility(QtUml::VisibilityKindPublic); d->modifiedResettableProperties.removeAll(QStringLiteral("visibility")); } void QUmlPackageImportObject::setGroupProperties() { Q_D(QModelingObject); const QMetaObject *metaObject = this->metaObject(); d->propertyGroups << QStringLiteral("QObject"); d->groupProperties.insert(QStringLiteral("QObject"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("objectName")))); d->propertyGroups << QStringLiteral("QUmlElement"); d->groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedComments")))); d->groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedElements")))); d->groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owner")))); d->propertyGroups << QStringLiteral("QUmlRelationship"); d->groupProperties.insert(QStringLiteral("QUmlRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("relatedElements")))); d->propertyGroups << QStringLiteral("QUmlDirectedRelationship"); d->groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("sources")))); d->groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targets")))); d->propertyGroups << QStringLiteral("QUmlPackageImport"); d->groupProperties.insert(QStringLiteral("QUmlPackageImport"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("importedPackage")))); d->groupProperties.insert(QStringLiteral("QUmlPackageImport"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("importingNamespace")))); d->groupProperties.insert(QStringLiteral("QUmlPackageImport"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); } void QUmlPackageImportObject::setPropertyData() { Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, AggregationRole, QStringLiteral("composite")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, PropertyClassRole, QStringLiteral("QUmlElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, DocumentationRole, QStringLiteral("The Comments owned by this element.")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, SubsettedPropertiesRole, QStringLiteral("Element-ownedElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedComments, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, AggregationRole, QStringLiteral("composite")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, PropertyClassRole, QStringLiteral("QUmlElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, DocumentationRole, QStringLiteral("The Elements owned by this element.")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, ownedElements, OppositeEndRole, QStringLiteral("Element-owner")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, PropertyClassRole, QStringLiteral("QUmlElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, PropertyTypeRole, QStringLiteral("QUmlElement *")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, DocumentationRole, QStringLiteral("The Element that owns this element.")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlElement, owner, OppositeEndRole, QStringLiteral("Element-ownedElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, PropertyClassRole, QStringLiteral("QUmlRelationship")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, DocumentationRole, QStringLiteral("Specifies the elements related by the Relationship.")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlRelationship, relatedElements, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, PropertyClassRole, QStringLiteral("QUmlDirectedRelationship")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, DocumentationRole, QStringLiteral("Specifies the sources of the DirectedRelationship.")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, SubsettedPropertiesRole, QStringLiteral("Relationship-relatedElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, sources, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, PropertyClassRole, QStringLiteral("QUmlDirectedRelationship")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, DocumentationRole, QStringLiteral("Specifies the targets of the DirectedRelationship.")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, SubsettedPropertiesRole, QStringLiteral("Relationship-relatedElement")); Q_DECLARE_METAPROPERTY_INFO(QUmlDirectedRelationship, targets, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, PropertyClassRole, QStringLiteral("QUmlPackageImport")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, PropertyTypeRole, QStringLiteral("QUmlPackage *")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, DocumentationRole, QStringLiteral("Specifies the Package whose members are imported into a Namespace.")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, SubsettedPropertiesRole, QStringLiteral("DirectedRelationship-target")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importedPackage, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, PropertyClassRole, QStringLiteral("QUmlPackageImport")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, PropertyTypeRole, QStringLiteral("QUmlNamespace *")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, DocumentationRole, QStringLiteral("Specifies the Namespace that imports the members from a Package.")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, SubsettedPropertiesRole, QStringLiteral("Element-owner DirectedRelationship-source")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, importingNamespace, OppositeEndRole, QStringLiteral("Namespace-packageImport")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, PropertyClassRole, QStringLiteral("QUmlPackageImport")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, PropertyTypeRole, QStringLiteral("QtUml::VisibilityKind")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, DocumentationRole, QStringLiteral("Specifies the visibility of the imported PackageableElements within the importing Namespace, i.e., whether imported elements will in turn be visible to other packages that use that importingPackage as an importedPackage. If the PackageImport is public, the imported elements will be visible outside the package, while if it is private they will not.")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QUmlPackageImport, visibility, OppositeEndRole, QStringLiteral("")); } QT_END_NAMESPACE