• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
codeclassfield.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) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
8  * copyright (C) 2004-2013 *
9  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10  ***************************************************************************/
11 
12 #ifndef CODECLASSFIELD_H
13 #define CODECLASSFIELD_H
14 
15 #include "codeaccessormethodlist.h"
16 #include "codeclassfielddeclarationblock.h"
17 #include "codeparameter.h"
18 #include "codeaccessormethod.h"
19 
20 class ClassifierCodeDocument;
21 class UMLAttribute;
22 class UMLObject;
23 class UMLRole;
24 
29 class CodeClassField : public CodeParameter
30 {
31  Q_OBJECT
32 public:
33 
34  enum ClassFieldType { Attribute, PlainAssociation, Self, Aggregation, Composition, Unknown_Assoc };
35 
36  CodeClassField (ClassifierCodeDocument * parentDoc, UMLAttribute * attrib);
37  CodeClassField (ClassifierCodeDocument * parentDoc, UMLRole * role);
38 
39  void finishInitialization();
40 
41  // CodeClassField (ClassifierCodeDocument * doc, UMLRole role);
42 
43  virtual ~CodeClassField ();
44 
45 // /**
46 // * Get the value of m_dialog
47 // * @return the value of m_dialog
48 // */
49 // CodeClassFieldDialog getDialog ();
50 
51  // Determine if this cf is attribute or some type of association
52  QString getTypeName ();
53 
54  CodeClassFieldDeclarationBlock * getDeclarationCodeBlock();
55 
56  CodeAccessorMethodList getMethodList() const;
57 
58  CodeAccessorMethod * findMethodByType(CodeAccessorMethod::AccessorType type, int role_id = -1);
59 
60  bool fieldIsSingleValue ();
61 
62  ClassFieldType getClassFieldType() const;
63 
64  // quick utility call to figure out if parent is an attribute or not
65  bool parentIsAttribute () const;
66 
67  // get the type of object that will be added/removed from lists
68  // of objects (as per specification of associations)
69  QString getListObjectType();
70 
71  bool getWriteOutMethods () const;
72 
73  void setWriteOutMethods(bool val);
74 
75  int minimumListOccurances();
76 
77  int maximumListOccurances();
78 
79  virtual void saveToXMI (QDomDocument & doc, QDomElement & root);
80 
81  virtual void loadFromXMI (QDomElement & root);
82 
83  virtual void synchronize ();
84 
85  void updateContent();
86 
87 protected:
88 
89  void setParentUMLObject (UMLObject * obj);
90 
91  // CodeClassFieldDialog * m_dialog;
92 
93  QString cleanName(const QString &name);
94 
95  QString fixInitialStringDeclValue(const QString& val, const QString &type);
96 
97  // set the list class name
98  void setListClassName (const QString &className);
99 
100  bool addMethod (CodeAccessorMethod * add);
101 
102  QString getUMLObjectName(UMLObject *obj);
103 
104  bool removeMethod (CodeAccessorMethod * remove);
105 
106 private:
107 
108  QString m_listClassName;
109  ClassFieldType m_classFieldType;
110  CodeClassFieldDeclarationBlock * m_declCodeBlock;
111  CodeAccessorMethodList m_methodVector; // the list of methods related to this codeclassfield
112  bool m_parentIsAttribute;
113 
119  bool m_writeOutMethods;
120 
121  virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & blockElement);
122 
123  virtual void setAttributesFromNode (QDomElement & element);
124 
125  void initFields(bool inConstructor = false);
126 
127  // initialize the accessor methods for this field
128  void initAccessorMethods();
129 
130 signals:
131 
132  void modified ();
133 
134 };
135 
136 #endif // CODECLASSFIELD_H
CodeClassField
class CodeClassField a special type of parameter.
Definition: codeclassfield.h:29
CodeClassField::Unknown_Assoc
Definition: codeclassfield.h:34
codeaccessormethod.h
CodeClassField::Attribute
Definition: codeclassfield.h:34
ClassifierCodeDocument
class ClassifierCodeDocument A CodeDocument which represents a UMLClassifier (e.g.
Definition: classifiercodedocument.h:33
codeaccessormethodlist.h
CodeClassField::modified
void modified()
CodeAccessorMethod::AccessorType
AccessorType
Definition: codeaccessormethod.h:32
CodeClassField::CodeClassField
CodeClassField(ClassifierCodeDocument *parentDoc, UMLAttribute *attrib)
Constructor.
Definition: codeclassfield.cpp:42
CodeClassField::addMethod
bool addMethod(CodeAccessorMethod *add)
Add a Method object to the m_methodVector List.
Definition: codeclassfield.cpp:156
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
CodeClassField::Composition
Definition: codeclassfield.h:34
CodeClassField::updateContent
void updateContent()
Updates the status of the accessor methods as to whether or not they should be written out...
Definition: codeclassfield.cpp:506
CodeClassField::Self
Definition: codeclassfield.h:34
CodeClassFieldDeclarationBlock
Used to declare classifier fields (e.g.
Definition: codeclassfielddeclarationblock.h:29
CodeClassField::getClassFieldType
ClassFieldType getClassFieldType() const
Get the type of classfield this is.
Definition: codeclassfield.cpp:135
CodeClassField::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeclassfield.cpp:310
CodeClassField::minimumListOccurances
int minimumListOccurances()
Find the minimum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:325
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
CodeClassField::findMethodByType
CodeAccessorMethod * findMethodByType(CodeAccessorMethod::AccessorType type, int role_id=-1)
Utility method to allow finding particular accessor method of this code class field by its type ident...
Definition: codeclassfield.cpp:414
codeparameter.h
CodeClassField::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeclassfield.cpp:228
CodeClassField::PlainAssociation
Definition: codeclassfield.h:34
CodeClassField::ClassFieldType
ClassFieldType
Definition: codeclassfield.h:34
CodeClassField::~CodeClassField
virtual ~CodeClassField()
Empty Destructor.
Definition: codeclassfield.cpp:52
CodeClassField::parentIsAttribute
bool parentIsAttribute() const
Get the value of m_isAbstract.
Definition: codeclassfield.cpp:126
CodeParameter
class CodeParameter A parameter on some type of code.
Definition: codeparameter.h:25
CodeClassField::Aggregation
Definition: codeclassfield.h:34
CodeClassField::maximumListOccurances
int maximumListOccurances()
Find the maximum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:349
CodeClassField::setWriteOutMethods
void setWriteOutMethods(bool val)
Determine if we will allow methods to be viewable.
Definition: codeclassfield.cpp:210
CodeAccessorMethod
Definition: codeaccessormethod.h:20
CodeClassField::synchronize
virtual void synchronize()
Force the synchronization of the content (methods and declarations) of this class field...
Definition: codeclassfield.cpp:400
CodeClassField::setListClassName
void setListClassName(const QString &className)
CodeClassField::removeMethod
bool removeMethod(CodeAccessorMethod *remove)
Remove a Method object from m_methodVector List.
Definition: codeclassfield.cpp:177
CodeClassField::cleanName
QString cleanName(const QString &name)
A little utility method to make life easier for code document programmers.
Definition: codeclassfield.cpp:373
CodeClassField::fixInitialStringDeclValue
QString fixInitialStringDeclValue(const QString &val, const QString &type)
Another utility method to make life easier for code document programmers this one fixes the initial d...
Definition: codeclassfield.cpp:383
UMLRole
This class contains the non-graphic representation of an association role.
Definition: umlrole.h:24
CodeClassField::getDeclarationCodeBlock
CodeClassFieldDeclarationBlock * getDeclarationCodeBlock()
Return the declaration statement for this class field object.
Definition: codeclassfield.cpp:220
CodeClassField::getWriteOutMethods
bool getWriteOutMethods() const
Determine if we will allow methods to be viewable.
Definition: codeclassfield.cpp:200
CodeAccessorMethodList
QList< CodeAccessorMethod * > CodeAccessorMethodList
Definition: codeaccessormethodlist.h:17
codeclassfielddeclarationblock.h
CodeClassField::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition: codeclassfield.cpp:148
CodeClassField::setParentUMLObject
void setParentUMLObject(UMLObject *obj)
Set the parent UMLobject appropriately.
Definition: codeclassfield.cpp:74
CodeClassField::fieldIsSingleValue
bool fieldIsSingleValue()
Determine whether the parent object in this classfield indicates that it is a single variable or a Li...
Definition: codeclassfield.cpp:604
CodeClassField::getMethodList
CodeAccessorMethodList getMethodList() const
Get the list of Method objects held by m_methodVector.
Definition: codeclassfield.cpp:190
CodeClassField::getListObjectType
QString getListObjectType()
Definition: codeclassfield.cpp:112
CodeClassField::getTypeName
QString getTypeName()
Get the value of m_dialog.
Definition: codeclassfield.cpp:94
CodeClassField::finishInitialization
void finishInitialization()
Finish off initializations of the object.
Definition: codeclassfield.cpp:647
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal