umbrello: umbrello/worktoolbar.h Source File

umbrello 2.32.1 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

worktoolbar.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef WORKTOOLBAR_H
12 #define WORKTOOLBAR_H
13
14 #include "basictypes.h"
15
16 #include <ktoolbar.h>
17
18 #include <QCursor>
19 #include <QMap>
20 #include <QPixmap>
21
22 class QMainWindow;
23 class KAction;
24
40 class WorkToolBar : public KToolBar
41 {
42 Q_OBJECT
43 Q_ENUMS(ToolBar_Buttons)
44 public:
45
46 explicit WorkToolBar(QMainWindow *parentWindow);
47 ~WorkToolBar();
48
49 void setOldTool();
50 void setDefaultTool();
51
52 void setupActions();
53
57 enum ToolBar_Buttons {
58 tbb_Undefined = -1,
59 tbb_Arrow,
60 tbb_Generalization,
61 tbb_Aggregation,
62 tbb_Dependency,
63 tbb_Association,
64 tbb_Containment,
65 tbb_Coll_Mesg_Sync,
66 tbb_Coll_Mesg_Async,
67 tbb_Seq_Message_Creation,
68 tbb_Seq_Message_Destroy,
69 tbb_Seq_Message_Synchronous,
70 tbb_Seq_Message_Asynchronous,
71 tbb_Seq_Message_Found,
72 tbb_Seq_Message_Lost,
73 tbb_Seq_Combined_Fragment,
74 tbb_Seq_Precondition,
75 tbb_Composition,
76 tbb_Relationship,
77 tbb_UniAssociation,
78 tbb_State_Transition,
79 tbb_Activity_Transition,
80 tbb_Send_Signal,
81 tbb_Accept_Signal,
82 tbb_Accept_Time_Event,
83 tbb_Anchor, //keep anchor as last association until code uses better algorithm for testing
84 tbb_Note,
85 tbb_Box,
86 tbb_Text,
87 tbb_Actor,
88 tbb_UseCase,
89 tbb_Class,
90 tbb_Interface,
91 tbb_Interface_Provider,
92 tbb_Interface_Requirement,
93 tbb_Datatype,
94 tbb_Enum,
95 tbb_Entity,
96 tbb_Package,
97 tbb_Component,
98 tbb_Node,
99 tbb_Artifact,
100 tbb_Object,
101 tbb_Initial_State,
102 tbb_State,
103 tbb_Region,
104 tbb_End_State,
105 tbb_Initial_Activity,
106 tbb_Activity,
107 tbb_End_Activity,
108 tbb_Final_Activity,
109 tbb_Pin,
110 tbb_Port,
111 tbb_Branch,
112 tbb_Fork,
113 tbb_DeepHistory,
114 tbb_ShallowHistory,
115 tbb_StateFork,
116 tbb_StateJoin,
117 tbb_Junction,
118 tbb_Choice,
119 tbb_Andline,
120 tbb_Exception,
121 tbb_Object_Node,
122 tbb_PrePostCondition,
123 tbb_Category,
124 tbb_Category2Parent,
125 tbb_Child2Category,
126 tbb_Instance,
127 tbb_SubSystem
128 };
129
130 private:
131
132 typedef QMap<Uml::DiagramType::Enum, ToolBar_Buttons> OldToolMap;
133 typedef QMap<ToolBar_Buttons, QCursor> CursorMap;
134 #if QT_VERSION >= 0x050000
135 typedef QMap<ToolBar_Buttons, QAction*> ActionsMap;
136 #else
137 typedef QMap<ToolBar_Buttons, KAction*> ActionsMap;
138 #endif
139
140 ToolBar_Buttons m_CurrentButtonID;
141 OldToolMap m_map;
142 Uml::DiagramType::Enum m_Type;
143 CursorMap m_cursors;
144 ActionsMap m_actions;
145
146 void loadPixmaps();
147
148 QCursor currentCursor();
149 QCursor defaultCursor();
150
151 QAction* insertHotBtn(ToolBar_Buttons tbb);
152
153 void insertBasicAssociations();
154
155 signals:
156 void sigButtonChanged(int);
157
158 public slots:
159 void slotCheckToolBar(Uml::DiagramType::Enum dt);
160 void buttonChanged(int b);
161 void slotResetToolBar();
162
167 void slotArrow();
168 void slotGeneralization();
169 void slotAggregation();
170 void slotDependency();
171 void slotAssociation();
172 void slotContainment();
173 void slotColl_Mesg_Sync();
174 void slotColl_Mesg_Async();
175 void slotSeq_Message_Creation();
176 void slotSeq_Message_Destroy();
177 void slotSeq_Message_Synchronous();
178 void slotSeq_Message_Asynchronous();
179 void slotSeq_Message_Found();
180 void slotSeq_Message_Lost();
181 void slotSeq_Combined_Fragment();
182 void slotSeq_Precondition();
183 void slotComposition();
184 void slotRelationship();
185 void slotUniAssociation();
186 void slotState_Transition();
187 void slotActivity_Transition();
188 void slotAnchor(); // keep anchor as last association until code uses better algorithm for testing
189 void slotNote();
190 void slotBox();
191 void slotText();
192 void slotActor();
193 void slotUseCase();
194 void slotClass();
195 void slotInterface();
196 void slotInterfaceProvider();
197 void slotInterfaceRequired();
198 void slotDatatype();
199 void slotEnum();
200 void slotEntity();
201 void slotPackage();
202 void slotComponent();
203 void slotNode();
204 void slotArtifact();
205 void slotObject();
206 void slotRegion();
207 void slotInitial_State();
208 void slotState();
209 void slotEnd_State();
210 void slotInitial_Activity();
211 void slotActivity();
212 void slotEnd_Activity();
213 void slotFinal_Activity();
214 void slotBranch();
215 void slotSend_Signal();
216 void slotAccept_Signal();
217 void slotAccept_Time_Event();
218 void slotFork();
219 void slotDeepHistory();
220 void slotShallowHistory();
221 void slotStateJoin();
222 void slotStateFork();
223 void slotJunction();
224 void slotChoice();
225 void slotAndline();
226 void slotException();
227 void slotPrePostCondition();
228 void slotPin();
229 void slotPort();
230 void slotObject_Node();
231 void slotCategory();
232 void slotCategory2Parent();
233 void slotChild2Category();
234 void slotInstance();
235 void slotSubsystem();
236 };
237
238 #endif
basictypes.h
WorkToolBar
The toolbar that is different for each type of diagram.
Definition: worktoolbar.h:41
WorkToolBar::slotColl_Mesg_Sync
void slotColl_Mesg_Sync()
Definition: worktoolbar.cpp:436
WorkToolBar::slotShallowHistory
void slotShallowHistory()
Definition: worktoolbar.cpp:483
WorkToolBar::slotSeq_Combined_Fragment
void slotSeq_Combined_Fragment()
Definition: worktoolbar.cpp:444
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition: worktoolbar.h:57
WorkToolBar::tbb_DeepHistory
@ tbb_DeepHistory
Definition: worktoolbar.h:113
WorkToolBar::tbb_Activity_Transition
@ tbb_Activity_Transition
Definition: worktoolbar.h:79
WorkToolBar::tbb_Interface_Provider
@ tbb_Interface_Provider
Definition: worktoolbar.h:91
WorkToolBar::tbb_State_Transition
@ tbb_State_Transition
Definition: worktoolbar.h:78
WorkToolBar::tbb_Entity
@ tbb_Entity
Definition: worktoolbar.h:95
WorkToolBar::tbb_Instance
@ tbb_Instance
Definition: worktoolbar.h:126
WorkToolBar::tbb_StateJoin
@ tbb_StateJoin
Definition: worktoolbar.h:116
WorkToolBar::tbb_Category
@ tbb_Category
Definition: worktoolbar.h:123
WorkToolBar::tbb_Choice
@ tbb_Choice
Definition: worktoolbar.h:118
WorkToolBar::tbb_Component
@ tbb_Component
Definition: worktoolbar.h:97
WorkToolBar::tbb_Interface
@ tbb_Interface
Definition: worktoolbar.h:90
WorkToolBar::tbb_Junction
@ tbb_Junction
Definition: worktoolbar.h:117
WorkToolBar::tbb_Package
@ tbb_Package
Definition: worktoolbar.h:96
WorkToolBar::tbb_ShallowHistory
@ tbb_ShallowHistory
Definition: worktoolbar.h:114
WorkToolBar::tbb_Seq_Message_Found
@ tbb_Seq_Message_Found
Definition: worktoolbar.h:71
WorkToolBar::tbb_Object
@ tbb_Object
Definition: worktoolbar.h:100
WorkToolBar::tbb_UseCase
@ tbb_UseCase
Definition: worktoolbar.h:88
WorkToolBar::tbb_Seq_Message_Creation
@ tbb_Seq_Message_Creation
Definition: worktoolbar.h:67
WorkToolBar::tbb_Coll_Mesg_Async
@ tbb_Coll_Mesg_Async
Definition: worktoolbar.h:66
WorkToolBar::tbb_Seq_Message_Destroy
@ tbb_Seq_Message_Destroy
Definition: worktoolbar.h:68
WorkToolBar::tbb_PrePostCondition
@ tbb_PrePostCondition
Definition: worktoolbar.h:122
WorkToolBar::tbb_Activity
@ tbb_Activity
Definition: worktoolbar.h:106
WorkToolBar::tbb_Child2Category
@ tbb_Child2Category
Definition: worktoolbar.h:125
WorkToolBar::tbb_Initial_State
@ tbb_Initial_State
Definition: worktoolbar.h:101
WorkToolBar::tbb_Fork
@ tbb_Fork
Definition: worktoolbar.h:112
WorkToolBar::tbb_Exception
@ tbb_Exception
Definition: worktoolbar.h:120
WorkToolBar::tbb_Text
@ tbb_Text
Definition: worktoolbar.h:86
WorkToolBar::tbb_Seq_Message_Asynchronous
@ tbb_Seq_Message_Asynchronous
Definition: worktoolbar.h:70
WorkToolBar::tbb_Class
@ tbb_Class
Definition: worktoolbar.h:89
WorkToolBar::tbb_Send_Signal
@ tbb_Send_Signal
Definition: worktoolbar.h:80
WorkToolBar::tbb_Undefined
@ tbb_Undefined
Definition: worktoolbar.h:58
WorkToolBar::tbb_Datatype
@ tbb_Datatype
Definition: worktoolbar.h:93
WorkToolBar::tbb_Enum
@ tbb_Enum
Definition: worktoolbar.h:94
WorkToolBar::tbb_Branch
@ tbb_Branch
Definition: worktoolbar.h:111
WorkToolBar::tbb_Category2Parent
@ tbb_Category2Parent
Definition: worktoolbar.h:124
WorkToolBar::tbb_Note
@ tbb_Note
Definition: worktoolbar.h:84
WorkToolBar::tbb_Object_Node
@ tbb_Object_Node
Definition: worktoolbar.h:121
WorkToolBar::tbb_Port
@ tbb_Port
Definition: worktoolbar.h:110
WorkToolBar::tbb_UniAssociation
@ tbb_UniAssociation
Definition: worktoolbar.h:77
WorkToolBar::tbb_Final_Activity
@ tbb_Final_Activity
Definition: worktoolbar.h:108
WorkToolBar::tbb_Actor
@ tbb_Actor
Definition: worktoolbar.h:87
WorkToolBar::tbb_Initial_Activity
@ tbb_Initial_Activity
Definition: worktoolbar.h:105
WorkToolBar::tbb_Containment
@ tbb_Containment
Definition: worktoolbar.h:64
WorkToolBar::tbb_StateFork
@ tbb_StateFork
Definition: worktoolbar.h:115
WorkToolBar::tbb_Node
@ tbb_Node
Definition: worktoolbar.h:98
WorkToolBar::tbb_Accept_Time_Event
@ tbb_Accept_Time_Event
Definition: worktoolbar.h:82
WorkToolBar::tbb_Andline
@ tbb_Andline
Definition: worktoolbar.h:119
WorkToolBar::tbb_State
@ tbb_State
Definition: worktoolbar.h:102
WorkToolBar::tbb_Arrow
@ tbb_Arrow
Definition: worktoolbar.h:59
WorkToolBar::tbb_Seq_Message_Synchronous
@ tbb_Seq_Message_Synchronous
Definition: worktoolbar.h:69
WorkToolBar::tbb_Association
@ tbb_Association
Definition: worktoolbar.h:63
WorkToolBar::tbb_Coll_Mesg_Sync
@ tbb_Coll_Mesg_Sync
Definition: worktoolbar.h:65
WorkToolBar::tbb_Seq_Precondition
@ tbb_Seq_Precondition
Definition: worktoolbar.h:74
WorkToolBar::tbb_End_State
@ tbb_End_State
Definition: worktoolbar.h:104
WorkToolBar::tbb_Interface_Requirement
@ tbb_Interface_Requirement
Definition: worktoolbar.h:92
WorkToolBar::tbb_Dependency
@ tbb_Dependency
Definition: worktoolbar.h:62
WorkToolBar::tbb_Box
@ tbb_Box
Definition: worktoolbar.h:85
WorkToolBar::tbb_Seq_Message_Lost
@ tbb_Seq_Message_Lost
Definition: worktoolbar.h:72
WorkToolBar::tbb_Seq_Combined_Fragment
@ tbb_Seq_Combined_Fragment
Definition: worktoolbar.h:73
WorkToolBar::tbb_Composition
@ tbb_Composition
Definition: worktoolbar.h:75
WorkToolBar::tbb_Artifact
@ tbb_Artifact
Definition: worktoolbar.h:99
WorkToolBar::tbb_Relationship
@ tbb_Relationship
Definition: worktoolbar.h:76
WorkToolBar::tbb_End_Activity
@ tbb_End_Activity
Definition: worktoolbar.h:107
WorkToolBar::tbb_Region
@ tbb_Region
Definition: worktoolbar.h:103
WorkToolBar::tbb_Pin
@ tbb_Pin
Definition: worktoolbar.h:109
WorkToolBar::tbb_Generalization
@ tbb_Generalization
Definition: worktoolbar.h:60
WorkToolBar::tbb_Accept_Signal
@ tbb_Accept_Signal
Definition: worktoolbar.h:81
WorkToolBar::tbb_Aggregation
@ tbb_Aggregation
Definition: worktoolbar.h:61
WorkToolBar::tbb_Anchor
@ tbb_Anchor
Definition: worktoolbar.h:83
WorkToolBar::tbb_SubSystem
@ tbb_SubSystem
Definition: worktoolbar.h:127
WorkToolBar::slotAnchor
void slotAnchor()
Definition: worktoolbar.cpp:451
WorkToolBar::slotNote
void slotNote()
Definition: worktoolbar.cpp:452
WorkToolBar::slotComposition
void slotComposition()
Definition: worktoolbar.cpp:446
WorkToolBar::slotUniAssociation
void slotUniAssociation()
Definition: worktoolbar.cpp:448
WorkToolBar::slotArtifact
void slotArtifact()
Definition: worktoolbar.cpp:467
WorkToolBar::slotSubsystem
void slotSubsystem()
Definition: worktoolbar.cpp:498
WorkToolBar::~WorkToolBar
~WorkToolBar()
Definition: worktoolbar.cpp:63
WorkToolBar::slotAccept_Signal
void slotAccept_Signal()
Definition: worktoolbar.cpp:472
WorkToolBar::slotPrePostCondition
void slotPrePostCondition()
Definition: worktoolbar.cpp:493
WorkToolBar::slotEnd_State
void slotEnd_State()
Definition: worktoolbar.cpp:474
WorkToolBar::slotAssociation
void slotAssociation()
Definition: worktoolbar.cpp:434
WorkToolBar::slotContainment
void slotContainment()
Definition: worktoolbar.cpp:435
WorkToolBar::slotActivity_Transition
void slotActivity_Transition()
Definition: worktoolbar.cpp:450
WorkToolBar::slotSend_Signal
void slotSend_Signal()
Definition: worktoolbar.cpp:471
WorkToolBar::slotGeneralization
void slotGeneralization()
Definition: worktoolbar.cpp:431
WorkToolBar::slotText
void slotText()
Definition: worktoolbar.cpp:454
WorkToolBar::slotSeq_Message_Lost
void slotSeq_Message_Lost()
Definition: worktoolbar.cpp:443
WorkToolBar::defaultCursor
QCursor defaultCursor()
Definition: worktoolbar.cpp:275
WorkToolBar::currentCursor
QCursor currentCursor()
Definition: worktoolbar.cpp:267
WorkToolBar::slotObject_Node
void slotObject_Node()
Definition: worktoolbar.cpp:492
WorkToolBar::m_actions
ActionsMap m_actions
Definition: worktoolbar.h:144
WorkToolBar::slotChild2Category
void slotChild2Category()
Definition: worktoolbar.cpp:496
WorkToolBar::setupActions
void setupActions()
Definition: worktoolbar.cpp:502
WorkToolBar::slotObject
void slotObject()
Definition: worktoolbar.cpp:468
WorkToolBar::slotAggregation
void slotAggregation()
Definition: worktoolbar.cpp:432
WorkToolBar::slotRelationship
void slotRelationship()
Definition: worktoolbar.cpp:447
WorkToolBar::slotAndline
void slotAndline()
Definition: worktoolbar.cpp:490
WorkToolBar::slotEnum
void slotEnum()
Definition: worktoolbar.cpp:462
WorkToolBar::slotInterfaceProvider
void slotInterfaceProvider()
Definition: worktoolbar.cpp:459
WorkToolBar::slotChoice
void slotChoice()
Definition: worktoolbar.cpp:489
WorkToolBar::OldToolMap
QMap< Uml::DiagramType::Enum, ToolBar_Buttons > OldToolMap
Definition: worktoolbar.h:132
WorkToolBar::slotJunction
void slotJunction()
Definition: worktoolbar.cpp:488
WorkToolBar::setDefaultTool
void setDefaultTool()
Definition: worktoolbar.cpp:313
WorkToolBar::slotSeq_Message_Destroy
void slotSeq_Message_Destroy()
Definition: worktoolbar.cpp:439
WorkToolBar::slotFork
void slotFork()
Definition: worktoolbar.cpp:481
WorkToolBar::slotCheckToolBar
void slotCheckToolBar(Uml::DiagramType::Enum dt)
Definition: worktoolbar.cpp:100
WorkToolBar::sigButtonChanged
void sigButtonChanged(int)
WorkToolBar::slotEntity
void slotEntity()
Definition: worktoolbar.cpp:463
WorkToolBar::slotInstance
void slotInstance()
Definition: worktoolbar.cpp:497
WorkToolBar::slotPort
void slotPort()
Definition: worktoolbar.cpp:486
WorkToolBar::slotSeq_Message_Asynchronous
void slotSeq_Message_Asynchronous()
Definition: worktoolbar.cpp:441
WorkToolBar::slotStateFork
void slotStateFork()
Definition: worktoolbar.cpp:487
WorkToolBar::slotSeq_Message_Synchronous
void slotSeq_Message_Synchronous()
Definition: worktoolbar.cpp:440
WorkToolBar::slotBox
void slotBox()
Definition: worktoolbar.cpp:453
WorkToolBar::insertBasicAssociations
void insertBasicAssociations()
Definition: worktoolbar.cpp:87
WorkToolBar::slotInterface
void slotInterface()
Definition: worktoolbar.cpp:458
WorkToolBar::m_cursors
CursorMap m_cursors
Definition: worktoolbar.h:143
WorkToolBar::slotActivity
void slotActivity()
Definition: worktoolbar.cpp:477
WorkToolBar::m_map
OldToolMap m_map
Definition: worktoolbar.h:141
WorkToolBar::setOldTool
void setOldTool()
Definition: worktoolbar.cpp:301
WorkToolBar::slotState_Transition
void slotState_Transition()
Definition: worktoolbar.cpp:449
WorkToolBar::slotSeq_Precondition
void slotSeq_Precondition()
Definition: worktoolbar.cpp:445
WorkToolBar::slotClass
void slotClass()
Definition: worktoolbar.cpp:457
WorkToolBar::slotColl_Mesg_Async
void slotColl_Mesg_Async()
Definition: worktoolbar.cpp:437
WorkToolBar::buttonChanged
void buttonChanged(int b)
Definition: worktoolbar.cpp:231
WorkToolBar::slotComponent
void slotComponent()
Definition: worktoolbar.cpp:465
WorkToolBar::slotCategory2Parent
void slotCategory2Parent()
Definition: worktoolbar.cpp:495
WorkToolBar::ActionsMap
QMap< ToolBar_Buttons, KAction * > ActionsMap
Definition: worktoolbar.h:137
WorkToolBar::loadPixmaps
void loadPixmaps()
Definition: worktoolbar.cpp:323
WorkToolBar::slotState
void slotState()
Definition: worktoolbar.cpp:470
WorkToolBar::slotResetToolBar
void slotResetToolBar()
Definition: worktoolbar.cpp:280
WorkToolBar::CursorMap
QMap< ToolBar_Buttons, QCursor > CursorMap
Definition: worktoolbar.h:133
WorkToolBar::slotDeepHistory
void slotDeepHistory()
Definition: worktoolbar.cpp:482
WorkToolBar::slotFinal_Activity
void slotFinal_Activity()
Definition: worktoolbar.cpp:479
WorkToolBar::slotBranch
void slotBranch()
Definition: worktoolbar.cpp:480
WorkToolBar::WorkToolBar
WorkToolBar(QMainWindow *parentWindow)
Definition: worktoolbar.cpp:37
WorkToolBar::slotActor
void slotActor()
Definition: worktoolbar.cpp:455
WorkToolBar::slotInitial_State
void slotInitial_State()
Definition: worktoolbar.cpp:469
WorkToolBar::slotNode
void slotNode()
Definition: worktoolbar.cpp:466
WorkToolBar::slotUseCase
void slotUseCase()
Definition: worktoolbar.cpp:456
WorkToolBar::slotArrow
void slotArrow()
Definition: worktoolbar.cpp:430
WorkToolBar::slotPackage
void slotPackage()
Definition: worktoolbar.cpp:464
WorkToolBar::slotRegion
void slotRegion()
Definition: worktoolbar.cpp:475
WorkToolBar::slotSeq_Message_Found
void slotSeq_Message_Found()
Definition: worktoolbar.cpp:442
WorkToolBar::slotInterfaceRequired
void slotInterfaceRequired()
Definition: worktoolbar.cpp:460
WorkToolBar::slotException
void slotException()
Definition: worktoolbar.cpp:491
WorkToolBar::insertHotBtn
QAction * insertHotBtn(ToolBar_Buttons tbb)
Definition: worktoolbar.cpp:71
WorkToolBar::slotDatatype
void slotDatatype()
Definition: worktoolbar.cpp:461
WorkToolBar::slotEnd_Activity
void slotEnd_Activity()
Definition: worktoolbar.cpp:478
WorkToolBar::m_CurrentButtonID
ToolBar_Buttons m_CurrentButtonID
Definition: worktoolbar.h:140
WorkToolBar::slotDependency
void slotDependency()
Definition: worktoolbar.cpp:433
WorkToolBar::slotSeq_Message_Creation
void slotSeq_Message_Creation()
Definition: worktoolbar.cpp:438
WorkToolBar::slotAccept_Time_Event
void slotAccept_Time_Event()
Definition: worktoolbar.cpp:473
WorkToolBar::slotInitial_Activity
void slotInitial_Activity()
Definition: worktoolbar.cpp:476
WorkToolBar::slotStateJoin
void slotStateJoin()
Definition: worktoolbar.cpp:484
WorkToolBar::slotPin
void slotPin()
Definition: worktoolbar.cpp:485
WorkToolBar::m_Type
Uml::DiagramType::Enum m_Type
Definition: worktoolbar.h:142
WorkToolBar::slotCategory
void slotCategory()
Definition: worktoolbar.cpp:494
b
bool b
Definition: cxx11-null-pointer-constant.h:6
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:77