umbrello  2.38.5
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
assocrules.h
Go to the documentation of this file.
1 /*
2  SPDX-License-Identifier: GPL-2.0-or-later
3  SPDX-FileCopyrightText: 2002-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5 
6 #ifndef ASSOCRULES_H
7 #define ASSOCRULES_H
8 
9 #include "umlobject.h"
10 #include "widgetbase.h"
11 
12 class UMLWidget;
13 
21 {
22 public:
23 
24  AssocRules();
25  ~AssocRules();
26 
27  static bool allowAssociation(Uml::AssociationType::Enum assocType, UMLWidget * widget);
28  static bool allowAssociation(Uml::AssociationType::Enum assocType,
29  UMLWidget * widgetA, UMLWidget * widgetB);
30 
31  static bool allowRole(Uml::AssociationType::Enum assocType);
32 
33  static bool allowMultiplicity(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType);
34 
35  static bool allowSelf(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType);
36 
38 
39  typedef enum {All, Java} Language;
40  typedef enum {Any, UML1, UML2 } Level;
41 
42 private:
43  class Assoc_Rule {
44  public:
45  bool isValid() const;
50  bool role;
51  bool multiplicity;
53  bool self;
55  };
56 
57  static const Assoc_Rule m_AssocRules[];
58  static const int m_nNumRules;
59 };
60 
61 #endif
static Uml::AssociationType::Enum isGeneralisationOrRealisation(UMLWidget *widgetA, UMLWidget *widgetB)
Definition: assocrules.cpp:401
Language language
language rule applies to
Definition: assocrules.h:46
bool multiplicity
multiplicity text on association
Definition: assocrules.h:51
Uml::AssociationType::Enum assoc_type
association type
Definition: assocrules.h:47
Definition: assocrules.h:43
AssocRules()
Definition: assocrules.cpp:35
static const Assoc_Rule m_AssocRules[]
Container that holds all the rules.
Definition: assocrules.h:57
static bool allowMultiplicity(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition: assocrules.cpp:367
WidgetBase::WidgetType widgetA_type
type of role A widget
Definition: assocrules.h:48
Level
Definition: assocrules.h:40
Level level
UML level.
Definition: assocrules.h:54
WidgetType
Definition: widgetbase.h:106
Definition: assocrules.h:39
Definition: assocrules.h:20
WidgetBase::WidgetType widgetB_type
type of role B widget
Definition: assocrules.h:49
static const int m_nNumRules
The number of rules known about.
Definition: assocrules.h:58
Language
Definition: assocrules.h:39
Definition: assocrules.h:40
bool bidirectional
can have an association of same type going between widget each way
Definition: assocrules.h:52
bool isValid() const
< Structure to help determine association rules.
Definition: assocrules.cpp:567
Enum
Definition: basictypes.h:92
Definition: assocrules.h:40
~AssocRules()
Definition: assocrules.cpp:42
static bool allowSelf(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition: assocrules.cpp:383
Definition: assocrules.h:39
static bool allowRole(Uml::AssociationType::Enum assocType)
Definition: assocrules.cpp:351
static bool allowAssociation(Uml::AssociationType::Enum assocType, UMLWidget *widget)
Definition: assocrules.cpp:50
bool role
role text
Definition: assocrules.h:50
Definition: assocrules.h:40
The base class for graphical UML objects.
Definition: umlwidget.h:35