umbrello 2.38.4
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
UMLDoc Class Reference

#include <umldoc.h>

Inheritance diagram for UMLDoc:
Collaboration diagram for UMLDoc:

Classes

class  Private
 

Public Slots

void slotRemoveUMLObject (UMLObject *o)
 
void slotAutoSave ()
 
void slotDiagramPopupMenu (QWidget *umlview, const QPoint &point)
 

Signals

void sigDiagramCreated (Uml::ID::Type id)
 
void sigDiagramRemoved (Uml::ID::Type id)
 
void sigDiagramRenamed (Uml::ID::Type t)
 
void sigDiagramChanged (Uml::DiagramType::Enum)
 
void sigObjectCreated (UMLObject *)
 
void sigObjectRemoved (UMLObject *)
 
void sigResetStatusbarProgress ()
 
void sigSetStatusbarProgressSteps (int totalSteps)
 
void sigSetStatusbarProgress (int stepPosition)
 
void sigWriteToStatusBar (const QString &text)
 
void sigCurrentViewChanged ()
 

Public Member Functions

 UMLDoc ()
 
 ~UMLDoc ()
 
void init ()
 
void addView (UMLView *view)
 
void removeView (UMLView *view, bool enforceOneView=true)
 
void setMainViewID (Uml::ID::Type viewID)
 
void changeCurrentView (Uml::ID::Type id)
 
void activateAllViews ()
 
void removeAllViews ()
 
void removeAllObjects ()
 
void setModified (bool modified=true)
 
bool isModified () const
 
bool saveModified ()
 
bool newDocument ()
 
void closeDocument ()
 
bool openDocument (const QUrl &url, const char *format=0)
 
bool saveDocument (const QUrl &url, const char *format=0)
 
const QUrl & url () const
 
void setUrl (const QUrl &url)
 
void setUrlUntitled ()
 
void setupSignals ()
 
bool isUnique (const QString &name) const
 
bool isUnique (const QString &name, UMLPackage *package) const
 
UMLAssociationcreateUMLAssociation (UMLObject *a, UMLObject *b, Uml::AssociationType::Enum type)
 
void addAssociation (UMLAssociation *assoc)
 
void removeAssociation (UMLAssociation *assoc, bool doSetModified=true)
 
UMLAssociationfindAssociation (Uml::AssociationType::Enum assocType, const UMLObject *roleAObj, const UMLObject *roleBObj, bool *swap=0) const
 
QString createDiagramName (Uml::DiagramType::Enum type, bool askForName=true)
 
UMLViewcreateDiagram (UMLFolder *folder, Uml::DiagramType::Enum type, const QString &name, Uml::ID::Type id=Uml::ID::None)
 
void removeDiagram (Uml::ID::Type id)
 
void removeDiagramCmd (Uml::ID::Type id)
 
void renameDiagram (Uml::ID::Type id)
 
void removeUMLObject (UMLObject *umlobject, bool deleteObject=false)
 
void renameUMLObject (UMLObject *o)
 
void renameChildUMLObject (UMLObject *o)
 
UMLObjectfindObjectById (Uml::ID::Type id)
 
UMLObjectfindUMLObject (const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject, UMLObject *currentObj=0)
 
