• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

association.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2003-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef ASSOCIATION_H
00013 #define ASSOCIATION_H
00014 
00015 #include <qdom.h>
00016 #include "umlnamespace.h"
00017 #include "umlobject.h"
00018 
00019 class UMLRole;
00020 
00032 class UMLAssociation : public UMLObject {
00033     Q_OBJECT
00034     friend class AssociationWidget;
00035 public:
00044     UMLAssociation(Uml::Association_Type type, UMLObject *roleA, UMLObject *roleB);
00045 
00054     UMLAssociation(Uml::Association_Type type = Uml::at_Unknown);
00055 
00059     bool operator==(const UMLAssociation &rhs);
00060 
00064     virtual ~UMLAssociation();
00065 
00069     QString toString( ) const;
00070 
00077     static QString typeAsString(Uml::Association_Type atype);
00078 
00083     static bool assocTypeHasUMLRepresentation(Uml::Association_Type atype);
00084 
00090     Uml::Association_Type getAssocType() const;
00091 
00097     UMLObject* getObject(Uml::Role_Type role);
00098 
00105     Uml::IDType getObjectId(Uml::Role_Type role);
00106 
00107     /*
00108      * Returns the ID of the UMLObject assigned to the given role.
00109      * CURRENTLY UNUSED.
00110      *
00111      * @return  ID of the UMLObject of the given role.
00112     Uml::IDType getRoleId(Uml::Role_Type role) const;
00113      */
00114 
00120     Uml::Changeability_Type getChangeability(Uml::Role_Type role) const;
00121 
00127     Uml::Visibility getVisibility(Uml::Role_Type role) const;
00128 
00134     QString getMulti(Uml::Role_Type role) const;
00135 
00141     QString getRoleName(Uml::Role_Type role) const;
00142 
00148     QString getRoleDoc(Uml::Role_Type role) const;
00149 
00155     void setAssocType(Uml::Association_Type assocType);
00156 
00163     void setObject(UMLObject *obj, Uml::Role_Type role);
00164 
00171     void setVisibility(Uml::Visibility value, Uml::Role_Type role);
00172 
00179     void setChangeability(Uml::Changeability_Type value, Uml::Role_Type role);
00180 
00187     void setMulti(const QString &multi, Uml::Role_Type role);
00188 
00195     void setRoleName(const QString &roleName, Uml::Role_Type role);
00196 
00203     void setRoleDoc(const QString &doc, Uml::Role_Type role);
00204 
00210     static QString ChangeabilityToString(Uml::Changeability_Type type);
00211 
00217     UMLRole * getUMLRole(Uml::Role_Type role);
00218 
00224     void setOldLoadMode(bool value = true);
00225 
00229     bool getOldLoadMode() const;
00230 
00235     virtual UMLObject* clone() const { return NULL; }
00236 
00245     virtual bool resolveRef();
00246 
00251     void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
00252 
00253 protected:
00258     bool load(QDomElement& element);
00259 
00260     // keep track of number of parent widgets
00261     int nrof_parent_widgets;
00262 
00270     void init(Uml::Association_Type type, UMLObject *roleAObj, UMLObject *roleBObj);
00271 
00272     /* If the type Uml::Association_Type is changed then also the following
00273        must be changed accordingly:
00274        atypeFirst, atypeLast, assocTypeStr[], toAssocType(), toString().
00275        The ordering within assocTypeStr must match the enumeration
00276        order of Uml::Association_Type.
00277      */
00278     static const Uml::Association_Type atypeFirst;
00279     static const Uml::Association_Type atypeLast;
00280     static const unsigned int nAssocTypes;
00281     static const QString assocTypeStr[];
00282 
00283     UMLRole * m_pRole[2];
00284 
00285     Uml::Association_Type m_AssocType;
00286     QString m_Name;
00287     bool m_bOldLoadMode;
00288 };
00289 
00290 #endif

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kate
  •     kate
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal