summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codeparameter.h
blob: 2c08452470ced6a9fa32b5e7664fd7a466f2dc22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2004-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

/*  This code generated by:
 *      Author : thomas
 *      Date   : Fri Jun 20 2003
 */



#ifndef CODEPARAMETER_H
#define CODEPARAMETER_H


#include "umlnamespace.h"
#include "codecomment.h"

/**
  * class CodeParameter
  * A parameter on some type of code.
  */

class ClassifierCodeDocument;
class UMLObject;

class CodeParameter : public TQObject
{
    Q_OBJECT
  
public:

    // Constructors/Destructors
    //

    /**
     * Empty Constructor
     */
    CodeParameter ( ClassifierCodeDocument * doc, UMLObject * parentObj );

    /**
     * Empty Destructor
     */
    virtual ~CodeParameter ( );

    // Public attributes
    //

    // Public attribute accessor methods
    //

    /**
     * Get the parent Code Document
     */
    ClassifierCodeDocument * getParentDocument ( );

    /**
     * Get the parent UMLObject
     */
    UMLObject * getParentObject ( );

    /**
      * Utility method. Get the value of parent abstract value.
      * @return the value
      */
    bool getAbstract ( );

    /**
     * Utility method. Get the value of parent Static
     * Whether or not this is static.
     * @return the value
     */
    bool getStatic ( );

    /**
     * The name of this code parameter.
     * @return the value of parameter name
     */
    TQString getName ( ) const;

    /**
     * Get the value of m_typeName
     * the typeName of this parameters (e.g. boolean, int, etc or perhaps Class name of
     * an object)
     * @return the value of m_typeName
     */
    virtual TQString getTypeName ( );

    /**
     * Get the value of m_visibility
     * The visibility of this code parameter.
     * @return the value of m_visibility
     */
    Uml::Visibility getVisibility ( ) const;

    /**
     * Set the value of m_initialValue
     * The initial value of this code parameter
     * @param new_var the new value of m_initialValue
     */
    virtual void setInitialValue ( const TQString &new_var );

    /**
     * Get the value of m_initialValue
     * The initial value of this code parameter
     * @return the value of m_initialValue
     */
    virtual TQString getInitialValue ( );

    /**
     * Set a Comment
     */
    void setComment ( CodeComment * comment );

    /**
     * get any Comment object on this
     */
    CodeComment * getComment ( );

    // the id of this parameter is the same as the parent UMLObject id.
    TQString getID ();

protected:

    virtual void updateContent() = 0;

    /** set attributes of the node that represents this class
     * in the XMI document.
     */
    virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement);

    /** set the class attributes of this object from
     * the passed element node.
     */
    virtual void setAttributesFromNode ( TQDomElement & element);

private:

    ClassifierCodeDocument * m_parentDocument;
    UMLObject * m_parentObject;
    CodeComment * m_comment;

    // The initial value of this code parameter
    TQString m_initialValue;

    void initFields ( ClassifierCodeDocument * doc, UMLObject * obj);

public slots:

    void syncToParent ();

};

#endif // CODEPARAMETER_H