• 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
codeaccessormethod.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 CODEACCESSORMETHOD_H
13 #define CODEACCESSORMETHOD_H
14 
15 #include "codemethodblock.h"
16 #include <QString>
17 
18 class CodeClassField;
19 
20 class CodeAccessorMethod : public CodeMethodBlock
21 {
22  friend class CodeClassField;
23  Q_OBJECT
24 public:
25 
26  // some types of accessor methods that are possible:
27  // "GET" is to retrieve single-valued (primative or Object) fields
28  // "SET" is to set single-valued (primative or Object) fields
29  // "ADD" is to add a value to a multiple-valued field of either primative or Object items
30  // "REMOVE" is to remove a value to a multiple-valued field of either primative or Object items
31  // "LIST" is to retrive the entire list of items in a multiple-valued field
32  enum AccessorType {GET=0, SET, ADD, REMOVE, LIST};
33 
34  explicit CodeAccessorMethod(CodeClassField * field);
35  virtual ~CodeAccessorMethod();
36 
37  CodeClassField * getParentClassField();
38 
39  AccessorType getType();
40 
41  void setType(AccessorType type);
42 
43  // virtual UMLObject * getParentObject();
44 
45  bool parentIsAttribute();
46 
47  virtual void updateContent() = 0;
48 
49  virtual void saveToXMI(QDomDocument & doc, QDomElement & root);
50  virtual void loadFromXMI(QDomElement & root);
51 
52  virtual void setAttributesFromObject(TextBlock * obj);
53 
54 protected:
55 
56  virtual void release();
57 
58  virtual void setAttributesOnNode(QDomDocument & doc, QDomElement & blockElement);
59 
60  virtual void setAttributesFromNode(QDomElement & element);
61 
62  virtual void updateMethodDeclaration() = 0;
63 
64  void forceRelease();
65 
66 private:
67 
68  CodeClassField * m_parentclassfield;
69  AccessorType m_accessorType;
70 
71  void initFields(CodeClassField * parentCF);
72 
73 };
74 
75 #endif // CODEACCESSORMETHOD_H
CodeAccessorMethod::setType
void setType(AccessorType type)
Set the type of accessor method this is.
Definition: codeaccessormethod.cpp:72
CodeClassField
class CodeClassField a special type of parameter.
Definition: codeclassfield.h:29
CodeAccessorMethod::REMOVE
Definition: codeaccessormethod.h:32
CodeAccessorMethod::updateMethodDeclaration
virtual void updateMethodDeclaration()=0
This is the method called from within syncToparent().
CodeAccessorMethod::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeaccessormethod.cpp:110
CodeAccessorMethod::getType
AccessorType getType()
Utility method to get the value of the parent object of the parent classifield.
Definition: codeaccessormethod.cpp:64
CodeAccessorMethod::getParentClassField
CodeClassField * getParentClassField()
Get the value of m_parentclassfield.
Definition: codeaccessormethod.cpp:40
CodeAccessorMethod::AccessorType
AccessorType
Definition: codeaccessormethod.h:32
CodeAccessorMethod::~CodeAccessorMethod
virtual ~CodeAccessorMethod()
Empty Destructor.
Definition: codeaccessormethod.cpp:32
CodeAccessorMethod::CodeAccessorMethod
CodeAccessorMethod(CodeClassField *field)
Constructors.
Definition: codeaccessormethod.cpp:23
CodeAccessorMethod::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Set the class attributes from a passed object.
Definition: codeaccessormethod.cpp:170
CodeAccessorMethod::SET
Definition: codeaccessormethod.h:32
CodeAccessorMethod::LIST
Definition: codeaccessormethod.h:32
CodeMethodBlock
class CodeMethodBlock A common type of "code block" that occurs in OO code.
Definition: codemethodblock.h:28
CodeAccessorMethod::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Set attributes of the node that represents this class in the XMI document.
Definition: codeaccessormethod.cpp:123
CodeAccessorMethod::release
virtual void release()
This type of textblock is special we DON'T release it when resetTextBlocks is called because we re-us...
Definition: codeaccessormethod.cpp:83
CodeAccessorMethod
Definition: codeaccessormethod.h:20
CodeAccessorMethod::ADD
Definition: codeaccessormethod.h:32
codemethodblock.h
CodeAccessorMethod::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Set the class attributes of this object from the passed element node.
Definition: codeaccessormethod.cpp:137
TextBlock
The fundemental unit of text within an output file containing code.
Definition: textblock.h:24
CodeAccessorMethod::forceRelease
void forceRelease()
A method so the parent code classfield can force code block to release.
Definition: codeaccessormethod.cpp:91
CodeAccessorMethod::GET
Definition: codeaccessormethod.h:32
CodeAccessorMethod::updateContent
virtual void updateContent()=0
This is the method called from within syncToparent() to update the body of the method.
CodeAccessorMethod::parentIsAttribute
bool parentIsAttribute()
Definition: codeaccessormethod.cpp:45
CodeAccessorMethod::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeaccessormethod.cpp:102
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