summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlwritevariableaction.cpp
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-03-08 17:20:31 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-03-08 21:21:35 +0100
commit56fcc7521b3087eb8867806fd7baf11676359ad5 (patch)
tree28af312c532ffb7eb639b0364dc14521b45f1f9f /src/uml/qumlwritevariableaction.cpp
parentfa4d83d5343f3b54b8acf0619a2852ffff0e688c (diff)
Add major refactoring for namespace-free model implementation
Rationale: - MOC needs a explicit namespace use in order to auto declare meta objects - However, syncqt does not generate iheaders if namespaces are used Change-Id: Ic66152b469b2610624025b9a76380360d581f857 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlwritevariableaction.cpp')
-rw-r--r--src/uml/qumlwritevariableaction.cpp132
1 files changed, 132 insertions, 0 deletions
diff --git a/src/uml/qumlwritevariableaction.cpp b/src/uml/qumlwritevariableaction.cpp
new file mode 100644
index 00000000..3b68c41a
--- /dev/null
+++ b/src/uml/qumlwritevariableaction.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qumlwritevariableaction.h"
+#include "qumlwritevariableaction_p.h"
+
+#include <QtUml/QUmlInputPin>
+
+#include <QtWrappedObjects/QtWrappedObjectsNamespace>
+
+QT_BEGIN_NAMESPACE
+
+QUmlWriteVariableActionPrivate::QUmlWriteVariableActionPrivate() :
+ value(0)
+{
+}
+
+QUmlWriteVariableActionPrivate::~QUmlWriteVariableActionPrivate()
+{
+}
+
+/*!
+ \class QUmlWriteVariableAction
+
+ \inmodule QtUml
+
+ \brief WriteVariableAction is an abstract class for variable actions that change variable values.
+ */
+
+QUmlWriteVariableAction::QUmlWriteVariableAction(QWrappedObject *wrapper, QWrappedObject *parent) :
+ QUmlVariableAction(*new QUmlWriteVariableActionPrivate, wrapper, parent)
+{
+ setPropertyData();
+}
+
+QUmlWriteVariableAction::QUmlWriteVariableAction(QUmlWriteVariableActionPrivate &dd, QWrappedObject *wrapper, QWrappedObject *parent) :
+ QUmlVariableAction(dd, wrapper, parent)
+{
+ setPropertyData();
+}
+
+QUmlWriteVariableAction::~QUmlWriteVariableAction()
+{
+}
+
+// ---------------------------------------------------------------
+// ASSOCIATION ENDS FROM QUmlWriteVariableAction
+// ---------------------------------------------------------------
+
+/*!
+ Value to be added or removed from the variable.
+ */
+QUmlInputPin *QUmlWriteVariableAction::value() const
+{
+ // This is a read-write association end
+
+ Q_D(const QUmlWriteVariableAction);
+ return d->value;
+}
+
+void QUmlWriteVariableAction::setValue(QUmlInputPin *value)
+{
+ // This is a read-write association end
+
+ Q_D(QUmlWriteVariableAction);
+ if (d->value != value) {
+ // Adjust subsetted property(ies)
+ (qwrappedobject_cast<QUmlActionPrivate *>(d))->removeInput(qwrappedobject_cast<QUmlInputPin *>(d->value));
+
+ d->value = value;
+
+ // Adjust subsetted property(ies)
+ if (value) {
+ (qwrappedobject_cast<QUmlActionPrivate *>(d))->addInput(qwrappedobject_cast<QUmlInputPin *>(value));
+ }
+ }
+}
+
+void QUmlWriteVariableAction::setPropertyData()
+{
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::AggregationRole] = QString::fromLatin1("composite");
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::IsDerivedUnionRole] = false;
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::DocumentationRole] = QString::fromLatin1("Value to be added or removed from the variable.");
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::RedefinedPropertiesRole] = QString::fromLatin1("");
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::SubsettedPropertiesRole] = QString::fromLatin1("QUmlAction::inputs");
+ QWrappedObject::propertyDataHash[QString::fromLatin1("QUmlWriteVariableAction")][QString::fromLatin1("value")][QtWrappedObjects::OppositeEndRole] = QString::fromLatin1("");
+
+ QUmlVariableAction::setPropertyData();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qumlwritevariableaction.cpp"
+