summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/statedialog.h
blob: 2897899cfee16e11930e8b99f5b859d22d94584e (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
/***************************************************************************
 *                                                                         *
 *   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 STATEDIALOG_H
#define STATEDIALOG_H

//kde class includes
#include <kdialogbase.h>

//local class includes
#include "umlwidgetcolorpage.h"
#include "activitypage.h"

//forward declarations
class UMLView;
class StateWidget;
class TQLabel;
class TQLineEdit;
class TQMultiLineEdit;
class TQGroupBox;
class TDEFontChooser;

/**
 *   Displays the properties for a @ref StateWidget
 *
 *   @author   Paul Hensgen
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 */

class StateDialog : public KDialogBase {
    Q_OBJECT
    

public:
    /**
     *   Constructor
     */
    StateDialog( UMLView * pView, StateWidget * pWidget );

    /**
     *   Returns whether changes were made.
     */
    bool getChangesMade() {
        return m_bChangesMade;
    }

protected:

    enum Page
    {
        GeneralPage = 0,
        Activity_Page,
        ColorPage,
        FontPage
    };

protected slots:

    /**
    *   Entered when OK button pressed.
    */
    void slotOk();

    /**
    *   Entered when Apply button pressed.
    */
    void slotApply();
protected:
    /**
    *   Sets up the pages of the dialog.
    */
    void setupPages();

    /**
    *   Sets up the general page of the dialog.
    */
    void setupGeneralPage();

    /**
    *   Sets up the color page.
    */
    void setupColorPage();

    /**
    *   Sets up the font selection page.
    */
    void setupFontPage();

    /**
    *   Sets up the activity page.
    */
    void setupActivityPage();

    /**
    *     Applys changes to the given page.
    */
    void applyPage( Page page );

    /**
    *   Font chooser widget for font page.
    */
    TDEFontChooser * m_pChooser;

    /**
    *   Color page
    */
    UMLWidgetColorPage * m_pColorPage;

    /**
    *   Activity page.
    */
    ActivityPage * m_pActivityPage;

    /**
    *   The widget to represent.
    */
    StateWidget * m_pStateWidget;

    /**
    *   The diagram the widget is on.
    */
    UMLView * m_pView;

    /**
    *   Holds whether changes in the dialog have been made.
    */
    bool m_bChangesMade;

    struct GeneralPageWidgets {
        TQLabel * nameL, * typeL;
        TQLineEdit * nameLE, * typeLE;
        TQMultiLineEdit * docMLE;

        TQGroupBox * docGB, * generalGB;
    }
    m_GenPageWidgets;
};

#endif