umbrello/umbrello
Classes | |
struct | NameAndType |
struct | OpDescriptor |
Typedefs | |
typedef QLinkedList< NameAndType > | NameAndType_List |
typedef QLinkedList < NameAndType >::iterator | NameAndType_ListIt |
Enumerations | |
enum | Parse_Status { PS_OK, PS_Empty, PS_Malformed_Arg, PS_Unknown_ArgType, PS_Illegal_MethodName, PS_Unknown_ReturnType, PS_Unspecified_Error } |
Detailed Description
General purpose model utilities.
Typedef Documentation
typedef QLinkedList<NameAndType> Model_Utils::NameAndType_List |
Auxiliary type for OpDescriptor.
Definition at line 109 of file model_utils.h.
typedef QLinkedList<NameAndType>::iterator Model_Utils::NameAndType_ListIt |
Auxiliary type for OpDescriptor.
Definition at line 110 of file model_utils.h.
Enumeration Type Documentation
Enumerator | |
---|---|
PS_OK |
Return type of parseOperation(). |
PS_Empty | |
PS_Malformed_Arg | |
PS_Unknown_ArgType | |
PS_Illegal_MethodName | |
PS_Unknown_ReturnType | |
PS_Unspecified_Error |
Definition at line 91 of file model_utils.h.
Function Documentation
UMLListViewItem::ListViewType Model_Utils::convert_DT_LVT | ( | Uml::DiagramType::Enum | dt | ) |
Convert a diagram type enum to the equivalent list view type.
Definition at line 1129 of file model_utils.cpp.
Uml::ModelType::Enum Model_Utils::convert_DT_MT | ( | Uml::DiagramType::Enum | dt | ) |
Return the Model_Type which corresponds to the given DiagramType.
Definition at line 1037 of file model_utils.cpp.
Uml::DiagramType::Enum Model_Utils::convert_LVT_DT | ( | UMLListViewItem::ListViewType | lvt | ) |
Return the DiagramType which corresponds to the given listview type.
- Parameters
-
lvt ListViewType to convert.
- Returns
- The Uml::DiagramType corresponding to the lvt. Returns dt_Undefined in case no mapping to DiagramType exists.
Definition at line 1562 of file model_utils.cpp.
Icon_Utils::IconType Model_Utils::convert_LVT_IT | ( | UMLListViewItem::ListViewType | lvt | ) |
Return the IconType which corresponds to the given listview type.
- Parameters
-
lvt ListViewType to convert.
- Returns
- The Icon_Utils::IconType corresponding to the lvt. Returns it_Home in case no mapping to IconType exists.
Definition at line 1428 of file model_utils.cpp.
Uml::ModelType::Enum Model_Utils::convert_LVT_MT | ( | UMLListViewItem::ListViewType | lvt | ) |
Return the Model_Type which corresponds to the given ListViewType.
Returns Uml::N_MODELTYPES if the list view type given does not map to a Model_Type.
Definition at line 1101 of file model_utils.cpp.
UMLObject::ObjectType Model_Utils::convert_LVT_OT | ( | UMLListViewItem::ListViewType | lvt | ) |
Converts a list view type enum to the equivalent object type.
- Parameters
-
lvt The ListViewType to convert.
- Returns
- The converted ObjectType if the listview type has a UMLObject::ObjectType representation, else 0.
Definition at line 1324 of file model_utils.cpp.
UMLListViewItem::ListViewType Model_Utils::convert_MT_LVT | ( | Uml::ModelType::Enum | mt | ) |
Return the ListViewType which corresponds to the given Model_Type.
Definition at line 1071 of file model_utils.cpp.
UMLListViewItem::ListViewType Model_Utils::convert_OT_LVT | ( | UMLObject * | o | ) |
Convert an object's type to the equivalent list view type.
- Parameters
-
o Pointer to the UMLObject whose type shall be converted to the equivalent ListViewType. We cannot just pass in a UMLObject::ObjectType because a UMLFolder is mapped to different ListViewType values, depending on its location in one of the predefined modelviews (Logical/ UseCase/etc.)
- Returns
- The equivalent ListViewType.
Definition at line 1186 of file model_utils.cpp.
Uml::ModelType::Enum Model_Utils::convert_OT_MT | ( | UMLObject::ObjectType | ot | ) |
Return the Model_Type which corresponds to the given ObjectType.
Definition at line 1602 of file model_utils.cpp.
UMLObject * Model_Utils::findObjectInList | ( | Uml::ID::Type | id, |
const UMLObjectList & | inList | ||
) |
Seek the given id in the given list of objects.
Each list element may itself contain other objects and the search is done recursively.
- Parameters
-
id The unique ID to seek. inList The UMLObjectList in which to search.
- Returns
- Pointer to the UMLObject that matches the ID (NULL if none matches).
Definition at line 80 of file model_utils.cpp.
UMLObject * Model_Utils::findUMLObject | ( | const UMLObjectList & | inList, |
const QString & | inName, | ||
UMLObject::ObjectType | type, | ||
UMLObject * | currentObj | ||
) |
Find the UML object of the given type and name in the passed-in list.
- Parameters
-
inList List in which to seek the object. name Name of the object to find. type ObjectType 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. currentObj Object 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.
Definition at line 139 of file model_utils.cpp.
UMLObject * Model_Utils::findUMLObjectRaw | ( | const UMLObjectList & | inList, |
const QString & | name, | ||
UMLObject::ObjectType | type, | ||
UMLObject * | currentObj | ||
) |
Find the UML object of the given type and name in the passed-in list.
This methods search for the raw name.
- Parameters
-
inList List in which to seek the object. name Name of the object to find. type ObjectType 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. currentObj Object 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.
Definition at line 290 of file model_utils.cpp.
Uml::ModelType::Enum Model_Utils::guessContainer | ( | UMLObject * | o | ) |
Try to guess the correct container folder type of an UMLObject.
Object types that can't be guessed are mapped to Uml::ModelType::Logical. NOTE: This function exists mainly for handling pre-1.5.5 files and should not be used for new code.
Definition at line 572 of file model_utils.cpp.
bool Model_Utils::isClassifierListitem | ( | UMLObject::ObjectType | type | ) |
Return true if the given object type is a classifier list item type.
Definition at line 550 of file model_utils.cpp.
bool Model_Utils::isCloneable | ( | WidgetBase::WidgetType | type | ) |
Determines whether the given widget type is cloneable.
- Parameters
-
type The input WidgetType.
- Returns
- True if the given type is cloneable.
Definition at line 52 of file model_utils.cpp.
bool Model_Utils::isCommonDataType | ( | QString | type | ) |
Return true if the given type is common among the majority of programming languages, such as "bool" or "boolean".
TODO: Make this depend on the active programming language.
Definition at line 528 of file model_utils.cpp.
bool Model_Utils::isCommonXMIAttribute | ( | const QString & | tag | ) |
Return true if the given tag is a one of the common XMI attributes, such as: "name" | "visibility" | "isRoot" | "isLeaf" | "isAbstract" | "isActive" | "ownerScope".
Definition at line 503 of file model_utils.cpp.
Parse_Status Model_Utils::parseAttribute | ( | QString | a, |
NameAndType & | nmTp, | ||
UMLClassifier * | owningScope, | ||
Uml::Visibility::Enum * | vis | ||
) |
Parses an attribute given in UML syntax.
- Parameters
-
a Input text of the attribute in UML syntax. Example: argname : argtype nmTp NameAndType returned by this method. owningScope Pointer to the owning scope of the attribute. vis Optional pointer to visibility (return value.) The visibility may be given at the beginning of the attribute text in mnemonic form as follows: "+" stands for public "#" stands for protected "-" stands for private "~" stands for implementation level visibility
- Returns
- Error status of the parse, PS_OK for success.
Definition at line 718 of file model_utils.cpp.
Parse_Status Model_Utils::parseConstraint | ( | QString | m, |
QString & | name, | ||
UMLEntity * | owningScope | ||
) |
Parses a constraint.
- Parameters
-
m Input text of the constraint name The name returned by this method owningScope Pointer to the owning scope of the constraint
- Returns
- Error status of the parse, PS_OK for success.
Definition at line 863 of file model_utils.cpp.
Parse_Status Model_Utils::parseOperation | ( | QString | m, |
OpDescriptor & | desc, | ||
UMLClassifier * | owningScope | ||
) |
Parses an operation given in UML syntax.
- Parameters
-
m Input text of the operation in UML syntax. Example of a two-argument operation returning "void": methodname (arg1name : arg1type, arg2name : arg2type) : void desc OpDescriptor returned by this method. owningScope Pointer to the owning scope of the operation.
- Returns
- Error status of the parse, PS_OK for success.
The search pattern includes everything up to the opening parenthesis because UML also permits non programming-language oriented designs using narrative names, for example "check water temperature".
Definition at line 793 of file model_utils.cpp.
Parse_Status Model_Utils::parseTemplate | ( | QString | t, |
NameAndType & | nmTp, | ||
UMLClassifier * | owningScope | ||
) |
Parses a template parameter given in UML syntax.
- Parameters
-
t Input text of the template parameter. Example: parname : partype or just: parname (for class type) nmTp NameAndType returned by this method. owningScope Pointer to the owning scope of the template param.
- Returns
- Error status of the parse, PS_OK for success.
Definition at line 678 of file model_utils.cpp.
QString Model_Utils::psText | ( | Parse_Status | value | ) |
Returns the Parse_Status as a text.
Definition at line 883 of file model_utils.cpp.
UMLPackage * Model_Utils::rootPackage | ( | UMLObject * | obj | ) |
Get the root folder of the given UMLObject.
Definition at line 307 of file model_utils.cpp.
int Model_Utils::stringToDirection | ( | QString | input, |
Uml::ParameterDirection::Enum & | result | ||
) |
Parse a direction string into the Uml::ParameterDirection::Enum.
- Parameters
-
input The string to parse: "in", "out", or "inout" optionally followed by whitespace. result The corresponding Uml::ParameterDirection::Enum.
- Returns
- Length of the string matched, excluding the optional whitespace.
Definition at line 649 of file model_utils.cpp.
void Model_Utils::treeViewAddViews | ( | const UMLViewList & | viewList | ) |
Add the given list of views to the tree view.
- Parameters
-
viewList the list of views to add
Definition at line 326 of file model_utils.cpp.
QString Model_Utils::treeViewBuildDiagramName | ( | Uml::ID::Type | id | ) |
Build the diagram name from the tree view.
- Parameters
-
id the id of the diaram
- Returns
- the constructed diagram name
Definition at line 415 of file model_utils.cpp.
void Model_Utils::treeViewChangeIcon | ( | UMLObject * | object, |
Icon_Utils::IconType | to | ||
) |
Change an icon of an object in the tree view.
- Parameters
-
object the object in the treeViewAddViews to the new icon type for the given object
Definition at line 342 of file model_utils.cpp.
UMLObject * Model_Utils::treeViewGetCurrentObject | ( | ) |
Return the current UMLObject from the tree view.
- Returns
- the UML object of the current item
Definition at line 377 of file model_utils.cpp.
UMLPackage * Model_Utils::treeViewGetPackageFromCurrent | ( | ) |
Return the UMLPackage if the current item in the tree view is a package.
Return the closest package in the tree view or NULL otherwise
- Returns
- the package or NULL
Definition at line 391 of file model_utils.cpp.
Move an object to a new container in the tree view.
- Parameters
-
container the new container for the object object the to be moved object
Definition at line 364 of file model_utils.cpp.
void Model_Utils::treeViewSetCurrentItem | ( | UMLObject * | object | ) |
Set the given object to the current item in the tree view.
- Parameters
-
object the object which will be the current item
Definition at line 352 of file model_utils.cpp.
bool Model_Utils::typeIsCanvasWidget | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type also has a widget representation in diagrams.
Definition at line 918 of file model_utils.cpp.
bool Model_Utils::typeIsClassifier | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type is a classifier (Class, Entity, Enum)
Definition at line 1003 of file model_utils.cpp.
bool Model_Utils::typeIsClassifierList | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type is an attribute, operation, or template.
Definition at line 983 of file model_utils.cpp.
bool Model_Utils::typeIsContainer | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type may act as a container for other objects, i.e.
if it is a folder, package, subsystem, or component.
Definition at line 969 of file model_utils.cpp.
bool Model_Utils::typeIsDiagram | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type is a diagram.
Definition at line 1017 of file model_utils.cpp.
bool Model_Utils::typeIsFolder | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type is a logical, usecase or component folder.
Definition at line 950 of file model_utils.cpp.
bool Model_Utils::typeIsRootView | ( | UMLListViewItem::ListViewType | type | ) |
Return true if the listview type is one of the predefined root views (root, logical, usecase, component, deployment, datatype, or entity- relationship view.)
Definition at line 898 of file model_utils.cpp.
QString Model_Utils::uniqObjectName | ( | UMLObject::ObjectType | type, |
UMLPackage * | parentPkg, | ||
QString | prefix | ||
) |
Returns a name for the new object, appended with a number if the default name is taken e.g.
new_actor, new_actor_1 etc.
- Parameters
-
type The object type. parentPkg The package in which to compare the name. prefix The prefix to use (optional) If no prefix is given then a type related prefix will be chosen internally.
Definition at line 452 of file model_utils.cpp.
QString Model_Utils::updateDeleteActionToString | ( | UMLForeignKeyConstraint::UpdateDeleteAction | uda | ) |
Converts from the UpdateDeleteAction enum to a QString.
- Parameters
-
uda The UpdateDeleteAction enum literal
Definition at line 1636 of file model_utils.cpp.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.