UMLObjectfindUMLObjectRaw (Uml::ModelType::Enum, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
 
UMLObjectfindUMLObjectRaw (UMLFolder *folder, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
 
UMLObjectfindUMLObjectRecursive (Uml::ModelType::Enum, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
 
UMLObjectfindUMLObjectRecursive (UMLFolder *folder, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
 
UMLClassifierfindUMLClassifier (const QString &name)
 
UMLViewfindView (Uml::ID::Type id) const
 
UMLViewfindView (Uml::DiagramType::Enum type, const QString &name, bool searchAllScopes=false) const
 
void setName (const QString &name)
 
QString name () const
 
void setResolution (qreal resolution)
 
qreal resolution () const
 
qreal dpiScale () const
 
Uml::ID::Type modelID () const
 
virtual void saveToXMI (QIODevice &file)
 
short encoding (QIODevice &file)
 
virtual bool loadFromXMI (QIODevice &file, short encode=ENC_UNKNOWN)
 
bool validateXMI1Header (QDomNode &headerNode)
 
bool loadUMLObjectsFromXMI (QDomElement &element)
 
void loadExtensionsFromXMI1 (QDomNode &node)
 
bool loadDiagramsFromXMI1 (QDomNode &node)
 
void signalDiagramRenamed (UMLView *view)
 
void signalUMLObjectCreated (UMLObject *o)
 
UMLClassifierList concepts (bool includeNested=true) const
 
UMLClassifierList classesAndInterfaces (bool includeNested=true) const
 
UMLEntityList entities (bool includeNested=true) const
 
UMLFolderdatatypeFolder () const
 
UMLClassifierList datatypes (bool includeInactive=false) const
 
UMLDatatypefindDatatype (QString name, bool includeInactive=false)
 
UMLAssociationList associations () const
 
UMLPackageList packages (bool includeNested=true, Uml::ModelType::Enum model=Uml::ModelType::Logical) const
 
void print (QPrinter *pPrinter, DiagramPrintPage *selectPage)
 
UMLViewList viewIterator () const
 
UMLViewList views (Uml::DiagramType::Enum type=Uml::DiagramType::Undefined) const
 
bool assignNewIDs (UMLObject *obj)
 
bool addUMLObject (UMLObject *object)
 
bool addUMLView (UMLView *pView)
 
UMLFolderrootFolder (Uml::ModelType::Enum mt) const
 
Uml::ModelType::Enum rootFolderType (UMLObject *obj) const
 
UMLFoldercurrentRoot () const
 
void setCurrentRoot (Uml::ModelType::Enum rootType)
 
virtual IDChangeLogchangeLog () const
 
void beginPaste ()
 
void endPaste ()
 
Uml::ID::Type assignNewID (Uml::ID::Type oldID)
 
void setDocumentation (const QString &doc)
 
QString documentation () const
 
void settingsChanged (Settings::OptionState &optionState)
 
QString uniqueViewName (const Uml::DiagramType::Enum type) const
 
bool loading () const
 
void setLoading (bool state=true)
 
bool importing () const
 
void setImporting (bool state=true)
 
bool closing () const
 
void addDefaultDatatypes ()
 
UMLDatatypecreateDatatype (const QString &name)
 
void removeDatatype (const QString &name)
 
UMLStereotypecreateStereotype (const QString &name)
 
UMLStereotypefindStereotype (const QString &name) const
 
UMLStereotypefindOrCreateStereotype (const QString &name)
 
UMLStereotypefindStereotypeById (Uml::ID::Type id) const
 
void addStereotype (UMLStereotype *s)
 
void removeStereotype (UMLStereotype *s)
 
void addDefaultStereotypes ()
 
const UMLStereotypeListstereotypes () const
 
void writeToStatusBar (const QString &text)
 
void resolveTypes ()
 
bool loadDiagrams1 ()
 
void addDiagramToLoad (UMLFolder *folder, QDomNode node)
 
DiagramsModeldiagramsModel () const
 
StereotypesModelstereotypesModel () const
 
ObjectsModelobjectsModel () const
 
void setLoadingError (const QString &text)
 

Static Public Member Functions

static bool tagEq (const QString &tag, const QString &pattern)
 

Private Types

typedef QMap< UMLFolder *, QList< QDomNode > > DiagramsMap
 

Private Member Functions

void initSaveTimer ()
 
void createDatatypeFolder ()
 

Private Attributes

Privatem_d
 
UMLFolderm_root [Uml::ModelType::N_MODELTYPES]
 
UMLFolderm_datatypeRoot
 
UMLStereotypeList m_stereoList
 
QString m_Name
 name of this model as stored in the <UML:Model> tag
 
Uml::ID::Type m_modelID
 xmi.id of this model in the <UML:Model>
 
int m_count
 auxiliary counter for the progress bar
 
bool m_modified
 
QUrl m_doc_url
 
IDChangeLogm_pChangeLog
 
bool m_bLoading
 
bool m_importing
 
QString m_Doc
 
QTimer * m_pAutoSaveTimer
 
Uml::ID::Type m_nViewID
 
bool m_bTypesAreResolved
 
UMLFolderm_pCurrentRoot
 
bool m_bClosing
 
DiagramsModelm_diagramsModel
 
ObjectsModelm_objectsModel
 
StereotypesModelm_stereotypesModel
 
qreal m_resolution
 
DiagramsMap m_diagramsToLoad
 

Detailed Description

UMLDoc provides a document object for a document-view model.

The UMLDoc class provides a document object that can be used in conjunction with the classes UMLApp and UMLView to create a document-view model for standard KDE applications based on KApplication and KMainWindow. Thereby, the document object is created by the UMLApp instance and contains the document structure with the according methods for manipulation of the document data by UMLView objects. Also, UMLDoc contains the methods for serialization of the document data from and to files.

Author
Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

Member Typedef Documentation

◆ DiagramsMap

typedef QMap<UMLFolder*, QList<QDomNode> > UMLDoc::DiagramsMap
private

Holds diagram xml nodes on loading

Constructor & Destructor Documentation

◆ UMLDoc()

UMLDoc::UMLDoc ( )

Constructor for the fileclass of the application.

◆ ~UMLDoc()

UMLDoc::~UMLDoc ( )

Destructor for the fileclass of the application.

Here is the call graph for this function:

Member Function Documentation

◆ activateAllViews()

void UMLDoc::activateAllViews ( )

Activate all the diagrams/views after loading so all their widgets keep their IDs.

Here is the call graph for this function:

◆ addAssociation()

void UMLDoc::addAssociation ( UMLAssociation assoc)

Adds an association.

Parameters
assocPointer to the UMLAssociation to add.
Here is the call graph for this function:

◆ addDefaultDatatypes()

void UMLDoc::addDefaultDatatypes ( )

Calls the active code generator to create its default datatypes.

Here is the call graph for this function:

◆ addDefaultStereotypes()

void UMLDoc::addDefaultStereotypes ( )

Add a stereotype if it doesn't already exist. Used by code generators, operations and attribute dialog.

Here is the call graph for this function:

◆ addDiagramToLoad()

void UMLDoc::addDiagramToLoad ( UMLFolder folder,
QDomNode  node 
)

Add a xml node containing a diagram to the list of diagrams to load. Helper function for loadDiagrams().

Parameters
folderpointer to UMFolder instance the diagrams belongs to
nodexml document node containing the diagram

◆ addStereotype()

void UMLDoc::addStereotype ( UMLStereotype s)

Add a UMLStereotype to the application.

Parameters
sthe stereotype to be added
Here is the call graph for this function:

◆ addUMLObject()

bool UMLDoc::addUMLObject ( UMLObject object)

Adds a UMLObject that is already created but doesn't change any ids or signal. Use AddUMLObjectPaste if pasting.

Parameters
objectThe object to add.
Returns
True if the object was actually added.
Here is the call graph for this function:

◆ addUMLView()

bool UMLDoc::addUMLView ( UMLView pView)

Adds an already created UMLView to the document, it gets assigned a new ID, if its name is already in use then the function appends a number to it to differentiate it from the others; this number is incremental so if number 1 is in use then it tries 2 and then 3 and so on

Parameters
pViewPointer to the UMLView to add.
Returns
True if operation successful.
Here is the call graph for this function:

◆ addView()

void UMLDoc::addView ( UMLView view)

Adds a view to the document which represents the document contents. Usually this is your main view.

Parameters
viewPointer to the UMLView to add.
Here is the call graph for this function:

◆ assignNewID()

Uml::ID::Type UMLDoc::assignNewID ( Uml::ID::Type  oldID)

Assigns a New ID to an Object, and also logs the assignment to its internal ChangeLog.

Parameters
oldIDThe present ID of the object.
Returns
The new ID assigned to the object.
Here is the call graph for this function:

◆ assignNewIDs()

bool UMLDoc::assignNewIDs ( UMLObject obj)

Assigns an already created UMLObject a new ID. If the object is a classifier then the operations/attributes are also assigned new IDs.

Parameters
objPointer to the UMLObject to add.
Returns
True if operation successful.
Here is the call graph for this function:

◆ associations()

UMLAssociationList UMLDoc::associations ( ) const

Returns a list of the associations in this UMLDoc.

Returns
List of UML associations.
Here is the call graph for this function:

◆ beginPaste()

void UMLDoc::beginPaste ( )

Opens a Paste session, deletes the old ChangeLog and creates an empty one.

◆ changeCurrentView()

void UMLDoc::changeCurrentView ( Uml::ID::Type  id)

Changes the current view (diagram) to the view with the given ID.

Parameters
idThe ID of the view to change to.
Here is the call graph for this function:

◆ changeLog()

IDChangeLog * UMLDoc::changeLog ( ) const
virtual

Read property of IDChangeLog* m_pChangeLog.

Returns
Pointer to the IDChangeLog object.

◆ classesAndInterfaces()

UMLClassifierList UMLDoc::classesAndInterfaces ( bool  includeNested = true) const

Returns a list of the classes, interfaces, and enumerations in this UMLDoc.

Parameters
includeNestedWhether to include the concepts from nested packages (default: true.)
Returns
List of UML concepts.
Here is the call graph for this function:

◆ closeDocument()

void UMLDoc::closeDocument ( )

Closes the current document.

Here is the call graph for this function:

◆ closing()

bool UMLDoc::closing ( ) const

Returns the m_bClosing flag.

Returns
the value of the flag

◆ concepts()

UMLClassifierList UMLDoc::concepts ( bool  includeNested = true) const

Returns a list of the concepts in this UMLDoc.

Parameters
includeNestedWhether to include the concepts from nested packages (default: true.)
Returns
List of UML concepts.
Here is the call graph for this function:

◆ createDatatype()

UMLDatatype * UMLDoc::createDatatype ( const QString &  name)

Add a datatype if it doesn't already exist. Used by addDefaultDatatypes().

Here is the call graph for this function:

◆ createDatatypeFolder()

void UMLDoc::createDatatypeFolder ( )
private

Create the datatype folder and add it to the logical folder.

Here is the call graph for this function:

◆ createDiagram()

UMLView * UMLDoc::createDiagram ( UMLFolder folder,
Uml::DiagramType::Enum  type,
const QString &  name,
Uml::ID::Type  id = Uml::ID::None 
)

Creates a diagram of the given type.

Parameters
folderthe folder in which tp create the diagram.
typethe type of diagram to create
namethe name for the diagram to create
idoptional ID of new diagram
Returns
pointer to the UMLView of the new diagram
Here is the call graph for this function:

◆ createDiagramName()

QString UMLDoc::createDiagramName ( Uml::DiagramType::Enum  type,
bool  askForName = true 
)

Creates the name of the given diagram type.

Parameters
typeThe type of diagram to create.
askForNameIf true shows a dialog box asking for name, else uses a default name.
Returns
name of the new diagram
Here is the call graph for this function:

◆ createStereotype()

UMLStereotype * UMLDoc::createStereotype ( const QString &  name)

Creates a stereotype for the parent object.

Parameters
namethe name of the stereotype
Here is the call graph for this function:

◆ createUMLAssociation()

UMLAssociation * UMLDoc::createUMLAssociation ( UMLObject a,
UMLObject b,
Uml::AssociationType::Enum  type 
)

Creates AND adds an association between two UMLObjects. Used by refactoring assistant. NOTE: this method does not check if the association is valid / legal

Parameters
aThe UMLObject "A" for the association (source)
bThe UMLObject "B" for the association (destination)
typeThe association's type
Returns
The Association created
Here is the call graph for this function:

◆ currentRoot()

UMLFolder * UMLDoc::currentRoot ( ) const

Return the currently selected root folder. This will be an element from the m_root[] array.

Returns
the currently selected root folder or NULL
Here is the call graph for this function:

◆ datatypeFolder()

UMLFolder * UMLDoc::datatypeFolder ( ) const

Returns the datatype folder.

Returns
Pointer to the predefined folder for datatypes.

◆ datatypes()

UMLClassifierList UMLDoc::datatypes ( bool  includeInactive = false) const

Returns a list of the datatypes in this UMLDoc.

Parameters
includeInactiveInclude inactive datatypes which may have accrued by changing the active programming language.
Returns
List of datatypes.
Here is the call graph for this function:

◆ diagramsModel()

DiagramsModel * UMLDoc::diagramsModel ( ) const

◆ documentation()

QString UMLDoc::documentation ( ) const

Returns the documentation for the project.

Returns
The documentation text of this UMLDoc.

◆ dpiScale()

qreal UMLDoc::dpiScale ( ) const

Returns scale factor for recalculation of document coordinates.

Returns
scale factor
Here is the call graph for this function:

◆ encoding()

short UMLDoc::encoding ( QIODevice &  file)

If the given XMI file has a processing instruction then extract the encoding info from the processing instruction. If that info is unrecognized then return ENC_OLD_ENC, else return the encoding found. If the file does not have a processing instruction then give a warning but return ENC_UNICODE. This is an optimistic assumption in the interest of best effort loading. The value ENC_UNKNOWN is only returned in case of a grave error.

Parameters
fileThe file to be checked.

◆ endPaste()

void UMLDoc::endPaste ( )

Closes a paste session, deletes the ChangeLog.

◆ entities()

UMLEntityList UMLDoc::entities ( bool  includeNested = true) const

Returns a list of the entities in this UMLDoc.

Parameters
includeNestedWhether to include the entities from nested packages (default: true.)
Returns
List of UML Entities.
Here is the call graph for this function:

◆ findAssociation()

UMLAssociation * UMLDoc::findAssociation ( Uml::AssociationType::Enum  assocType,
const UMLObject roleAObj,
const UMLObject roleBObj,
bool *  swap = 0 
) const

Finds an association.

Parameters
assocTypeType of the UMLAssociation to seek.
roleAObjPointer to the role A UMLCanvasObject.
roleBObjPointer to the role B UMLCanvasObject.
swapOptional pointer to boolean. The bool is set to true if the association matched with swapped roles, else it is set to false.
Returns
Pointer to the UMLAssociation found or NULL if not found.
Here is the call graph for this function:

◆ findDatatype()

UMLDatatype * UMLDoc::findDatatype ( QString  name,
bool  includeInactive = false 
)

Seek the datatype of the given name in the Datatypes folder.

Parameters
nameName of the datatype
includeInactiveInclude inactive datatypes in the search.
Returns
List of datatypes.
Here is the call graph for this function:

◆ findObjectById()

UMLObject * UMLDoc::findObjectById ( Uml::ID::Type  id)

Used to find a reference to a UMLObject by its ID.

Parameters
idThe UMLObject to find.
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findOrCreateStereotype()

UMLStereotype * UMLDoc::findOrCreateStereotype ( const QString &  name)

Finds or creates a stereotype for the parent object.

Parameters
namethe name of the stereotype
Returns
the found stereotype object or a just created one
Here is the call graph for this function:

◆ findStereotype()

UMLStereotype * UMLDoc::findStereotype ( const QString &  name) const

Finds a UMLStereotype by its name.

Parameters
nameThe name of the UMLStereotype to find.
Returns
Pointer to the UMLStereotype found, or NULL if not found.
Here is the call graph for this function:

◆ findStereotypeById()

UMLStereotype * UMLDoc::findStereotypeById ( Uml::ID::Type  id) const

Find a UMLStereotype by its unique ID.

Parameters
idthe unique ID
Returns
the found stereotype or NULL
Here is the call graph for this function:

◆ findUMLClassifier()

UMLClassifier * UMLDoc::findUMLClassifier ( const QString &  name)

Used to find a UMLClassifier by its name.

Parameters
nameThe name of the UMLObject to find.
Here is the call graph for this function:

◆ findUMLObject()

UMLObject * UMLDoc::findUMLObject ( const QString &  name,
UMLObject::ObjectType  type = UMLObject::ot_UMLObject,
UMLObject currentObj = 0 
)

Used to find a UMLObject by its type and name.

Parameters
nameThe name of the UMLObject to find.
typeObjectType of the object to find (optional.) When the given type is ot_UMLObject the type is disregarded, i.e. the given name is the only search criterion.
currentObjObject relative to which to search (optional.) If given then the enclosing scope(s) of this object are searched before the global scope.
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findUMLObjectRaw() [1/2]

UMLObject * UMLDoc::findUMLObjectRaw ( Uml::ModelType::Enum  modelType,
const QString &  name,
UMLObject::ObjectType  type = UMLObject::ot_UMLObject 
)

Used to find a UMLObject by its type and raw name.

Parameters
modelTypeThe model type in which to search for the object
nameThe raw name of the UMLObject to find.
typeObjectType of the object to find
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findUMLObjectRaw() [2/2]

UMLObject * UMLDoc::findUMLObjectRaw ( UMLFolder folder,
const QString &  name,
UMLObject::ObjectType  type = UMLObject::ot_UMLObject 
)

Used to find a UMLObject by its type and raw name.

Parameters
folderThe UMLFolder in which to search for the object
nameThe raw name of the UMLObject to find.
typeObjectType of the object to find
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findUMLObjectRecursive() [1/2]

UMLObject * UMLDoc::findUMLObjectRecursive ( Uml::ModelType::Enum  modelType,
const QString &  name,
UMLObject::ObjectType  type = UMLObject::ot_UMLObject 
)

Used to find a UMLObject by its type and raw name recursively

Parameters
modelTypeThe model type in which to search for the object
nameThe raw name of the UMLObject to find.
typeObjectType of the object to find
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findUMLObjectRecursive() [2/2]

UMLObject * UMLDoc::findUMLObjectRecursive ( UMLFolder folder,
const QString &  name,
UMLObject::ObjectType  type = UMLObject::ot_UMLObject 
)

Used to find a UMLObject by its type and raw name recursively

Parameters
folderThe UMLFolder in which to search for the object
nameThe raw name of the UMLObject to find.
typeObjectType of the object to find
Returns
Pointer to the UMLObject found, or NULL if not found.
Here is the call graph for this function:

◆ findView() [1/2]

UMLView * UMLDoc::findView ( Uml::DiagramType::Enum  type,
const QString &  name,
bool  searchAllScopes = false 
) const

Finds a view (diagram) by the type and name given.

Parameters
typeThe type of view to find.
nameThe name of the view to find.
searchAllScopesSearch in all subfolders (default: false.)
Returns
Pointer to the view found, or NULL if not found.
Here is the call graph for this function:

◆ findView() [2/2]

UMLView * UMLDoc::findView ( Uml::ID::Type  id) const

Finds a view (diagram) by the ID given to method.

Parameters
idThe ID of the view to search for.
Returns
Pointer to the view found, or NULL if not found.
Here is the call graph for this function:

◆ importing()

bool UMLDoc::importing ( ) const

Returns true when importing file(s).

Returns
the value of the flag

◆ init()

void UMLDoc::init ( )

Initialize the UMLDoc. To be called after the constructor, before anything else.

Here is the call graph for this function:

◆ initSaveTimer()

void UMLDoc::initSaveTimer ( )
private

Sets up the autosave timer.

Here is the call graph for this function:

◆ isModified()

bool UMLDoc::isModified ( ) const

Returns if the document is modified or not. Use this to determine if your document needs saving by the user on closing.

Returns
True if this UMLDoc is modified.

◆ isUnique() [1/2]

bool UMLDoc::isUnique ( const QString &  name) const

Returns true if the given name is unique within its scope.

Parameters
nameThe name to check.
Returns
True if name is unique.
Here is the call graph for this function:

◆ isUnique() [2/2]

bool UMLDoc::isUnique ( const QString &  name,
UMLPackage package 
) const

Returns true if the given name is unique within its scope of given package.

Parameters
nameThe name to check.
packageThe UMLPackage in which we have to determine the unique-ness
Returns
True if name is unique.
Here is the call graph for this function:

◆ loadDiagrams1()

bool UMLDoc::loadDiagrams1 ( )

Load all diagrams collected from the xmi file.

Loading diagrams is implemented as additional pass to avoid unresolved uml objects which are defined later in the xmi file.

Here is the call graph for this function:

◆ loadDiagramsFromXMI1()

bool UMLDoc::loadDiagramsFromXMI1 ( QDomNode &  node)

Loads all diagrams from XMI into the current UMLDoc. For backward compatibility only: Since version 1.5.5 diagrams are saved as part of the UMLFolder.

Returns
True if operation successful.
Here is the call graph for this function:

◆ loadExtensionsFromXMI1()

void UMLDoc::loadExtensionsFromXMI1 ( QDomNode &  node)

Loads umbrello specific extensions from XMI to the UMLDoc. The extension tags are: "docsettings", "diagrams", "listview", and "codegeneration".

Here is the call graph for this function:

◆ loadFromXMI()

bool UMLDoc::loadFromXMI ( QIODevice &  file,
short  encode = ENC_UNKNOWN 
)
virtual

Load a given XMI model from a file. If the encoding of the file is already known it can be passed to the function. If this info isn't given, loadFromXMI will check which encoding was used.

Parameters
fileThe file to be loaded.
encodeThe encoding used.
Here is the call graph for this function:

◆ loading()

bool UMLDoc::loading ( ) const

Returns true when loading a document file.

Returns
the value of the flag

◆ loadUMLObjectsFromXMI()

bool UMLDoc::loadUMLObjectsFromXMI ( QDomElement &  element)

Loads all UML objects from XMI into the current UMLDoc.

Returns
True if operation successful.
Here is the call graph for this function:

◆ modelID()

Uml::ID::Type UMLDoc::modelID ( ) const

Return the m_modelID (currently this a fixed value: Umbrello supports only a single document.)

◆ name()

QString UMLDoc::name ( ) const

Return the name of this model.

◆ newDocument()

bool UMLDoc::newDocument ( )

Initializes the document generally.

Returns
True if operation successful.
Here is the call graph for this function:

◆ objectsModel()

ObjectsModel * UMLDoc::objectsModel ( ) const

◆ openDocument()

bool UMLDoc::openDocument ( const QUrl &  url,
const char *  format = 0 
)

Loads the document by filename and format and emits the updateViews() signal.

Parameters
urlThe filename in KUrl format.
formatThe format (optional.)
Returns
True if operation successful.
Here is the call graph for this function:

◆ packages()

UMLPackageList UMLDoc::packages ( bool  includeNested = true,
Uml::ModelType::Enum  model = Uml::ModelType::Logical 
) const

Returns a list of the packages in this UMLDoc,

Returns
List of UMLPackages.
Here is the call graph for this function:

◆ print()

void UMLDoc::print ( QPrinter *  pPrinter,
DiagramPrintPage selectPage 
)

Controls the printing of the program.

Parameters
pPrinterThe printer (object) to use.
selectPageThe DiagramPrintPage by which diagrams are selected for printing
Here is the call graph for this function:

◆ removeAllObjects()

void UMLDoc::removeAllObjects ( )

Call to remove all objects in the current file.

Here is the call graph for this function:

◆ removeAllViews()

void UMLDoc::removeAllViews ( )

Call to remove all the views (diagrams) in the current file.

Here is the call graph for this function:

◆ removeAssociation()

void UMLDoc::removeAssociation ( UMLAssociation assoc,
bool  doSetModified = true 
)

Removes an association.

Parameters
assocPointer to the UMLAssociation to remove.
doSetModifiedWhether to mark the document as modified (default: true.)
Here is the call graph for this function:

◆ removeDatatype()

void UMLDoc::removeDatatype ( const QString &  name)

Remove a datatype by name. Used when changing the active programming language.

Here is the call graph for this function:

◆ removeDiagram()

void UMLDoc::removeDiagram ( Uml::ID::Type  id)

Deletes a diagram from the current file.

Undo command

Parameters
idThe ID of the diagram to delete.
Here is the call graph for this function:

◆ removeDiagramCmd()

void UMLDoc::removeDiagramCmd ( Uml::ID::Type  id)

Deletes a diagram from the current file.

Parameters
idThe ID of the diagram to delete.
Here is the call graph for this function:

◆ removeStereotype()

void UMLDoc::removeStereotype ( UMLStereotype s)

Remove a UMLStereotype from the application.

Parameters
sthe stereotype to be removed
Here is the call graph for this function:

◆ removeUMLObject()

void UMLDoc::removeUMLObject ( UMLObject umlobject,
bool  deleteObject = false 
)

Removes an UMLObject from the current file. If this object is being represented on a diagram it will also delete all those representations.

Parameters
umlobjectPointer to the UMLObject to delete.
deleteObjectDelete the UMLObject instance.
Here is the call graph for this function:

◆ removeView()

void UMLDoc::removeView ( UMLView view,
bool  enforceCurrentView = true 
)

Removes a view from the list of currently connected views.

Parameters
viewPointer to the UMLView to remove.
enforceCurrentViewSwitch to determine if we have a current view or not. Most of the time, we DO want this, except when exiting the program.
Here is the call graph for this function:

◆ renameChildUMLObject()

void UMLDoc::renameChildUMLObject ( UMLObject o)

Used to rename an operation or attribute of a concept.

Parameters
oThe attribute or operation to rename.
Here is the call graph for this function:

◆ renameDiagram()

void UMLDoc::renameDiagram ( Uml::ID::Type  id)

Used to rename a document. This method takes care of everything. You just need to give the ID of the diagram to the method.

Parameters
idThe ID of the diagram to rename.
Here is the call graph for this function:

◆ renameUMLObject()

void UMLDoc::renameUMLObject ( UMLObject o)

Used to rename a UMLObject. The UMLObject is to be an actor, use case or concept.

Parameters
oThe object to rename.
Here is the call graph for this function:

◆ resolution()

qreal UMLDoc::resolution ( ) const

Returns coordinates resolution for current document.

Returns
document resolution in DPI

◆ resolveTypes()

void UMLDoc::resolveTypes ( )

Type resolution pass.

Here is the call graph for this function:

◆ rootFolder()

UMLFolder * UMLDoc::rootFolder ( Uml::ModelType::Enum  mt) const

Return the predefined root folder of the given type.

◆ rootFolderType()

Uml::ModelType::Enum UMLDoc::rootFolderType ( UMLObject obj) const

Return the corresponding Model_Type if the given object is one of the root folders. When the given object is not one of the root folders then return Uml::ModelType::N_MODELTYPES.

Here is the call graph for this function:

◆ saveDocument()

bool UMLDoc::saveDocument ( const QUrl &  url,
const char *  format = 0 
)

Saves the document using the given filename and format.

Parameters
urlThe filename in KUrl format.
formatThe format (optional.)
Returns
True if operation successful.
Todo:
insert some checks in saveToXMI to detect a failed save attempt
Here is the call graph for this function:

◆ saveModified()

bool UMLDoc::saveModified ( )

"save modified" - Asks the user for saving if the document is modified.

Returns
True if document can be closed.
Here is the call graph for this function:

◆ saveToXMI()

void UMLDoc::saveToXMI ( QIODevice &  file)
virtual

This method is called for saving the given model as a XMI file. It is virtual and calls the corresponding saveToXMI() functions of the derived classes.

Parameters
fileThe file to be saved to.
Here is the call graph for this function:

◆ setCurrentRoot()

void UMLDoc::setCurrentRoot ( Uml::ModelType::Enum  rootType)

Set the current root folder.

Parameters
rootTypeThe type of the root folder to set. The element from m_root[] which is indexed by this type is selected.

◆ setDocumentation()

void UMLDoc::setDocumentation ( const QString &  doc)

Sets the documentation for the project.

Parameters
docThe documentation to set for this UMLDoc.

◆ setImporting()

void UMLDoc::setImporting ( bool  state = true)

Sets importing boolean flag to the value given.

Parameters
statevalue to set

◆ setLoading()

void UMLDoc::setLoading ( bool  state = true)

Sets loading boolean flag to the value given.

Parameters
statevalue to set

◆ setLoadingError()

void UMLDoc::setLoadingError ( const QString &  text)

◆ setMainViewID()

void UMLDoc::setMainViewID ( Uml::ID::Type  viewID)

Sets m_nViewID.

◆ setModified()

void UMLDoc::setModified ( bool  modified = true)

Sets the modified flag for the document after a modifying action on the view connected to the document.

Parameters
modifiedThe value to set the modified flag to.
Here is the call graph for this function:

◆ setName()

void UMLDoc::setName ( const QString &  name)

Set the name of this model.

Here is the call graph for this function:

◆ setResolution()

void UMLDoc::setResolution ( qreal  resolution)

Set coordinates resolution for current document.

Parameters
resolutiondocument resolution in DPI
Here is the call graph for this function:

◆ settingsChanged()

void UMLDoc::settingsChanged ( Settings::OptionState optionState)

Sets the default settings to the given settings.

Parameters
optionStatesettings
Here is the call graph for this function:

◆ setupSignals()

void UMLDoc::setupSignals ( )

Sets up the signals needed by the program for it to work.

Here is the call graph for this function:

◆ setUrl()

void UMLDoc::setUrl ( const QUrl &  url)

Sets the URL of the document.

Parameters
urlThe KUrl to set.
Here is the call graph for this function:

◆ setUrlUntitled()

void UMLDoc::setUrlUntitled ( )

Sets the URL of the document to "Untitled".

◆ sigCurrentViewChanged

void UMLDoc::sigCurrentViewChanged ( )
signal

The diagram being displayed has changed. UMLApp uses this to keep its menu items state up to date.

◆ sigDiagramChanged

void UMLDoc::sigDiagramChanged ( Uml::DiagramType::Enum  )
signal

◆ sigDiagramCreated

void UMLDoc::sigDiagramCreated ( Uml::ID::Type  id)
signal

◆ sigDiagramRemoved

void UMLDoc::sigDiagramRemoved ( Uml::ID::Type  id)
signal

◆ sigDiagramRenamed

void UMLDoc::sigDiagramRenamed ( Uml::ID::Type  t)
signal

◆ signalDiagramRenamed()

void UMLDoc::signalDiagramRenamed ( UMLView view)

Signal a view/diagram has been renamed.

Here is the call graph for this function:

◆ signalUMLObjectCreated()

void UMLDoc::signalUMLObjectCreated ( UMLObject o)

Signal that a UMLObject has been created.

Parameters
oThe object that has been created.
Here is the call graph for this function:

◆ sigObjectCreated

void UMLDoc::sigObjectCreated ( UMLObject )
signal

◆ sigObjectRemoved

void UMLDoc::sigObjectRemoved ( UMLObject )
signal

◆ sigResetStatusbarProgress

void UMLDoc::sigResetStatusbarProgress ( )
signal

Reset the status bar.

◆ sigSetStatusbarProgress

void UMLDoc::sigSetStatusbarProgress ( int  stepPosition)
signal

Set the progress position of the progressbar.

Parameters
stepPositionThe step position to set.

◆ sigSetStatusbarProgressSteps

void UMLDoc::sigSetStatusbarProgressSteps ( int  totalSteps)
signal

Set the total range of the progressbar.

Parameters
totalStepsTotal range of the progressbar (0..totalSteps)

◆ sigWriteToStatusBar

void UMLDoc::sigWriteToStatusBar ( const QString &  text)
signal

Write text to the status bar.

◆ slotAutoSave

void UMLDoc::slotAutoSave ( )
slot

Called after a specified time to autosave the document.

Here is the call graph for this function:

◆ slotDiagramPopupMenu

void UMLDoc::slotDiagramPopupMenu ( QWidget *  umlview,
const QPoint &  point 
)
slot

Make a popup menu for the tabs signalled from tabWidget's contextMenu().

Here is the call graph for this function:

◆ slotRemoveUMLObject

void UMLDoc::slotRemoveUMLObject ( UMLObject object)
slot

Simple removal of an object.

Parameters
objectthe UMLObject to be removed
Here is the call graph for this function:

◆ stereotypes()

const UMLStereotypeList & UMLDoc::stereotypes ( ) const

Returns a list of the stereotypes in this UMLDoc.

Returns
List of UML stereotypes.

◆ stereotypesModel()

StereotypesModel * UMLDoc::stereotypesModel ( ) const

◆ tagEq()

bool UMLDoc::tagEq ( const QString &  inTag,
const QString &  inPattern 
)
static

Function for comparing tags in XMI files.

◆ uniqueViewName()

QString UMLDoc::uniqueViewName ( const Uml::DiagramType::Enum  type) const

Returns a name for the new object, appended with a number if the default name is taken e.g. class diagram, class diagram_1 etc.

Parameters
typethe diagram type
Returns
the unique view name
Here is the call graph for this function:

◆ url()

const QUrl & UMLDoc::url ( ) const

Returns the KUrl of the document.

Returns
The KUrl of this UMLDoc.

◆ validateXMI1Header()

bool UMLDoc::validateXMI1Header ( QDomNode &  headerNode)

Ensures the XMI file is a valid UML file. Currently only checks for metamodel=UML.

Parameters
headerNodeThe <XMI.header> node

◆ viewIterator()

UMLViewList UMLDoc::viewIterator ( ) const

Return the list of views for this document.

Returns
List of UML views.
Here is the call graph for this function:

◆ views()

Return a list of filtered views of this document by type.

Parameters
typediagram type to filter
Returns
List of UML views.
Here is the call graph for this function:

◆ writeToStatusBar()

void UMLDoc::writeToStatusBar ( const QString &  text)

Write text to the status bar.

Parameters
textthe text to write
Here is the call graph for this function:

Member Data Documentation

◆ m_bClosing

bool UMLDoc::m_bClosing
private

True while closeDocument() is executing.

◆ m_bLoading

bool UMLDoc::m_bLoading
private

true if the we're loading a new document

◆ m_bTypesAreResolved

bool UMLDoc::m_bTypesAreResolved
private

True when type resolution pass has been executed.

◆ m_count

int UMLDoc::m_count
private

auxiliary counter for the progress bar

◆ m_d

Private* UMLDoc::m_d
private

◆ m_datatypeRoot

UMLFolder* UMLDoc::m_datatypeRoot
private

Predefined root folder for datatypes, contained in m_root[Uml::mt_Logical]

◆ m_diagramsModel

DiagramsModel* UMLDoc::m_diagramsModel
private

◆ m_diagramsToLoad

DiagramsMap UMLDoc::m_diagramsToLoad
private

◆ m_Doc

QString UMLDoc::m_Doc
private

Documentation for the project.

◆ m_doc_url

QUrl UMLDoc::m_doc_url
private

◆ m_importing

bool UMLDoc::m_importing
private

true if the we're importing

◆ m_modelID

Uml::ID::Type UMLDoc::m_modelID
private

xmi.id of this model in the <UML:Model>

◆ m_modified

bool UMLDoc::m_modified
private

◆ m_Name

QString UMLDoc::m_Name
private

name of this model as stored in the <UML:Model> tag

◆ m_nViewID

Uml::ID::Type UMLDoc::m_nViewID
private

Auxiliary to <docsettings> processing

◆ m_objectsModel

ObjectsModel* UMLDoc::m_objectsModel
private

◆ m_pAutoSaveTimer

QTimer* UMLDoc::m_pAutoSaveTimer
private

Used for autosave

◆ m_pChangeLog

IDChangeLog* UMLDoc::m_pChangeLog
private

Contains all the UMLObject id changes of paste session.

◆ m_pCurrentRoot

UMLFolder* UMLDoc::m_pCurrentRoot
private

Auxiliary variable for currentRoot(): m_pCurrentRoot is only used if UMLApp::app()->currentView() returns 0.

◆ m_resolution

qreal UMLDoc::m_resolution
private

Holds widgets coordinates resolution. Unit is dpi.

◆ m_root

UMLFolder* UMLDoc::m_root[Uml::ModelType::N_MODELTYPES]
private

Array of predefined root folders.

◆ m_stereoList

UMLStereotypeList UMLDoc::m_stereoList
private

The UMLDoc is the sole owner of all stereotypes. UMLStereotype instances are reference counted. When a UMLStereotype is no longer referenced anywhere, its refcount drops to zero. It is then removed from the m_stereoList and it is physically deleted.

◆ m_stereotypesModel

StereotypesModel* UMLDoc::m_stereotypesModel
private

The documentation for this class was generated from the following files: