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

umbrello/umbrello

association.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   This program is free software; you can redistribute it and/or modify  *
00003  *   it under the terms of the GNU General Public License as published by  *
00004  *   the Free Software Foundation; either version 2 of the License, or     *
00005  *   (at your option) any later version.                                   *
00006  *                                                                         *
00007  *   copyright (C) 2003-2009                                               *
00008  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00009  ***************************************************************************/
00010 
00011 #ifndef ASSOCIATION_H
00012 #define ASSOCIATION_H
00013 
00014 #include <qdom.h>
00015 
00016 #include "umlnamespace.h"
00017 #include "umlobject.h"
00018 
00019 class UMLRole;
00020 
00031 class UMLAssociation : public UMLObject
00032 {
00033     Q_OBJECT
00034     friend class AssociationWidget;
00035 public:
00036 
00037     UMLAssociation(Uml::Association_Type type, UMLObject *roleA, UMLObject *roleB);
00038     UMLAssociation(Uml::Association_Type type = Uml::at_Unknown);
00039 
00040     virtual ~UMLAssociation();
00041 
00042     bool operator==(const UMLAssociation &rhs);
00043 
00044     QString toString() const;
00045 
00046     static QString toString(Uml::Association_Type atype);
00047     static QString toString(Uml::Changeability_Type type);
00048 
00049     static bool assocTypeHasUMLRepresentation(Uml::Association_Type atype);
00050 
00051     UMLRole * getUMLRole(Uml::Role_Type role) const;
00052     Uml::IDType getObjectId(Uml::Role_Type role) const;
00053     Uml::IDType getRoleId(Uml::Role_Type role) const;
00054 
00055     void setAssocType(Uml::Association_Type assocType);
00056     Uml::Association_Type getAssocType() const;
00057 
00058     void setObject(UMLObject *obj, Uml::Role_Type role);
00059     UMLObject* getObject(Uml::Role_Type role) const;
00060 
00061     void setVisibility(Uml::Visibility value, Uml::Role_Type role);
00062     Uml::Visibility getVisibility(Uml::Role_Type role) const;
00063 
00064     void setChangeability(Uml::Changeability_Type value, Uml::Role_Type role);
00065     Uml::Changeability_Type getChangeability(Uml::Role_Type role) const;
00066 
00067     void setMulti(const QString &multi, Uml::Role_Type role);
00068     QString getMulti(Uml::Role_Type role) const;
00069 
00070     void setRoleName(const QString &roleName, Uml::Role_Type role);
00071     QString getRoleName(Uml::Role_Type role) const;
00072 
00073     void setRoleDoc(const QString &doc, Uml::Role_Type role);
00074     QString getRoleDoc(Uml::Role_Type role) const;
00075 
00076     void setOldLoadMode(bool value = true);
00077     bool getOldLoadMode() const;
00078 
00079     virtual UMLObject* clone() const { return NULL; }
00080 
00081     virtual bool resolveRef();
00082 
00083     void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
00084 
00085 protected:
00086 
00087     bool load(QDomElement& element);
00088 
00089     // keep track of number of parent widgets
00090     int nrof_parent_widgets;
00091 
00092     void init(Uml::Association_Type type, UMLObject *roleAObj, UMLObject *roleBObj);
00093 
00094     /* If the type Uml::Association_Type is changed then also the following
00095        must be changed accordingly:
00096        atypeFirst, atypeLast, assocTypeStr[], toAssocType(), toString().
00097        The ordering within assocTypeStr must match the enumeration
00098        order of Uml::Association_Type.
00099      */
00100     static const Uml::Association_Type atypeFirst;
00101     static const Uml::Association_Type atypeLast;
00102     static const unsigned int nAssocTypes;
00103     static const QString assocTypeStr[];
00104 
00105     UMLRole *              m_pRole[2];
00106     Uml::Association_Type  m_AssocType;
00107     QString                m_Name;
00108     bool                   m_bOldLoadMode;
00109 
00110 private:
00111 
00112     bool isRealization(UMLObject* objA, UMLObject* objB) const;
00113 };
00114 
00115 #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"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
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