summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/classgenpage.h
blob: ccddadbe7e393faad891690a2bc6671fd2eab45f (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
/***************************************************************************
 *                                                                         *
 *   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 CLASSGENPAGE_H
#define CLASSGENPAGE_H

#include <tqwidget.h>

class TQGroupBox;
class TQLabel;
class TQLineEdit;
class TQButtonGroup;
class TQMultiLineEdit;
class TQRadioButton;
class TQCheckBox;
class KComboBox;

class UMLObject;
class UMLWidget;
class ObjectWidget;
class UMLDoc;

/**
 * Displays properties of a UMLObject in a dialog box.  This is not usually directly
 * called.  The class @ref ClassPropDlg will set this up for you.
 *
 * @short Display properties on a UMLObject.
 * @author Paul Hensgen <phensgen@techie.com>
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 */
class ClassGenPage : public TQWidget {
    Q_OBJECT
  
public:

    /**
     *  Sets up the ClassGenPage.
     *
     *  @param  d       The UMLDoc which controls controls object creation.
     *  @param  parent  The parent to the ClassGenPage.
     *  @param  o       The UMLObject to display the properties of.
     */
    ClassGenPage(UMLDoc *d, TQWidget *parent, UMLObject * o);

    /**
     *  Sets up the ClassGenPage for an ObjectWidget
     *
     *  @param  d       The UMLDoc which controls controls object creation.
     *  @param  parent  The parent to the ClassGenPage.
     *  @param  o       The ObjectWidget to display the properties of.
     */
    ClassGenPage(UMLDoc *d, TQWidget *parent, ObjectWidget * o);

    /**
     *  Sets up the ClassGenPage for a UMLWidget instance (used
     *  for component instances on deployment diagrams)
     *
     *  @param  d       The UMLDoc which controls controls object creation.
     *  @param  parent  The parent to the ClassGenPage.
     *  @param  widget  The UMLWidget to display the properties of.
     */
    ClassGenPage(UMLDoc* d, TQWidget* parent, UMLWidget* widget);

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

    /**
     *  Will move information from the dialog into the object.
     *  Call when the ok or apply button is pressed.
     */
    void updateObject();
private:
    TQGroupBox *m_pDocGB;
    TQButtonGroup        * m_pButtonBG;
    TQLabel * m_pNameL, * m_pInstanceL, * m_pStereoTypeL, * m_pPackageL;
    TQLineEdit * m_pClassNameLE, *m_pInstanceLE, * m_pPackageLE;
    KComboBox * m_pStereoTypeCB;
    TQRadioButton *m_pPublicRB, *m_pPrivateRB, *m_pProtectedRB, *m_pImplementationRB;
    TQCheckBox * m_pMultiCB, * m_pDrawActorCB, * m_pAbstractCB, * m_pDeconCB;
    TQMultiLineEdit * m_pDoc;
    UMLObject * m_pObject;
    UMLDoc * m_pUmldoc;
    ObjectWidget * m_pWidget;
    UMLWidget* m_pInstanceWidget;
    TQButtonGroup* m_pDrawAsBG;
    TQRadioButton* m_pDefaultRB,* m_pFileRB,* m_pLibraryRB,* m_pTableRB;
    TQCheckBox* m_pExecutableCB;

    void insertStereotype(const TQString& type, int index = -1);

public slots:
    /**
     *  When the draw as actor check box is toggled, the draw
     *  as multi instance need to be enabled/disabled.  They
     *  both can't be available at the same time.
     */
    void slotActorToggled( bool state );
};

#endif