summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/umlnamespace.h
blob: 7f466a995be9f1c726f8eb8fd66f9360fb978e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2002-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef UMLNAMESPACE_H
#define UMLNAMESPACE_H

#include <string>
#include <tqstring.h>


/**
 *@author Paul Hensgen
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
 */
namespace Uml {

enum Model_Type
{
    mt_Logical,
    mt_UseCase,
    mt_Component,
    mt_Deployment,
    mt_EntityRelationship,
    N_MODELTYPES   // must remain last
};

enum Object_Type
{
    ot_UMLObject  = 100,
    ot_Actor,
    ot_UseCase,
    ot_Package,
    ot_Interface,
    ot_Datatype,
    ot_Enum,
    ot_Class,
    ot_Association,
    ot_Attribute,
    ot_Operation,
    ot_EnumLiteral,
    ot_Template,
    ot_Component,
    ot_Artifact,
    ot_Node,
    ot_Stereotype,
    ot_Role,
    ot_Entity,
    ot_EntityAttribute,
    ot_Folder
};

class Visibility {
  public:
    enum Value {
        Public  =  200,
        Private,
        Protected,
        Implementation // objects marked with this are declared in the implementation file.
    };
    Visibility();
    Visibility(Value v);
    static TQString toString(Value value, bool mnemonic);
    static Visibility fromString(const TQString& vis);
    /**
     * Convert Visibility value into TQString representation.
     *
     * @param mnemonic    If true then return a single character:
     *              "+" for public, "-" for private,
     *              "#" for protected or "~" for implementation
     */
    TQString toString(bool mnemonic = false) const;
    operator Value () const;
  private:
    Value _v;
};

enum Widget_Type
{
    wt_UMLWidget = 300,         // does not have UMLObject representation
    wt_Actor,                   // has UMLObject representation
    wt_UseCase,                 // has UMLObject representation
    wt_Class,                   // has UMLObject representation
    wt_Interface,               // has UMLObject representation
    wt_Datatype,                // has UMLObject representation
    wt_Enum,                    // has UMLObject representation
    wt_Entity,                  // has UMLObject representation
    wt_Package,                 // has UMLObject representation
    wt_Object,                  // has UMLObject representation
    wt_Note,                    // does not have UMLObject representation
    wt_Box,                     // does not have UMLObject representation
    wt_Message,                 // does not have UMLObject representation
    wt_Text,                    // does not have UMLObject representation
    wt_State,                   // does not have UMLObject representation
    wt_Activity,                // does not have UMLObject representation
    wt_Component,               // has UMLObject representation
    wt_Artifact,                // has UMLObject representation
    wt_Node,                    // has UMLObject representation
    wt_Association,             // has UMLObject representation
    wt_ForkJoin                 // does not have UMLObject representation
};

enum Diagram_Type
{
    //the values in this enum are saved out to the file
    //for file compatibility, only add new values to the end
    dt_Undefined = 0,
    dt_Class,
    dt_UseCase,
    dt_Sequence,
    dt_Collaboration,
    dt_State,
    dt_Activity,
    dt_Component,
    dt_Deployment,
    dt_EntityRelationship
};

enum Association_Type
{
    at_Generalization  =  500,
    at_Aggregation,
    at_Dependency,
    at_Association,
    at_Association_Self,
    at_Coll_Message,
    at_Seq_Message,
    at_Coll_Message_Self,
    at_Seq_Message_Self,
    at_Containment,
    at_Composition,
    at_Realization,
    at_UniAssociation,
    at_Anchor,
    at_State,
    at_Activity,
    at_Relationship,
    at_Unknown  =  - 1
};

enum Signature_Type
{
    st_NoSig  =  600,
    st_ShowSig,
    st_SigNoVis,
    st_NoSigNoVis
};

enum Text_Role
{
    tr_Floating  =  700,   //text widget on diagrams
    tr_MultiA,             //Text for Multiple A
    tr_MultiB,             //Text for Multiple B
    tr_Name,               //middle text on most associations
    tr_Seq_Message,        //message on seq diagram between two objects
    tr_Seq_Message_Self,   //message to self on seq diagram - feature not implemented yet
    tr_Coll_Message,       //message between two objects on a collab diagram
    tr_Coll_Message_Self,  //message to object self on collab diagram
    tr_State,
    tr_RoleAName,          //RoleA text on associations
    tr_RoleBName,          //RoleB text on associations
    tr_ChangeA,            //Changeability A text on associations
    tr_ChangeB             //Changeability B text on associations
};

enum ListView_Type
{
    //the values in this enum are saved out to the file
    //for file compatibility, only add new values to the end
    lvt_View  =  800,
    lvt_Logical_View,
    lvt_UseCase_View,
    lvt_Logical_Folder,
    lvt_UseCase_Folder,
    lvt_UseCase_Diagram,
    lvt_Collaboration_Diagram,
    lvt_Class_Diagram,
    lvt_State_Diagram,
    lvt_Activity_Diagram,
    lvt_Sequence_Diagram,
    lvt_Actor,
    lvt_UseCase,
    lvt_Class,
    lvt_Attribute,
    lvt_Operation,
    lvt_Template,
    lvt_Interface,
    lvt_Package,
    lvt_Component_Diagram,
    lvt_Component_Folder,
    lvt_Component_View,
    lvt_Component,
    lvt_Diagrams,  // currently unused
    lvt_Artifact,
    lvt_Deployment_Diagram,
    lvt_Deployment_Folder,
    lvt_Deployment_View,
    lvt_Node,
    lvt_Datatype,
    lvt_Datatype_Folder,
    lvt_Enum,
    lvt_Entity,
    lvt_EntityAttribute,
    lvt_EntityRelationship_Diagram,
    lvt_EntityRelationship_Folder,
    lvt_EntityRelationship_Model,
    lvt_Subsystem,
    lvt_Model,
    lvt_EnumLiteral,
    lvt_Unknown = -1
};

enum Icon_Type
{
    it_Home = 0,
    it_Folder_Cyan,
    it_Folder_Cyan_Open,
    it_Folder_Green,
    it_Folder_Green_Open,
    it_Folder_Grey,
    it_Folder_Grey_Open,
    it_Folder_Red,
    it_Folder_Red_Open,
    it_Folder_Violet,
    it_Folder_Violet_Open,
    it_Folder_Orange,
    it_Folder_Orange_Open,
    it_Diagram, //change to have different one for each type of diagram
    it_Class,
    it_Template,
    it_Package,
    it_Subsystem,
    it_Component,
    it_Node,
    it_Artifact,
    it_Interface,
    it_Datatype,
    it_Enum,
    it_Entity,
    it_Actor,
    it_UseCase,
    it_Public_Method,
    it_Private_Method,
    it_Protected_Method,
    it_Public_Attribute,
    it_Private_Attribute,
    it_Protected_Attribute,
    it_Diagram_Activity,
    it_Diagram_Class,
    it_Diagram_Collaboration,
    it_Diagram_Component,
    it_Diagram_Deployment,
    it_Diagram_EntityRelationship,
    it_Diagram_Sequence,
    it_Diagram_State,
    it_Diagram_Usecase,
    N_ICONTYPES    // must remain last
};

enum Changeability_Type
{
    chg_Changeable = 900,
    chg_Frozen,
    chg_AddOnly
};

enum Sequence_Message_Type
{
    //This is saved out to the file so only add new entries at the end
    sequence_message_synchronous = 1000,
    sequence_message_asynchronous,
    sequence_message_creation
};

enum DBIndex_Type
{
    None  =  1100,
    Primary,
    Index,
    Unique
};

/**
 * Constants used for indexing the roles of associations.
 */
enum Role_Type { A, B };

/**
 * Direction of operation parameters:
 *   in = operation uses the parameter as an input value
 *   out = operation fills the parameter as a return value
 *   inout = operation both reads and writes the parameter
 * The numeric values of this enum are not currently saved to file.
 */
enum Parameter_Direction { pd_In, pd_InOut, pd_Out };

/**
 * Supported programming languages
 */
enum Programming_Language {
    pl_ActionScript,
    pl_Ada,
    pl_Cpp,
    pl_CSharp,
    pl_D,
    pl_IDL,
    pl_Java,
    pl_JavaScript,
    pl_Pascal,
    pl_Perl,
    pl_PHP,
    pl_PHP5,
    pl_Python,
    pl_Ruby,
    pl_SQL,
    pl_Tcl,
    pl_XMLSchema,
    pl_Reserved
};

/**
 * The data type used for unique IDs.
 */
typedef std::string IDType;
/**
 * Reserved value for uninitialized/illegal ID.
 */
const IDType id_None = "-1";
const IDType id_Reserved = "0";

# define STR2ID(id)  id.ascii()
# define ID2STR(id)  TQString(id.c_str())

// KDE4 compatibility
# define kDebug   kdDebug
# define kWarning kdWarning
# define kError   kdError

/**
 * Function for comparing tags in XMI files.
 */
bool tagEq (const TQString& tag, const TQString& pattern);

}  // end namespace Uml

#endif