umbrello 2.38.4
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
12class UMLWidget;
13
21{
22public:
23
24 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
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
42private:
43 class Assoc_Rule {
44 public:
45 bool isValid() const;
50 bool role;
53 bool self;
55 };
56
57 static const Assoc_Rule m_AssocRules[];
58 static const int m_nNumRules;
59};
60
61#endif
Definition assocrules.h:43
Language language
language rule applies to
Definition assocrules.h:46
WidgetBase::WidgetType widgetA_type
type of role A widget
Definition assocrules.h:48
Level level
UML level.
Definition assocrules.h:54
bool bidirectional
can have an association of same type going between widget each way
Definition assocrules.h:52
WidgetBase::WidgetType widgetB_type
type of role B widget
Definition assocrules.h:49
bool role
role text
Definition assocrules.h:50
bool isValid() const
< Structure to help determine association rules.
Definition assocrules.cpp:567
bool self
association to self
Definition assocrules.h:53
Uml::AssociationType::Enum assoc_type
association type
Definition assocrules.h:47
bool multiplicity
multiplicity text on association
Definition assocrules.h:51
Definition assocrules.h:21
static bool allowMultiplicity(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition assocrules.cpp:367
static bool allowAssociation(Uml::AssociationType::Enum assocType, UMLWidget *widget)
Definition assocrules.cpp:50
static bool allowRole(Uml::AssociationType::Enum assocType)
Definition assocrules.cpp:351
~AssocRules()
Definition assocrules.cpp:42
static const int m_nNumRules
The number of rules known about.
Definition assocrules.h:58
AssocRules()
Definition assocrules.cpp:35
static Uml::AssociationType::Enum isGeneralisationOrRealisation(UMLWidget *widgetA, UMLWidget *widgetB)
Definition assocrules.cpp:401
static bool allowSelf(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition assocrules.cpp:383
Language
Definition assocrules.h:39
@ Java
Definition assocrules.h:39
@ All
Definition assocrules.h:39
Level
Definition assocrules.h:40
@ UML2
Definition assocrules.h:40
@ Any
Definition assocrules.h:40
@ UML1
Definition assocrules.h:40
static const Assoc_Rule m_AssocRules[]
Container that holds all the rules.
Definition assocrules.h:418
The base class for graphical UML objects.
Definition umlwidget.h:36
WidgetType
Definition widgetbase.h:107
Enum
Definition basictypes.h:92