umbrello: umbrello/codeimport/import_utils.h Source File

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

import_utils.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) 2005-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef IMPORT_UTILS_H
12 #define IMPORT_UTILS_H
13
14 #include "basictypes.h"
15 #include "folder.h"
16 #include "umlattributelist.h"
17
18 #include <QStringList>
19
20 class UMLObject;
21 class UMLClassifier;
22 class UMLPackage;
23 class UMLOperation;
24 class UMLEnum;
25 class UMLScene;
26
27 class QMimeData;
28
34 namespace Import_Utils {
35
36 UMLFolder *createSubDir(const QString& name,
37 UMLFolder *parentPkg,
38 const QString &comment = QString());
39
40 UMLObject *createArtifactFolder(const QString& name,
41 UMLPackage *parentPkg,
42 const QString &comment);
43
44 UMLObject *createArtifact(const QString& name,
45 UMLFolder *parentPkg = NULL,
46 const QString &comment = QString());
47
48 UMLObject* createUMLObject(UMLObject::ObjectType type,
49 const QString& name,
50 UMLPackage *parentPkg = 0,
51 const QString& comment = QString(),
52 const QString& stereotype = QString(),
53 bool searchInParentPackageOnly = false,
54 bool remapParent = true);
55
56 UMLObject* createUMLObjectHierarchy(UMLObject::ObjectType type, const QString &name, UMLPackage *parentPkg);
57
58 void putAtGlobalScope(bool yesno);
59
60 void setRelatedClassifier(UMLClassifier *c);
61
62 void assignUniqueIdOnCreation(bool yesno);
63
64 UMLAttribute* insertAttribute(UMLClassifier *klass, Uml::Visibility::Enum scope,
65 const QString& name,
66 const QString& type,
67 const QString& comment = QString(),
68 bool isStatic = false);
69 UMLAttribute *insertAttribute(UMLClassifier *klass, Uml::Visibility::Enum scope,
70 const QString& name,
71 UMLClassifier *attrType,
72 const QString& comment /* =QString() */,
73 bool isStatic /* =false */);
74
75 UMLOperation* makeOperation(UMLClassifier *parent, const QString &name);
76
77 void insertMethod(UMLClassifier *klass, UMLOperation* &op,
78 Uml::Visibility::Enum scope, const QString& type,
79 bool isStatic, bool isAbstract,
80 bool isFriend = false, bool isConstructor = false, bool isDestructor = false,
81 const QString& comment = QString());
82
83 UMLAttribute* addMethodParameter(UMLOperation *method,
84 const QString& type,
85 const QString& name);
86
87 void addEnumLiteral(UMLEnum *enumType, const QString &literal,
88 const QString &comment = QString(),
89 const QString &value = QString());
90
91 UMLAssociation *createGeneralization(UMLClassifier *child, UMLClassifier *parent);
92 void createGeneralization(UMLClassifier *child, const QString &parentName);
93
94 UMLEnum *remapUMLEnum(UMLObject *ns, UMLPackage *currentScope);
95
96 QString formatComment(const QString &comment);
97
98 QStringList includePathList();
99
100 void addIncludePath(const QString& path);
101
102 bool newUMLObjectWasCreated();
103
104 bool isDatatype(const QString& name, UMLPackage *parentPkg = 0);
105
106 UMLPackage *globalScope();
107
108 } // end namespace Import_Utils
109
110 #endif
umlattributelist.h
datatype.h
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1308
template.h
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Definition: operation.cpp:276
Import_Utils::insertAttribute
UMLAttribute * insertAttribute(UMLClassifier *owner, Uml::Visibility::Enum scope, const QString &name, UMLClassifier *attrType, const QString &comment, bool isStatic)
Definition: import_utils.cpp:426
Uml::ProgrammingLanguage::scopeSeparator
QString scopeSeparator(Enum item)
Definition: basictypes.cpp:1110
UMLAttributeListIt
QListIterator< UMLAttribute * > UMLAttributeListIt
Definition: umlattributelist.h:20
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:80
UMLDoc::datatypeFolder
UMLFolder * datatypeFolder() const
Definition: umldoc.cpp:2981
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
UMLClassifier::isInterface
bool isInterface() const
Definition: classifier.cpp:118
UMLArtifact
Non-graphical information for a Artifact.
Definition: artifact.h:28
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
Import_Utils::createUMLObjectHierarchy
UMLObject * createUMLObjectHierarchy(UMLObject::ObjectType type, const QString &name, UMLPackage *topLevelParent)
Definition: import_utils.cpp:376
UMLDoc::findAssociation
UMLAssociation * findAssociation(Uml::AssociationType::Enum assocType, const UMLObject *roleAObj, const UMLObject *roleBObj, bool *swap=0)
Definition: umldoc.cpp:1427
Import_Utils::createArtifact
UMLObject * createArtifact(const QString &name, UMLFolder *parentPkg, const QString &comment)
Definition: import_utils.cpp:671
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
UMLObject::ot_Artifact
@ ot_Artifact
Definition: umlobject.h:97
UMLObject::ot_Association
@ ot_Association
Definition: umlobject.h:91
Import_Utils::newUMLObjectWasCreated
bool newUMLObjectWasCreated()
Definition: import_utils.cpp:113
UMLObject::setStatic
void setStatic(bool bStatic)
Definition: umlobject.cpp:374
UMLApp::activeLanguageScopeSeparator
QString activeLanguageScopeSeparator()
Definition: uml.cpp:2526
UMLObject::asUMLAttribute
UMLAttribute * asUMLAttribute()
Definition: umlobject.cpp:1304
UMLDatatype
Non-graphical information for a Datatype.
Definition: datatype.h:26
Uml::ProgrammingLanguage::Java
@ Java
Definition: basictypes.h:278
Object_Factory::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &n, UMLPackage *parentPkg, bool solicitNewName)
Definition: object_factory.cpp:203
UMLDoc::removeUMLObject
void removeUMLObject(UMLObject *umlobject, bool deleteObject=false)
Definition: umldoc.cpp:1881
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:40
UMLObject::ot_Class
@ ot_Class
Definition: umlobject.h:89
operation.h
UMLObject::setVisibilityCmd
void setVisibilityCmd(Uml::Visibility::Enum visibility)
Definition: umlobject.cpp:486
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
Import_Utils::createGeneralization
UMLAssociation * createGeneralization(UMLClassifier *child, UMLClassifier *parent)
Definition: import_utils.cpp:603
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Uml::ModelType::Logical
@ Logical
Definition: basictypes.h:42
Model_Utils::findUMLObject
UMLObject * findUMLObject(const UMLObjectList &inList, const QString &inName, UMLObject::ObjectType type, UMLObject *currentObj)
Definition: model_utils.cpp:152
UMLObject::ot_Attribute
@ ot_Attribute
Definition: umlobject.h:92
UMLDoc::rootFolder
UMLFolder * rootFolder(Uml::ModelType::Enum mt)
Definition: umldoc.cpp:3196
artifact.h
UMLObject::isUMLClassifier
bool isUMLClassifier()
Definition: umlobject.h:204
object_factory.h
UMLObject::ot_Interface
@ ot_Interface
Definition: umlobject.h:86
association.h
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:670
Import_Utils::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &inName, UMLPackage *parentPkg, const QString &comment, const QString &stereotype, bool searchInParentPackageOnly, bool remapParent)
Definition: import_utils.cpp:178
UMLObject::umlPackage
UMLPackage * umlPackage() const
Definition: umlobject.cpp:645
UMLObject::isStatic
bool isStatic() const
Definition: umlobject.cpp:366
UMLListViewItem::updateObject
void updateObject()
Definition: umllistviewitem.cpp:339
UMLClassifier::checkOperationSignature
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=0)
Definition: classifier.cpp:134
UMLPackage::containedObjects
UMLObjectList & containedObjects()
Definition: package.cpp:228
UMLObject::ot_Package
@ ot_Package
Definition: umlobject.h:85
UMLAttribute::setName
void setName(const QString &name)
Definition: attribute.cpp:76
Import_Utils::insertMethod
void insertMethod(UMLClassifier *klass, UMLOperation *&op, Uml::Visibility::Enum scope, const QString &type, bool isStatic, bool isAbstract, bool isFriend, bool isConstructor, bool isDestructor, const QString &comment)
Definition: import_utils.cpp:498
UMLObject::ot_UMLObject
@ ot_UMLObject
Definition: umlobject.h:82
Import_Utils::incPathList
QStringList incPathList
Definition: import_utils.cpp:74
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::isAbstract
bool isAbstract() const
Definition: umlobject.cpp:348
import_utils.h
UMLDoc::loading
bool loading() const
Definition: umldoc.cpp:1570
Import_Utils::createArtifactFolder
UMLObject * createArtifactFolder(const QString &name, UMLPackage *parentPkg, const QString &comment)
Definition: import_utils.cpp:649
UMLObject::asUMLEnum
UMLEnum * asUMLEnum()
Definition: umlobject.cpp:1315
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
Import_Utils::putAtGlobalScope
void putAtGlobalScope(bool yesno)
Definition: import_utils.cpp:83
UMLObject::asUMLDatatype
UMLDatatype * asUMLDatatype()
Definition: umlobject.cpp:1311
UMLObject::asUMLArtifact
UMLArtifact * asUMLArtifact()
Definition: umlobject.cpp:1302
UMLObject::asUMLFolder
UMLFolder * asUMLFolder()
Definition: umlobject.cpp:1317
UMLObject::setStereotypeCmd
void setStereotypeCmd(const QString &_name)
Definition: umlobject.cpp:534
UMLAttribute::getParmKind
Uml::ParameterDirection::Enum getParmKind() const
Definition: attribute.cpp:122
Import_Utils::remapUMLEnum
UMLEnum * remapUMLEnum(UMLObject *ns, UMLPackage *currentScope)
Definition: import_utils.cpp:738
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
Object_Factory::createAttribute
UMLAttribute * createAttribute(UMLObject *parent, const QString &name, UMLObject *type)
Definition: object_factory.cpp:275
UMLApp::listView
UMLListView * listView() const
Definition: uml.cpp:1065
a
QString a
Definition: petalnode.cpp:18
UMLClassifier::addOperation
bool addOperation(UMLOperation *op, int position=-1)
Definition: classifier.cpp:310
UMLDoc::addAssociation
void addAssociation(UMLAssociation *assoc)
Definition: umldoc.cpp:1479
Uml::ModelType::Component
@ Component
Definition: basictypes.h:44
Import_Utils::formatComment
QString formatComment(const QString &comment)
Definition: import_utils.cpp:121
UMLClassifier::setBaseType
void setBaseType(UMLObject::ObjectType ot)
Definition: classifier.cpp:83
folder.h
UMLPackage::removeObject
void removeObject(UMLObject *pObject)
Definition: package.cpp:190
Import_Utils::createSubDir
UMLFolder * createSubDir(const QString &name, UMLFolder *parentPkg, const QString &comment)
Definition: import_utils.cpp:626
UMLObject::ot_Datatype
@ ot_Datatype
Definition: umlobject.h:87
Import_Utils::globalScope
UMLPackage * globalScope()
Definition: import_utils.cpp:803
Model_Utils::treeViewSetCurrentItem
void treeViewSetCurrentItem(UMLObject *object)
Definition: model_utils.cpp:425
UMLDoc::findUMLObjectRaw
UMLObject * findUMLObjectRaw(Uml::ModelType::Enum, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
Definition: umldoc.cpp:1097
basictypes.h
Import_Utils::addMethodParameter
UMLAttribute * addMethodParameter(UMLOperation *method, const QString &type, const QString &name)
Definition: import_utils.cpp:572
Object_Factory::assignUniqueIdOnCreation
void assignUniqueIdOnCreation(bool yesno)
Definition: object_factory.cpp:69
Import_Utils::addIncludePath
void addIncludePath(const QString &path)
Definition: import_utils.cpp:784
UMLObject::setStereotype
void setStereotype(const QString &_name)
Definition: umlobject.cpp:527
Import_Utils::isDatatype
bool isDatatype(const QString &name, UMLPackage *parentPkg)
Definition: import_utils.cpp:793
UMLObject::toString
static QString toString(ObjectType ot)
Definition: umlobject.cpp:1124
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
Uml::AssociationType::Generalization
@ Generalization
Definition: basictypes.h:107
umllistview.h
UMLObject::setAbstract
void setAbstract(bool bAbstract)
Definition: umlobject.cpp:356
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
UMLPackage::findObject
UMLObject * findObject(const QString &name)
Definition: package.cpp:239
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
visibility
Definition: visibility.py:1
Import_Utils::makeOperation
UMLOperation * makeOperation(UMLClassifier *parent, const QString &name)
Definition: import_utils.cpp:416
UMLDoc
Definition: umldoc.h:75
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3127
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:35
Import_Utils::assignUniqueIdOnCreation
void assignUniqueIdOnCreation(bool yesno)
Definition: import_utils.cpp:104
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Definition: umlcanvasobject.cpp:238
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
UMLObject::setDoc
void setDoc(const QString &d)
Definition: umlobject.cpp:455
Import_Utils::addEnumLiteral
void addEnumLiteral(UMLEnum *enumType, const QString &literal, const QString &comment, const QString &value)
Definition: import_utils.cpp:593
UMLDoc::findUMLObject
UMLObject * findUMLObject(const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject, UMLObject *currentObj=0)
Definition: umldoc.cpp:1065
UMLPackage::addObject
bool addObject(UMLObject *pObject)
Definition: package.cpp:128
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
classifier.h
UMLDatatype::setIsReference
void setIsReference(bool isRef=true)
Definition: datatype.cpp:55
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:25
UMLObject::ot_Enum
@ ot_Enum
Definition: umlobject.h:88
uml.h
Object_Factory::createNewUMLObject
UMLObject * createNewUMLObject(UMLObject::ObjectType type, const QString &name, UMLPackage *parentPkg, bool undoable)
Definition: object_factory.cpp:95
UMLObject::setUMLPackage
bool setUMLPackage(UMLPackage *pPkg)
Definition: umlobject.cpp:615
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLAssociation
Sets up association information.
Definition: association.h:33
Object_Factory::createOperation
UMLOperation * createOperation(UMLClassifier *parent, const QString &name)
Definition: object_factory.cpp:285
Import_Utils::gRelatedClassifier
UMLClassifier * gRelatedClassifier
Definition: import_utils.cpp:59
UMLObject::isUMLDatatype
bool isUMLDatatype()
Definition: umlobject.h:206
Import_Utils::setRelatedClassifier
void setRelatedClassifier(UMLClassifier *c)
Definition: import_utils.cpp:92
UMLScene
Definition: umlscene.h:69
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:43
Import_Utils::bPutAtGlobalScope
bool bPutAtGlobalScope
Definition: import_utils.cpp:69
umlobject.h
UMLClassifier::findTemplate
UMLTemplate * findTemplate(const QString &name)
Definition: classifier.cpp:1119
UMLEnum::addEnumLiteral
UMLObject * addEnumLiteral(const QString &name, Uml::ID::Type id=Uml::ID::None, const QString &value=QString())
Definition: enum.cpp:132
UMLObject::asUMLPackage
UMLPackage * asUMLPackage()
Definition: umlobject.cpp:1324
PATH_SEPARATOR
#define PATH_SEPARATOR
Definition: import_utils.cpp:38
UMLListView::findUMLObject
UMLListViewItem * findUMLObject(const UMLObject *p) const
Definition: umllistview.cpp:1314
Import_Utils
Definition: import_utils.cpp:45
package.h
UMLOperation::setType
void setType(UMLObject *type)
Definition: operation.cpp:94
Uml::AssociationType::Dependency
@ Dependency
Definition: basictypes.h:109
UMLApp::activeLanguage
Uml::ProgrammingLanguage::Enum activeLanguage() const
Definition: uml.cpp:2509
UMLArtifact::file
@ file
Definition: artifact.h:37
Import_Utils::includePathList
QStringList includePathList()
Definition: import_utils.cpp:771
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Definition: umlobject.cpp:558
UMLObject::ot_Folder
@ ot_Folder
Definition: umlobject.h:103
Import_Utils::bNewUMLObjectWasCreated
bool bNewUMLObjectWasCreated
Definition: import_utils.cpp:53
UMLObject::isUMLPackage
bool isUMLPackage()
Definition: umlobject.h:219
UMLEnum
Non-graphical Information for an Enum.
Definition: enum.h:29
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
Uml::AssociationType::Realization
@ Realization
Definition: basictypes.h:118
umldoc.h
UMLDatatype::setOriginType
void setOriginType(UMLClassifier *origType)
Definition: datatype.cpp:37
UMLClassifier::addAttribute
UMLAttribute * addAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: classifier.cpp:810
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33
enum.h