umbrello: umbrello/assocrules.h Source File

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