diff options
Diffstat (limited to 'src/uml/qumlnamedelement.h')
-rw-r--r-- | src/uml/qumlnamedelement.h | 89 |
1 files changed, 32 insertions, 57 deletions
diff --git a/src/uml/qumlnamedelement.h b/src/uml/qumlnamedelement.h index 1419108f..a7043aad 100644 --- a/src/uml/qumlnamedelement.h +++ b/src/uml/qumlnamedelement.h @@ -43,8 +43,8 @@ #include <QtUml/QtUmlGlobal> -#include <QtCore/QObject> -#include "private/umlnamedelement_p.h" +#include <QtUml/QUmlElement> + #include <QtUml/QtUmlNamespace> @@ -54,75 +54,50 @@ QT_BEGIN_NAMESPACE QT_MODULE(QtUml) -class QUmlComment; class QUmlDependency; -class QUmlElement; class QUmlNamespace; class QUmlPackage; class QUmlStringExpression; -class Q_UML_EXPORT QUmlNamedElement : public QObject, public UmlNamedElement +class Q_UML_EXPORT QUmlNamedElement : public virtual QUmlElement { - Q_OBJECT - - // Properties [Element] - Q_PROPERTY(QSet<QUmlComment *> ownedComment READ ownedComment) - Q_PROPERTY(QSet<QUmlElement *> ownedElement READ ownedElement) - Q_PROPERTY(QUmlElement * owner READ owner) - - // Properties [NamedElement] - Q_PROPERTY(QSet<QUmlDependency *> clientDependency READ clientDependency) - Q_PROPERTY(QString name READ name) - Q_PROPERTY(QUmlStringExpression * nameExpression READ nameExpression) - Q_PROPERTY(QUmlNamespace * namespace_ READ namespace_) - Q_PROPERTY(QString qualifiedName READ qualifiedName) - Q_PROPERTY(QtUml::VisibilityKind visibility READ visibility) - public: - Q_DECL_HIDDEN explicit QUmlNamedElement(QObject *parent = 0); - - // Owned attributes [Element] - Q_INVOKABLE const QSet<QUmlComment *> ownedComment() const; - Q_INVOKABLE const QSet<QUmlElement *> ownedElement() const; - Q_INVOKABLE QUmlElement *owner() const; - - // Owned attributes [NamedElement] - Q_INVOKABLE const QSet<QUmlDependency *> clientDependency() const; - Q_INVOKABLE QString name() const; - Q_INVOKABLE QUmlStringExpression *nameExpression() const; - Q_INVOKABLE QUmlNamespace *namespace_() const; - Q_INVOKABLE QString qualifiedName() const; - Q_INVOKABLE QtUml::VisibilityKind visibility() const; - - // Operations [Element] - Q_INVOKABLE QSet<QUmlElement *> allOwnedElements() const; - Q_INVOKABLE bool mustBeOwned() const; - - // Operations [NamedElement] - Q_INVOKABLE QList<QUmlNamespace *> allNamespaces() const; - Q_INVOKABLE QSet<QUmlPackage *> allOwningPackages() const; - Q_INVOKABLE bool isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const; - Q_INVOKABLE QString separator() const; - -public Q_SLOTS: - - // Slots for owned attributes [Element] - void addOwnedComment(UmlComment *ownedComment); - void removeOwnedComment(UmlComment *ownedComment); - - // Slots for owned attributes [NamedElement] - void addClientDependency(UmlDependency *clientDependency); - void removeClientDependency(UmlDependency *clientDependency); + virtual ~QUmlNamedElement(); + + // Owned attributes + const QSet<QUmlDependency *> clientDependency() const; + void addClientDependency(QUmlDependency *clientDependency); + void removeClientDependency(QUmlDependency *clientDependency); + QString name() const; void setName(QString name); + QUmlStringExpression *nameExpression() const; void setNameExpression(QUmlStringExpression *nameExpression); + QUmlNamespace *namespace_() const; + Q_DECL_HIDDEN void setNamespace(QUmlNamespace *namespace_); + QString qualifiedName() const; + Q_DECL_HIDDEN void setQualifiedName(QString qualifiedName); + QtUml::VisibilityKind visibility() const; void setVisibility(QtUml::VisibilityKind visibility); + + // Operations + QList<QUmlNamespace *> allNamespaces() const; + QSet<QUmlPackage *> allOwningPackages() const; + bool isDistinguishableFrom(QUmlNamedElement *n, QUmlNamespace *ns) const; + QString separator() const; + +protected: + explicit QUmlNamedElement(); + + QSet<QUmlDependency *> _clientDependency; + QString _name; + QUmlStringExpression *_nameExpression; + QUmlNamespace *_namespace_; + QtUml::VisibilityKind _visibility; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QUmlNamedElement *) -Q_DECLARE_METATYPE(QList<QUmlNamedElement *> *) -Q_DECLARE_METATYPE(QSet<QUmlNamedElement *> *) +Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QUmlNamedElement) *) QT_END_HEADER |