umbrello API Documentation

assocrules.h

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) 2002-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef ASSOCRULES_H
00013 #define ASSOCRULES_H
00014 
00015 #include "umlnamespace.h"
00016 namespace std
00017     { class type_info; }
00018 
00019 class UMLWidget;
00020 
00027 class AssocRules {
00028 public:
00032     AssocRules();
00033 
00037     ~AssocRules();
00038 
00043     static bool allowAssociation( Uml::Association_Type assocType, UMLWidget * widget );
00044 
00045     static bool allowAssociation( Uml::Association_Type assocType, const std::type_info & );
00046 
00051     static bool allowAssociation( Uml::Association_Type assocType,
00052                                   UMLWidget * widgetA, UMLWidget * widgetB,
00053                                   bool extendedCheck = true );
00054 
00058     static bool allowRole( Uml::Association_Type assocType );
00059 
00064     static bool allowMultiplicity( Uml::Association_Type assocType, Uml::Widget_Type widgetType );
00065 
00069     static bool allowSelf( Uml::Association_Type assocType, Uml::Widget_Type widgetType );
00070 
00076     static Uml::Association_Type isGeneralisationOrRealisation(UMLWidget* widgetA, UMLWidget* widgetB);
00077 
00078 private:
00079 
00083     struct Assoc_Rule {
00084         Uml::Association_Type assoc_type; 
00085         Uml::Widget_Type widgetA_type; 
00086         Uml::Widget_Type widgetB_type; 
00087         bool role;                   
00088         bool multiplicity;           
00089 
00090         bool directional;
00091 
00092         bool self;                   
00093     };
00094 
00098     static Assoc_Rule m_AssocRules[];
00099 
00103     static int m_nNumRules;
00104 };
00105 
00106 #endif
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:54 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003