/**************************************************************************** ** ** Copyright (C) 2013 Sandro S. Andrade ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtMof 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 "qmofliteralstringobject_p.h" #include "private/qmodelingobject_p.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE QMofLiteralStringObject::QMofLiteralStringObject(QMofLiteralString *modelingElement) { setProperty("modelingElement", QVariant::fromValue(static_cast(modelingElement))); setGroupProperties(); setPropertyData(); } // OWNED ATTRIBUTES [Element] const QSet QMofLiteralStringObject::ownedComments() const { QSet set; foreach (QMofComment *element, qmodelingelementproperty_cast(this)->ownedComments()) set.insert(element->asQModelingObject()); return set; } const QSet QMofLiteralStringObject::ownedElements() const { QSet set; foreach (QMofElement *element, qmodelingelementproperty_cast(this)->ownedElements()) set.insert(element->asQModelingObject()); return set; } QObject *QMofLiteralStringObject::owner() const { if (!qmodelingelementproperty_cast(this)->owner()) return 0; else return qmodelingelementproperty_cast(this)->owner()->asQModelingObject(); } // OWNED ATTRIBUTES [NamedElement] QString QMofLiteralStringObject::name() const { return qmodelingelementproperty_cast(this)->name(); } QObject *QMofLiteralStringObject::namespace_() const { if (!qmodelingelementproperty_cast(this)->namespace_()) return 0; else return qmodelingelementproperty_cast(this)->namespace_()->asQModelingObject(); } QString QMofLiteralStringObject::qualifiedName() const { return qmodelingelementproperty_cast(this)->qualifiedName(); } // OWNED ATTRIBUTES [PackageableElement] QtMof::VisibilityKind QMofLiteralStringObject::visibility() const { return qmodelingelementproperty_cast(this)->visibility(); } // OWNED ATTRIBUTES [TypedElement] QObject *QMofLiteralStringObject::type() const { if (!qmodelingelementproperty_cast(this)->type()) return 0; else return qmodelingelementproperty_cast(this)->type()->asQModelingObject(); } // OWNED ATTRIBUTES [LiteralString] QString QMofLiteralStringObject::value() const { return qmodelingelementproperty_cast(this)->value(); } // OPERATIONS [Element] QSet QMofLiteralStringObject::allOwnedElements() const { QSet set; foreach (QMofElement *element, qmodelingelementproperty_cast(this)->allOwnedElements()) set.insert(element->asQModelingObject()); return set; } bool QMofLiteralStringObject::mustBeOwned() const { return qmodelingelementproperty_cast(this)->mustBeOwned(); } QObject *QMofLiteralStringObject::getMetaClass() const { if (!qmodelingelementproperty_cast(this)->getMetaClass()) return 0; else return qmodelingelementproperty_cast(this)->getMetaClass()->asQModelingObject(); } QObject *QMofLiteralStringObject::container() const { if (!qmodelingelementproperty_cast(this)->container()) return 0; else return qmodelingelementproperty_cast(this)->container()->asQModelingObject(); } bool QMofLiteralStringObject::isInstanceOfType(QObject *type, bool includesSubtypes) const { return qmodelingelementproperty_cast(this)->isInstanceOfType(qmodelingelementproperty_cast(type), includesSubtypes); } void QMofLiteralStringObject::delete_() { return qmodelingelementproperty_cast(this)->delete_(); } // OPERATIONS [NamedElement] QList QMofLiteralStringObject::allNamespaces() const { QList set; foreach (QMofNamespace *element, qmodelingelementproperty_cast(this)->allNamespaces()) set.append(element->asQModelingObject()); return set; } bool QMofLiteralStringObject::isDistinguishableFrom(QObject *n, QObject *ns) const { return qmodelingelementproperty_cast(this)->isDistinguishableFrom(qmodelingelementproperty_cast(n), qmodelingelementproperty_cast(ns)); } QString QMofLiteralStringObject::separator() const { return qmodelingelementproperty_cast(this)->separator(); } // OPERATIONS [ValueSpecification] bool QMofLiteralStringObject::booleanValue() const { return qmodelingelementproperty_cast(this)->booleanValue(); } int QMofLiteralStringObject::integerValue() const { return qmodelingelementproperty_cast(this)->integerValue(); } bool QMofLiteralStringObject::isNull() const { return qmodelingelementproperty_cast(this)->isNull(); } double QMofLiteralStringObject::realValue() { return qmodelingelementproperty_cast(this)->realValue(); } QString QMofLiteralStringObject::unlimitedValue() const { return qmodelingelementproperty_cast(this)->unlimitedValue(); } // OPERATIONS [LiteralString] bool QMofLiteralStringObject::isComputable() const { return qmodelingelementproperty_cast(this)->isComputable(); } QString QMofLiteralStringObject::stringValue() const { return qmodelingelementproperty_cast(this)->stringValue(); } // SLOTS FOR OWNED ATTRIBUTES [Element] void QMofLiteralStringObject::addOwnedComment(QObject *ownedComment) { qmodelingelementproperty_cast(this)->addOwnedComment(qmodelingelementproperty_cast(ownedComment)); emit ownedCommentsChanged(this->ownedComments()); } void QMofLiteralStringObject::removeOwnedComment(QObject *ownedComment) { qmodelingelementproperty_cast(this)->removeOwnedComment(qmodelingelementproperty_cast(ownedComment)); emit ownedCommentsChanged(this->ownedComments()); } void QMofLiteralStringObject::addOwnedElement(QObject *ownedElement) { qmodelingelementproperty_cast(this)->addOwnedElement(qmodelingelementproperty_cast(ownedElement)); emit ownedElementsChanged(this->ownedElements()); } void QMofLiteralStringObject::removeOwnedElement(QObject *ownedElement) { qmodelingelementproperty_cast(this)->removeOwnedElement(qmodelingelementproperty_cast(ownedElement)); emit ownedElementsChanged(this->ownedElements()); } void QMofLiteralStringObject::setOwner(QObject *owner) { qmodelingelementproperty_cast(this)->setOwner(qmodelingelementproperty_cast(owner)); emit ownerChanged(this->owner()); } // SLOTS FOR OWNED ATTRIBUTES [NamedElement] void QMofLiteralStringObject::setName(QString name) { qmodelingelementproperty_cast(this)->setName(name); emit nameChanged(this->name()); } void QMofLiteralStringObject::setNamespace(QObject *namespace_) { qmodelingelementproperty_cast(this)->setNamespace(qmodelingelementproperty_cast(namespace_)); emit namespaceChanged(this->namespace_()); } void QMofLiteralStringObject::setQualifiedName(QString qualifiedName) { qmodelingelementproperty_cast(this)->setQualifiedName(qualifiedName); emit qualifiedNameChanged(this->qualifiedName()); } // SLOTS FOR OWNED ATTRIBUTES [PackageableElement] void QMofLiteralStringObject::setVisibility(QtMof::VisibilityKind visibility) { qmodelingelementproperty_cast(this)->setVisibility(visibility); emit visibilityChanged(this->visibility()); } void QMofLiteralStringObject::unsetVisibility() { Q_D(QModelingObject); setVisibility(QtMof::VisibilityKindPublic); d->modifiedResettableProperties.removeAll(QStringLiteral("visibility")); } // SLOTS FOR OWNED ATTRIBUTES [TypedElement] void QMofLiteralStringObject::setType(QObject *type) { qmodelingelementproperty_cast(this)->setType(qmodelingelementproperty_cast(type)); emit typeChanged(this->type()); } // SLOTS FOR OWNED ATTRIBUTES [LiteralString] void QMofLiteralStringObject::setValue(QString value) { qmodelingelementproperty_cast(this)->setValue(value); emit valueChanged(this->value()); } void QMofLiteralStringObject::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("QMofElement"); d->groupProperties.insert(QStringLiteral("QMofElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedComments")))); d->groupProperties.insert(QStringLiteral("QMofElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedElements")))); d->groupProperties.insert(QStringLiteral("QMofElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owner")))); d->propertyGroups << QStringLiteral("QMofNamedElement"); d->groupProperties.insert(QStringLiteral("QMofNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("name")))); d->groupProperties.insert(QStringLiteral("QMofNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("namespace_")))); d->groupProperties.insert(QStringLiteral("QMofNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("qualifiedName")))); d->propertyGroups << QStringLiteral("QMofPackageableElement"); d->groupProperties.insert(QStringLiteral("QMofPackageableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); d->propertyGroups << QStringLiteral("QMofTypedElement"); d->groupProperties.insert(QStringLiteral("QMofTypedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("type")))); d->propertyGroups << QStringLiteral("QMofValueSpecification"); d->propertyGroups << QStringLiteral("QMofLiteralSpecification"); d->propertyGroups << QStringLiteral("QMofLiteralString"); d->groupProperties.insert(QStringLiteral("QMofLiteralString"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("value")))); } void QMofLiteralStringObject::setPropertyData() { Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, AggregationRole, QStringLiteral("composite")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, PropertyClassRole, QStringLiteral("QMofElement")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, DocumentationRole, QStringLiteral("The Comments owned by this element.")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, SubsettedPropertiesRole, QStringLiteral("Element-ownedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedComments, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, AggregationRole, QStringLiteral("composite")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, PropertyClassRole, QStringLiteral("QMofElement")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, PropertyTypeRole, QStringLiteral("QSet")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, DocumentationRole, QStringLiteral("The Elements owned by this element.")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, ownedElements, OppositeEndRole, QStringLiteral("Element-owner")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, PropertyClassRole, QStringLiteral("QMofElement")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, PropertyTypeRole, QStringLiteral("QMofElement *")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, DocumentationRole, QStringLiteral("The Element that owns this element.")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofElement, owner, OppositeEndRole, QStringLiteral("Element-ownedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, PropertyClassRole, QStringLiteral("QMofNamedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, PropertyTypeRole, QStringLiteral("QString")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, DocumentationRole, QStringLiteral("The name of the NamedElement.")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, name, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, PropertyClassRole, QStringLiteral("QMofNamedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, PropertyTypeRole, QStringLiteral("QMofNamespace *")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, IsDerivedUnionRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, DocumentationRole, QStringLiteral("Specifies the namespace that owns the NamedElement.")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, SubsettedPropertiesRole, QStringLiteral("Element-owner A_member_memberNamespace-memberNamespace")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, namespace_, OppositeEndRole, QStringLiteral("Namespace-ownedMember")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, PropertyClassRole, QStringLiteral("QMofNamedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, PropertyTypeRole, QStringLiteral("QString")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, IsDerivedRole, true); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, DocumentationRole, QStringLiteral("A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself.")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, qualifiedName, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, PropertyClassRole, QStringLiteral("QMofNamedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, PropertyTypeRole, QStringLiteral("QtMof::VisibilityKind")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, DocumentationRole, QStringLiteral("Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofNamedElement, visibility, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, PropertyClassRole, QStringLiteral("QMofPackageableElement")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, PropertyTypeRole, QStringLiteral("QtMof::VisibilityKind")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, DocumentationRole, QStringLiteral("Indicates that packageable elements must always have a visibility, i.e., visibility is not optional.")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, RedefinedPropertiesRole, QStringLiteral("NamedElement-visibility")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofPackageableElement, visibility, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, PropertyClassRole, QStringLiteral("QMofTypedElement")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, PropertyTypeRole, QStringLiteral("QMofType *")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, DocumentationRole, QStringLiteral("The type of the TypedElement.")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofTypedElement, type, OppositeEndRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, AggregationRole, QStringLiteral("none")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, PropertyClassRole, QStringLiteral("QMofLiteralString")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, PropertyTypeRole, QStringLiteral("QString")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, IsDerivedRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, IsDerivedUnionRole, false); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, DocumentationRole, QStringLiteral("The specified String value.")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, RedefinedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, SubsettedPropertiesRole, QStringLiteral("")); Q_DECLARE_METAPROPERTY_INFO(QMofLiteralString, value, OppositeEndRole, QStringLiteral("")); } QT_END_NAMESPACE