summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/parmpropdlg.h
blob: a30b5a6e902f5592141271587bedbe0f3b0904f3 (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
/***************************************************************************
 *                                                                         *
 *   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) 2002-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef PARMPROPDLG_H
#define PARMPROPDLG_H

#include <kdialogbase.h>
#include <kcombobox.h>
#include <tqgroupbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqradiobutton.h>
#include <tqlineedit.h>
#include <tqbuttongroup.h>
#include <tqmultilineedit.h>
#include <tqcombobox.h>
#include "../attribute.h"

class UMLDoc;

/**
 * Displays a dialog box that displays properties of a paramater.
 * You need to make sure that @ref UMLDoc is made to be the
 * parent.
 *
 * @short A properties dialog box for a parameter.
 * @author Paul Hensgen <phensgen@techie.com>
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
 */
class ParmPropDlg : public KDialogBase {
    Q_OBJECT
  
public:
    /**
     * Constructs a ParmPropDlg.
     *
     * @param parent    The parent of the dialog.
     * @param a The parameter to represent.
     */
    ParmPropDlg(TQWidget * parent, UMLDoc * doc, UMLAttribute * a);

    /**
     * Standard deconstructor.
     */
    ~ParmPropDlg();

    /**
     * Returns the documentation.
     *
     * @return  Returns the documentation.
     */
    TQString getDoc() {
        return m_pDoc -> text();
    }

    /**
     * Return the name of the parameter.
     *
     * @return  Return the name of the parameter.
     */
    TQString getName() {
        return m_pNameLE -> text();
    }

    /**
     * Return the initial value of the parameter.
     *
     * @return  Return the initial value of the parameter.
     */
    TQString getInitialValue() {
        return m_pInitialLE -> text();
    }

    /**
     * Return the type name of the parameter.
     *
     * @return Return the type name of the parameter.
     */
    TQString getTypeName() {
        return m_pTypeCB -> currentText();
    }

    /**
     * Return the kind of the parameter (in, out, or inout).
     *
     * @return  The Uml::Parameter_Direction corresponding to
     *          the selected "Kind" radiobutton.
     */
    Uml::Parameter_Direction getParmKind();

public slots:
    void slotOk();

protected:
    /**
    * Inserts @p type into the type-combobox as well as its completion object.
    */
    void insertType( const TQString& type, int index = -1 );

    /**
     * Inserts @p type into the stereotype-combobox as well as its completion object.
     */
    void insertStereotype( const TQString& type, int index = -1 );


private:
    TQGroupBox * m_pParmGB, * m_pDocGB;
    TQButtonGroup *m_pKind;
    TQRadioButton * m_pIn, * m_pOut, *m_pInOut;
    TQLabel * m_pTypeL, * m_pNameL, * m_pInitialL, * m_pStereoTypeL;
    KComboBox * m_pTypeCB, * m_pStereoTypeCB;
    TQLineEdit * m_pNameLE, * m_pInitialLE;
    TQMultiLineEdit * m_pDoc;
    UMLDoc * m_pUmldoc;
    UMLAttribute * m_pAtt;
};

#endif