diff options
26 files changed, 1376 insertions, 0 deletions
diff --git a/examples/uml/duse-mt/src/app/example-cp.xmi b/examples/uml/duse-mt/src/app/example-cp.xmi new file mode 100644 index 00000000..670c8fa9 --- /dev/null +++ b/examples/uml/duse-mt/src/app/example-cp.xmi @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701" xmlns:mofext="http://www.omg.org/spec/MOF/20110701" xmlns:MeasurementProfile="http://liveblue.wordpress.com/MeasurementProfile"> + <uml:Model name="MyModel" xmi:id="MyModel"> + <packageImport xmi:type="uml:PackageImport" xmi:id="_PackageImport.0"> + <importedPackage href=":/metamodels/PrimitiveTypes.xmi#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Interface" name="IInput" xmi:id="MyModel-IInput"> + <ownedOperation xmi:type="uml:Operation" name="start" xmi:id="MyModel-IInput-start"> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="stop" xmi:id="MyModel-IInput-stop"> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="setDestination" xmi:id="MyModel-IInput-setDestination"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IInput-setDestination-destinationId" name="destinationId" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Integer"/> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="navigate" xmi:id="MyModel-IInput-navigate"> + </ownedOperation> + </packagedElement> + <packagedElement xmi:type="uml:DataType" name="Point" xmi:id="MyModel-Point"> + <ownedAttribute xmi:type="uml:Property" visibility="public" name="latitude" xmi:id="MyModel-Point-latitude"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/> + </ownedAttribute> + <ownedAttribute xmi:type="uml:Property" visibility="public" name="longitude" xmi:id="MyModel-Point-longitude"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Interface" name="IPosition" xmi:id="MyModel-IPosition"> + <ownedOperation xmi:type="uml:Operation" name="getPosition" xmi:id="MyModel-IPosition-getPosition"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IPosition-getPosition-position" name="position" visibility="public" direction="out" type="MyModel-Point"> + </ownedParameter> + </ownedOperation> + </packagedElement> + <packagedElement xmi:type="uml:Interface" name="IMap" xmi:id="MyModel-IMap"> + <ownedOperation xmi:type="uml:Operation" name="getMap" xmi:id="MyModel-IMap-getMap"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IMap-getMap-currentPosition" name="currentPosition" visibility="public" direction="in" type="MyModel-Point"> + </ownedParameter> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IMap-getMap-destinationId" name="destinationId" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Integer"/> + </ownedParameter> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IMap-getMap-map" name="map" visibility="public" direction="out"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="MyModel-IMap-getMap-map-upperValue" value="*"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="MyModel-IMap-getMap-map-lowerValue" value="0"/> + </ownedParameter> + </ownedOperation> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:applyingPackage="MyModel" xmi:id="MeasurementProfileApplication"> + <appliedProfile xmi:type="uml:Profile" xmi:applyingPackage="MyModel" href=":/metamodels/MeasurementProfile.xmi#MeasurementProfile"/> + </profileApplication> + <packagedElement xmi:type="uml:Interface" name="IConnect" xmi:id="MyModel-IConnect"> + <ownedOperation xmi:type="uml:Operation" name="connect" xmi:id="MyModel-IConnect-connect"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IConnect-connect-connectionString" name="connectionString" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="disconnect" xmi:id="MyModel-IConnect-disconnect"> + </ownedOperation> + </packagedElement> + <packagedElement xmi:type="uml:Interface" name="IOutput" xmi:id="MyModel-IOutput"> + <ownedOperation xmi:type="uml:Operation" name="clearOutput" xmi:id="MyModel-IOutput-clearOutput"> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="loadMap" xmi:id="MyModel-IOutput-loadMap"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IOutput-loadMap-map" name="map" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="MyModel-IOutput-loadMap-map-upperValue" value="*"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="MyModel-IOutput-loadMap-map-lowerValue" value="0"/> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="displayCurrentLocation" xmi:id="MyModel-IOutput-displayCurrentLocation"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IOutput-displayCurrentLocation-location" name="location" visibility="public" direction="in" type="MyModel-Point"> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="displayRouteTravelled" xmi:id="MyModel-IOutput-displayRouteTravelled"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IOutput-displayCurrentLocation-route" name="route" visibility="public" direction="in" type="MyModel-Point"> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="MyModel-IOutput-displayCurrentLocation-route-upperValue" value="*"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="MyModel-IOutput-displayCurrentLocation-route-lowerValue" value="0"/> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="displayDistanceTravelled" xmi:id="MyModel-IOutput-displayDistanceTravelled"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IOutput-displayDistanceTravelled-distance" name="distance" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/> + </ownedParameter> + </ownedOperation> + <ownedOperation xmi:type="uml:Operation" name="displayStatus" xmi:id="MyModel-IOutput-displayStatus"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="MyModel-IOutput-displayStatus-status" name="status" visibility="public" direction="in"> + <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/> + </ownedParameter> + </ownedOperation> + </packagedElement> + </uml:Model> + <MeasurementProfile:ILFInterface xmi:id="IInput-ILFInterface" base_Interface="MyModel-IInput"/> + <MeasurementProfile:ILFInterface xmi:id="IPosition-ILFInterface" base_Interface="MyModel-IPosition"/> + <MeasurementProfile:ILFInterface xmi:id="IMap-ILFInterface" base_Interface="MyModel-IMap"/> +</xmi:XMI> + diff --git a/scripts/normative-xmi/MeasurementProfile.xmi b/scripts/normative-xmi/MeasurementProfile.xmi new file mode 100644 index 00000000..8833b625 --- /dev/null +++ b/scripts/normative-xmi/MeasurementProfile.xmi @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701"> + <uml:Profile name="MeasurementProfile" xmi:id="MeasurementProfile" URI="http://liveblue.wordpress.com/MeasurementProfile"> + <elementImport xmi:type="uml:ElementImport" xmi:id="elementImport0"> + <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </elementImport> + <packagedElement xmi:type="uml:Stereotype" name="ILFInterface" xmi:id="ILFInterface"> + <ownedAttribute xmi:type="uml:Property" xmi:id="ILFInterface-base_Interface" visibility="public" name="base_Interface" association="A_interface_ILFInterface"> + <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="A_interface_ILFInterface" name="A_interface_ILFInterface"> + <memberEnd xmi:idref="A_interface_ILFInterface-extension_ILFInterface"/> + <memberEnd xmi:idref="ILFInterface-base_Interface"/> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="A_interface_ILFInterface-extension_ILFInterface" name="extension_ILFInterface" type="ILFInterface" aggregation="composite" association="A_interface_ILFInterface"/> + </packagedElement> + <packagedElement xmi:type="uml:Stereotype" name="EIFInterface" xmi:id="EIFInterface"> + <ownedAttribute xmi:type="uml:Property" xmi:id="EIFInterface-base_Interface" visibility="public" name="base_Interface" association="A_interface_EIFInterface"> + <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="A_interface_EIFInterface" name="A_interface_EIFInterface"> + <memberEnd xmi:idref="A_interface_EIFInterface-extension_EIFInterface"/> + <memberEnd xmi:idref="EIFInterface-base_Interface"/> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="A_interface_EIFInterface-extension_EIFInterface" name="extension_EIFInterface" type="EIFInterface" aggregation="composite" association="A_interface_EIFInterface"/> + </packagedElement> + </uml:Profile> +</xmi:XMI> + diff --git a/src/measurementprofile/doc/images/.gitignore b/src/measurementprofile/doc/images/.gitignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/measurementprofile/doc/images/.gitignore diff --git a/src/measurementprofile/doc/qtmeasurementprofile.qdocconf b/src/measurementprofile/doc/qtmeasurementprofile.qdocconf new file mode 100644 index 00000000..d2eb4d6f --- /dev/null +++ b/src/measurementprofile/doc/qtmeasurementprofile.qdocconf @@ -0,0 +1,44 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtMeasurementProfile +description = Qt MeasurementProfile Reference Documentation +url = http://qt-project.org/doc/qt-$QT_VER +version = $QT_VERSION + +examplesinstallpath = measurementprofile + +qhp.projects = QtMeasurementProfile + +qhp.QtMeasurementProfile.file = qtmeasurementprofile.qhp +qhp.QtMeasurementProfile.namespace = org.qt-project.qtmeasurementprofile.$QT_VERSION_TAG +qhp.QtMeasurementProfile.virtualFolder = qtmeasurementprofile +qhp.QtMeasurementProfile.indexTitle = Qt Measurement Profile +qhp.QtMeasurementProfile.indexRoot = + +qhp.QtMeasurementProfile.filterAttributes = qtmeasurementprofile $QT_VERSION qtrefdoc +qhp.QtMeasurementProfile.customFilters.Qt.name = QtMeasurementProfile $QT_VERSION +qhp.QtMeasurementProfile.customFilters.Qt.filterAttributes = qtmeasurementprofile $QT_VERSION + +qhp.QtMeasurementProfile.subprojects = classes +qhp.QtMeasurementProfile.subprojects.classes.title = C++ Classes +qhp.QtMeasurementProfile.subprojects.classes.indexTitle = Qt Measurement Profile C++ Classes +qhp.QtMeasurementProfile.subprojects.classes.selectors = class fake:headerfile +qhp.QtMeasurementProfile.subprojects.classes.sortPages = true +tagfile = ../../../doc/qtmeasurementprofile/qtmeasurementprofile.tags + +depends += qtcore qtdoc qtmodeling qtuml + +headerdirs += .. + +sourcedirs += .. \ + ../../../examples/measurementprofile/doc/src + +exampledirs += ../../../examples/measurementprofile \ + ../ \ + snippets + +imagedirs += images \ + ../../../examples/measurementprofile/doc/images + +navigation.landingpage = "Qt Measurement Profiles" +navigation.cppclassespage = "Qt Measurement Profile C++ Classes" diff --git a/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.cpp b/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.cpp new file mode 100644 index 00000000..f4769a25 --- /dev/null +++ b/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.cpp @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +//! [0] +#include <QtMeasurementProfile> +//! [0] diff --git a/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.pro b/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.pro new file mode 100644 index 00000000..301574ac --- /dev/null +++ b/src/measurementprofile/doc/snippets/code/doc_src_qtmeasurementprofile.pro @@ -0,0 +1,3 @@ +#! [0] +QT += measurementprofile +#! [0] diff --git a/src/measurementprofile/doc/src/qtmeasurementprofile.qdoc b/src/measurementprofile/doc/src/qtmeasurementprofile.qdoc new file mode 100644 index 00000000..b17b2f28 --- /dev/null +++ b/src/measurementprofile/doc/src/qtmeasurementprofile.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \page qtmeasurementprofile-index.html + \title Qt Measurement Profile + \brief Implements the DuSE profile for measuring architecture complexity. + + Qt Measurement Profile is an add-on module which implements a profile for measuring architecture complexity. + + \section1 Getting Started + To enable Qt Measurement Profile in a project, add this directive into the C++ files: + \code + #include <QtMeasurementProfile> + \endcode + To link against the Qt Measurement Profile module, add this line to the project file: + \code + QT += measurementprofile + \endcode + + \section1 Reference + These are links to the API reference materials. + \list + \li \l{Qt Measurement Profile C++ Classes}{C++ classes} + \endlist +*/ + +/*! + \module QtMeasurementProfile + \title Qt Measurement Profile C++ Classes + \ingroup modules + \brief Implements the DuSE profile for measuring architecture complexity. + + To include the definitions of the module's classes, use the + following directive: + + \snippet code/doc_src_qtmeasurementprofile.cpp 0 + + To link against the module, add this line to your \l qmake \c + .pro file: + + \snippet code/doc_src_qtmeasurementprofile.pro 0 +*/ diff --git a/src/measurementprofile/measurementprofile.pri b/src/measurementprofile/measurementprofile.pri new file mode 100644 index 00000000..c067d493 --- /dev/null +++ b/src/measurementprofile/measurementprofile.pri @@ -0,0 +1,16 @@ +HEADERS += \ + qtmeasurementprofileglobal.h \ + qtmeasurementprofilenamespace.h \ + qmeasurementprofileilfinterface.h \ + qmeasurementprofileeifinterface.h + +PRIVATE_HEADERS += \ + qobjects/qmeasurementprofileilfinterfaceobject_p.h \ + qobjects/qmeasurementprofileeifinterfaceobject_p.h + +SOURCES += \ + qtmeasurementprofilenamespace.cpp \ + qobjects/qmeasurementprofileilfinterfaceobject.cpp \ + qmeasurementprofileilfinterface.cpp \ + qobjects/qmeasurementprofileeifinterfaceobject.cpp \ + qmeasurementprofileeifinterface.cpp diff --git a/src/measurementprofile/measurementprofile.pro b/src/measurementprofile/measurementprofile.pro new file mode 100644 index 00000000..d8702f5f --- /dev/null +++ b/src/measurementprofile/measurementprofile.pro @@ -0,0 +1,12 @@ +load(qt_build_config) + +TARGET = QtMeasurementProfile +QT = core-private modeling-private uml + +QMAKE_DOCS = $$PWD/doc/qtmeasurementprofile.qdocconf + +load(qt_module) + +include(measurementprofile.pri) + +HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS diff --git a/src/measurementprofile/qmeasurementprofileeifinterface.cpp b/src/measurementprofile/qmeasurementprofileeifinterface.cpp new file mode 100644 index 00000000..0b96bc3c --- /dev/null +++ b/src/measurementprofile/qmeasurementprofileeifinterface.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qmeasurementprofileeifinterface.h" + +#include "private/qmeasurementprofileeifinterfaceobject_p.h" + +#include <QtUml/QUmlInterface> + +QT_BEGIN_NAMESPACE + +QMeasurementProfileEIFInterface::QMeasurementProfileEIFInterface(bool createQModelingObject) : + _base_Interface(0) +{ + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QMeasurementProfileEIFInterfaceObject(this)); +} + +/*! + Destroys the QMeasurementProfileEIFInterface. + */ +QMeasurementProfileEIFInterface::~QMeasurementProfileEIFInterface() +{ + QModelingElement::deleteQModelingObject(); +} + +QModelingElement *QMeasurementProfileEIFInterface::clone() const +{ + QMeasurementProfileEIFInterface *c = new QMeasurementProfileEIFInterface; + c->asQModelingObject()->setObjectName(this->asQModelingObject()->objectName()); + c->asQModelingObject()->setProperty("role", this->asQModelingObject()->property("role")); + return c; +} + +// OWNED ATTRIBUTES + +QUmlInterface *QMeasurementProfileEIFInterface::base_Interface() const +{ + // This is a read-write association end + + return _base_Interface; +} + +void QMeasurementProfileEIFInterface::setBase_Interface(QUmlInterface *base_Interface) +{ + // This is a read-write association end + + if (_base_Interface != base_Interface) { + _base_Interface = base_Interface; + if (base_Interface && base_Interface->asQModelingObject() && this->asQModelingObject()) + QObject::connect(base_Interface->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setBase_Interface())); + } +} + +QT_END_NAMESPACE + diff --git a/src/measurementprofile/qmeasurementprofileeifinterface.h b/src/measurementprofile/qmeasurementprofileeifinterface.h new file mode 100644 index 00000000..b12316e6 --- /dev/null +++ b/src/measurementprofile/qmeasurementprofileeifinterface.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QMEASUREMENTPROFILEEIFINTERFACE_H +#define QMEASUREMENTPROFILEEIFINTERFACE_H + +#include <QtMeasurementProfile/QtMeasurementProfileGlobal> + +#include <QtModeling/QModelingElement> + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtMeasurementProfile) + +class QUmlInterface; + +class Q_MEASUREMENTPROFILE_EXPORT QMeasurementProfileEIFInterface : public QModelingElement +{ +public: + explicit QMeasurementProfileEIFInterface(bool createQModelingObject = true); + virtual ~QMeasurementProfileEIFInterface(); + + virtual QModelingElement *clone() const; + + // Owned attributes + QUmlInterface *base_Interface() const; + void setBase_Interface(QUmlInterface *base_Interface); + +protected: + QUmlInterface *_base_Interface; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QMeasurementProfileEIFInterface) *) + +#endif // QMEASUREMENTPROFILEEIFINTERFACE_H + diff --git a/src/measurementprofile/qmeasurementprofileilfinterface.cpp b/src/measurementprofile/qmeasurementprofileilfinterface.cpp new file mode 100644 index 00000000..2e5356bb --- /dev/null +++ b/src/measurementprofile/qmeasurementprofileilfinterface.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qmeasurementprofileilfinterface.h" + +#include "private/qmeasurementprofileilfinterfaceobject_p.h" + +#include <QtUml/QUmlInterface> + +QT_BEGIN_NAMESPACE + +QMeasurementProfileILFInterface::QMeasurementProfileILFInterface(bool createQModelingObject) : + _base_Interface(0) +{ + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QMeasurementProfileILFInterfaceObject(this)); +} + +/*! + Destroys the QMeasurementProfileILFInterface. + */ +QMeasurementProfileILFInterface::~QMeasurementProfileILFInterface() +{ + QModelingElement::deleteQModelingObject(); +} + +QModelingElement *QMeasurementProfileILFInterface::clone() const +{ + QMeasurementProfileILFInterface *c = new QMeasurementProfileILFInterface; + c->asQModelingObject()->setObjectName(this->asQModelingObject()->objectName()); + c->asQModelingObject()->setProperty("role", this->asQModelingObject()->property("role")); + return c; +} + +// OWNED ATTRIBUTES + +QUmlInterface *QMeasurementProfileILFInterface::base_Interface() const +{ + // This is a read-write association end + + return _base_Interface; +} + +void QMeasurementProfileILFInterface::setBase_Interface(QUmlInterface *base_Interface) +{ + // This is a read-write association end + + if (_base_Interface != base_Interface) { + _base_Interface = base_Interface; + if (base_Interface && base_Interface->asQModelingObject() && this->asQModelingObject()) + QObject::connect(base_Interface->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setBase_Interface())); + } +} + +QT_END_NAMESPACE + diff --git a/src/measurementprofile/qmeasurementprofileilfinterface.h b/src/measurementprofile/qmeasurementprofileilfinterface.h new file mode 100644 index 00000000..a06dfdac --- /dev/null +++ b/src/measurementprofile/qmeasurementprofileilfinterface.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QMEASUREMENTPROFILEILFINTERFACE_H +#define QMEASUREMENTPROFILEILFINTERFACE_H + +#include <QtMeasurementProfile/QtMeasurementProfileGlobal> + +#include <QtModeling/QModelingElement> + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtMeasurementProfile) + +class QUmlInterface; + +class Q_MEASUREMENTPROFILE_EXPORT QMeasurementProfileILFInterface : public QModelingElement +{ +public: + explicit QMeasurementProfileILFInterface(bool createQModelingObject = true); + virtual ~QMeasurementProfileILFInterface(); + + virtual QModelingElement *clone() const; + + // Owned attributes + QUmlInterface *base_Interface() const; + void setBase_Interface(QUmlInterface *base_Interface); + +protected: + QUmlInterface *_base_Interface; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QMeasurementProfileILFInterface) *) + +#endif // QMEASUREMENTPROFILEILFINTERFACE_H + diff --git a/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject.cpp b/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject.cpp new file mode 100644 index 00000000..46bb9fe8 --- /dev/null +++ b/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject.cpp @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qmeasurementprofileeifinterfaceobject_p.h" +#include "private/qmodelingobject_p.h" + +#include <QtMeasurementProfile/QMeasurementProfileEIFInterface> +#include <QtUml/QUmlInterface> + +QT_BEGIN_NAMESPACE + +QMeasurementProfileEIFInterfaceObject::QMeasurementProfileEIFInterfaceObject(QMeasurementProfileEIFInterface *modelingElement) +{ + setProperty("modelingElement", QVariant::fromValue(static_cast<QModelingElement *>(modelingElement))); + setGroupProperties(); + setPropertyData(); +} + +// OWNED ATTRIBUTES [EIFInterface] + +QObject *QMeasurementProfileEIFInterfaceObject::base_Interface() const +{ + if (!qmodelingelementproperty_cast<QMeasurementProfileEIFInterface *>(this)->base_Interface()) + return 0; + else + return qmodelingelementproperty_cast<QMeasurementProfileEIFInterface *>(this)->base_Interface()->asQModelingObject(); +} + +// SLOTS FOR OWNED ATTRIBUTES [EIFInterface] + +void QMeasurementProfileEIFInterfaceObject::setBase_Interface(QObject *base_Interface) +{ + qmodelingelementproperty_cast<QMeasurementProfileEIFInterface *>(this)->setBase_Interface(qmodelingelementproperty_cast<QUmlInterface *>(base_Interface)); + emit base_InterfaceChanged(this->base_Interface()); +} + + +void QMeasurementProfileEIFInterfaceObject::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("QMeasurementProfileEIFInterface"); + d->groupProperties.insert(QStringLiteral("QMeasurementProfileEIFInterface"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("base_Interface")))); +} + +void QMeasurementProfileEIFInterfaceObject::setPropertyData() +{ + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, AggregationRole, QStringLiteral("none")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, PropertyClassRole, QStringLiteral("QMeasurementProfileEIFInterface")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, PropertyTypeRole, QStringLiteral("QUmlInterface *")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, IsDerivedRole, false); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, IsDerivedUnionRole, false); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, DocumentationRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, RedefinedPropertiesRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, SubsettedPropertiesRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileEIFInterface, base_Interface, OppositeEndRole, QStringLiteral("")); + +} + +QT_END_NAMESPACE + diff --git a/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject_p.h b/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject_p.h new file mode 100644 index 00000000..30f26b53 --- /dev/null +++ b/src/measurementprofile/qobjects/qmeasurementprofileeifinterfaceobject_p.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QMEASUREMENTPROFILEEIFINTERFACEOBJECT_H +#define QMEASUREMENTPROFILEEIFINTERFACEOBJECT_H + +#include <QtMeasurementProfile/QtMeasurementProfileGlobal> + +#include <QtModeling/QModelingObject> + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtMeasurementProfile) + +class QMeasurementProfileEIFInterface; +class QModelingObjectPrivate; +class Q_MEASUREMENTPROFILE_EXPORT QMeasurementProfileEIFInterfaceObject : public QModelingObject +{ + Q_OBJECT + Q_DISABLE_COPY(QMeasurementProfileEIFInterfaceObject) + Q_DECLARE_PRIVATE(QModelingObject) + + // Properties [EIFInterface] + Q_PROPERTY(QObject * base_Interface READ base_Interface WRITE setBase_Interface NOTIFY base_InterfaceChanged) + +public: + Q_INVOKABLE explicit QMeasurementProfileEIFInterfaceObject(QMeasurementProfileEIFInterface *modelingElement); + + // Owned attributes [EIFInterface] + Q_INVOKABLE QObject *base_Interface() const; + +public Q_SLOTS: + + // Slots for owned attributes [EIFInterface] + void setBase_Interface(QObject *base_Interface = 0); + +Q_SIGNALS: + + // Signals for owned attributes [EIFInterface] + void base_InterfaceChanged(QObject *base_Interface); + +protected: + virtual void setGroupProperties(); + virtual void setPropertyData(); +}; + +QT_END_NAMESPACE + +#endif // QMEASUREMENTPROFILEEIFINTERFACEOBJECT_H + diff --git a/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject.cpp b/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject.cpp new file mode 100644 index 00000000..1eb968c9 --- /dev/null +++ b/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject.cpp @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qmeasurementprofileilfinterfaceobject_p.h" +#include "private/qmodelingobject_p.h" + +#include <QtMeasurementProfile/QMeasurementProfileILFInterface> +#include <QtUml/QUmlInterface> + +QT_BEGIN_NAMESPACE + +QMeasurementProfileILFInterfaceObject::QMeasurementProfileILFInterfaceObject(QMeasurementProfileILFInterface *modelingElement) +{ + setProperty("modelingElement", QVariant::fromValue(static_cast<QModelingElement *>(modelingElement))); + setGroupProperties(); + setPropertyData(); +} + +// OWNED ATTRIBUTES [ILFInterface] + +QObject *QMeasurementProfileILFInterfaceObject::base_Interface() const +{ + if (!qmodelingelementproperty_cast<QMeasurementProfileILFInterface *>(this)->base_Interface()) + return 0; + else + return qmodelingelementproperty_cast<QMeasurementProfileILFInterface *>(this)->base_Interface()->asQModelingObject(); +} + +// SLOTS FOR OWNED ATTRIBUTES [ILFInterface] + +void QMeasurementProfileILFInterfaceObject::setBase_Interface(QObject *base_Interface) +{ + qmodelingelementproperty_cast<QMeasurementProfileILFInterface *>(this)->setBase_Interface(qmodelingelementproperty_cast<QUmlInterface *>(base_Interface)); + emit base_InterfaceChanged(this->base_Interface()); +} + + +void QMeasurementProfileILFInterfaceObject::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("QMeasurementProfileILFInterface"); + d->groupProperties.insert(QStringLiteral("QMeasurementProfileILFInterface"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("base_Interface")))); +} + +void QMeasurementProfileILFInterfaceObject::setPropertyData() +{ + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, AggregationRole, QStringLiteral("none")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, PropertyClassRole, QStringLiteral("QMeasurementProfileILFInterface")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, PropertyTypeRole, QStringLiteral("QUmlInterface *")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, IsDerivedRole, false); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, IsDerivedUnionRole, false); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, DocumentationRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, RedefinedPropertiesRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, SubsettedPropertiesRole, QStringLiteral("")); + Q_DECLARE_METAPROPERTY_INFO(QMeasurementProfileILFInterface, base_Interface, OppositeEndRole, QStringLiteral("")); + +} + +QT_END_NAMESPACE + diff --git a/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject_p.h b/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject_p.h new file mode 100644 index 00000000..75e15d31 --- /dev/null +++ b/src/measurementprofile/qobjects/qmeasurementprofileilfinterfaceobject_p.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QMEASUREMENTPROFILEILFINTERFACEOBJECT_H +#define QMEASUREMENTPROFILEILFINTERFACEOBJECT_H + +#include <QtMeasurementProfile/QtMeasurementProfileGlobal> + +#include <QtModeling/QModelingObject> + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtMeasurementProfile) + +class QMeasurementProfileILFInterface; +class QModelingObjectPrivate; +class Q_MEASUREMENTPROFILE_EXPORT QMeasurementProfileILFInterfaceObject : public QModelingObject +{ + Q_OBJECT + Q_DISABLE_COPY(QMeasurementProfileILFInterfaceObject) + Q_DECLARE_PRIVATE(QModelingObject) + + // Properties [ILFInterface] + Q_PROPERTY(QObject * base_Interface READ base_Interface WRITE setBase_Interface NOTIFY base_InterfaceChanged) + +public: + Q_INVOKABLE explicit QMeasurementProfileILFInterfaceObject(QMeasurementProfileILFInterface *modelingElement); + + // Owned attributes [ILFInterface] + Q_INVOKABLE QObject *base_Interface() const; + +public Q_SLOTS: + + // Slots for owned attributes [ILFInterface] + void setBase_Interface(QObject *base_Interface = 0); + +Q_SIGNALS: + + // Signals for owned attributes [ILFInterface] + void base_InterfaceChanged(QObject *base_Interface); + +protected: + virtual void setGroupProperties(); + virtual void setPropertyData(); +}; + +QT_END_NAMESPACE + +#endif // QMEASUREMENTPROFILEILFINTERFACEOBJECT_H + diff --git a/src/measurementprofile/qtmeasurementprofileglobal.h b/src/measurementprofile/qtmeasurementprofileglobal.h new file mode 100644 index 00000000..f5032fbc --- /dev/null +++ b/src/measurementprofile/qtmeasurementprofileglobal.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QTMEASUREMENTPROFILEGLOBAL_H +#define QTMEASUREMENTPROFILEGLOBAL_H + +#include <QtCore/QtGlobal> + +#include <QtCore/QMetaType> +#include <QtCore/QList> +#include <QtCore/QSet> +#include <QtCore/QString> + +QT_BEGIN_NAMESPACE + +#ifndef QT_STATIC +# if defined(QT_BUILD_MEASUREMENTPROFILE_LIB) +# define Q_MEASUREMENTPROFILE_EXPORT Q_DECL_EXPORT +# else +# define Q_MEASUREMENTPROFILE_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_MEASUREMENTPROFILE_EXPORT +#endif + +QT_END_NAMESPACE + +#endif // QTMEASUREMENTPROFILEGLOBAL_H + diff --git a/src/measurementprofile/qtmeasurementprofilenamespace.cpp b/src/measurementprofile/qtmeasurementprofilenamespace.cpp new file mode 100644 index 00000000..13dfd1b9 --- /dev/null +++ b/src/measurementprofile/qtmeasurementprofilenamespace.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qtmeasurementprofilenamespace.h" + +QT_BEGIN_NAMESPACE +QT_END_NAMESPACE + diff --git a/src/measurementprofile/qtmeasurementprofilenamespace.h b/src/measurementprofile/qtmeasurementprofilenamespace.h new file mode 100644 index 00000000..eedaed1e --- /dev/null +++ b/src/measurementprofile/qtmeasurementprofilenamespace.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QTMEASUREMENTPROFILENAMESPACE_H +#define QTMEASUREMENTPROFILENAMESPACE_H + +#include <QtMeasurementProfile/QtMeasurementProfileGlobal> + +#include <QtCore/QObject> + +QT_BEGIN_NAMESPACE + +QT_MODULE(QtMeasurementProfile) + +class Q_MEASUREMENTPROFILE_EXPORT QtMeasurementProfile : public QObject +{ + Q_OBJECT + +public: +}; + +QT_END_NAMESPACE + +#endif // QTMEASUREMENTPROFILENAMESPACE_H + diff --git a/src/plugins/metamodels/measurementprofile/MeasurementProfile.xmi b/src/plugins/metamodels/measurementprofile/MeasurementProfile.xmi new file mode 100644 index 00000000..8833b625 --- /dev/null +++ b/src/plugins/metamodels/measurementprofile/MeasurementProfile.xmi @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.omg.org/spec/UML/20110701"> + <uml:Profile name="MeasurementProfile" xmi:id="MeasurementProfile" URI="http://liveblue.wordpress.com/MeasurementProfile"> + <elementImport xmi:type="uml:ElementImport" xmi:id="elementImport0"> + <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </elementImport> + <packagedElement xmi:type="uml:Stereotype" name="ILFInterface" xmi:id="ILFInterface"> + <ownedAttribute xmi:type="uml:Property" xmi:id="ILFInterface-base_Interface" visibility="public" name="base_Interface" association="A_interface_ILFInterface"> + <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="A_interface_ILFInterface" name="A_interface_ILFInterface"> + <memberEnd xmi:idref="A_interface_ILFInterface-extension_ILFInterface"/> + <memberEnd xmi:idref="ILFInterface-base_Interface"/> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="A_interface_ILFInterface-extension_ILFInterface" name="extension_ILFInterface" type="ILFInterface" aggregation="composite" association="A_interface_ILFInterface"/> + </packagedElement> + <packagedElement xmi:type="uml:Stereotype" name="EIFInterface" xmi:id="EIFInterface"> + <ownedAttribute xmi:type="uml:Property" xmi:id="EIFInterface-base_Interface" visibility="public" name="base_Interface" association="A_interface_EIFInterface"> + <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Interface"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="A_interface_EIFInterface" name="A_interface_EIFInterface"> + <memberEnd xmi:idref="A_interface_EIFInterface-extension_EIFInterface"/> + <memberEnd xmi:idref="EIFInterface-base_Interface"/> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="A_interface_EIFInterface-extension_EIFInterface" name="extension_EIFInterface" type="EIFInterface" aggregation="composite" association="A_interface_EIFInterface"/> + </packagedElement> + </uml:Profile> +</xmi:XMI> + diff --git a/src/plugins/metamodels/measurementprofile/measurementprofile.json b/src/plugins/metamodels/measurementprofile/measurementprofile.json new file mode 100644 index 00000000..961b21c3 --- /dev/null +++ b/src/plugins/metamodels/measurementprofile/measurementprofile.json @@ -0,0 +1,7 @@ +{ + "Version": "1.0", + "Vendor": "Qt Project", + "MetaModelNamespaceUri": "http://liveblue.wordpress.com/MeasurementProfile", + "MetaModelPrefix": "QMeasurementProfile", + "MetaModelTopLevelTypes": [ ] +} diff --git a/src/plugins/metamodels/measurementprofile/measurementprofile.pro b/src/plugins/metamodels/measurementprofile/measurementprofile.pro new file mode 100644 index 00000000..faccc980 --- /dev/null +++ b/src/plugins/metamodels/measurementprofile/measurementprofile.pro @@ -0,0 +1,18 @@ +TARGET = qmeasurementprofilemetamodel + +PLUGIN_TYPE = metamodels +PLUGIN_CLASS_NAME = QMeasurementProfileMetaModelPlugin +load(qt_plugin) + +QT += modeling measurementprofile + +HEADERS = qmeasurementprofilemetamodelplugin.h + +SOURCES = qmeasurementprofilemetamodelplugin.cpp + +xmi.files = MeasurementProfile.xmi +xmi.path = $${target.path} + +INSTALLS += xmi + +OTHER_FILES += measurementprofile.json diff --git a/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.cpp b/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.cpp new file mode 100644 index 00000000..1111ee07 --- /dev/null +++ b/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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 "qmeasurementprofilemetamodelplugin.h" + +#include <QtModeling/QModelingElement> + +#include <QtMeasurementProfile/QtMeasurementProfile> + +QMeasurementProfileMetaModelPlugin::QMeasurementProfileMetaModelPlugin(QObject *parent) + : QMetaModelPlugin(parent) +{ +} + +QModelingElement *QMeasurementProfileMetaModelPlugin::createModelingElement(QString type) +{ + if (type == "QMeasurementProfileEIFInterface") return new QMeasurementProfileEIFInterface; + if (type == "QMeasurementProfileILFInterface") return new QMeasurementProfileILFInterface; + Q_ASSERT_X(true, + "QMeasurementProfileMetaModelPlugin::createModelingElement", + QStringLiteral("QMeasurementProfileMetaModelPlugin does not know how to create instances of '%1' type !").arg(type).toLatin1()); + return 0; +} + diff --git a/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.h b/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.h new file mode 100644 index 00000000..b4ae5184 --- /dev/null +++ b/src/plugins/metamodels/measurementprofile/qmeasurementprofilemetamodelplugin.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org> +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMeasurementProfile 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$ +** +****************************************************************************/ +#ifndef QMEASUREMENTPROFILEMETAMODELPLUGIN_H +#define QMEASUREMENTPROFILEMETAMODELPLUGIN_H + +#include <QtModeling/QMetaModelPlugin> + +QT_BEGIN_NAMESPACE + +class QModelingElement; + +class QMeasurementProfileMetaModelPlugin : public QMetaModelPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QMetaModelPlugin" FILE "measurementprofile.json") + +public: + QMeasurementProfileMetaModelPlugin(QObject *parent = 0); + + virtual QModelingElement *createModelingElement(QString type); +}; + +QT_END_NAMESPACE + +#endif // QMEASUREMENTPROFILEMETAMODELPLUGIN_H + diff --git a/src/plugins/metamodels/metamodels.pro b/src/plugins/metamodels/metamodels.pro index a546ae2c..c58ce38a 100644 --- a/src/plugins/metamodels/metamodels.pro +++ b/src/plugins/metamodels/metamodels.pro @@ -4,3 +4,4 @@ qtHaveModule(uml): SUBDIRS += uml qtHaveModule(mof): SUBDIRS += mof qtHaveModule(duse): SUBDIRS += duse qtHaveModule(saduseprofile): SUBDIRS += saduseprofile +qtHaveModule(measurementprofile): SUBDIRS += measurementprofile |