summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/classpropdlg.h
blob: 3eeafe2b1e983556b30420cccc5dcff24df499e5 (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
/***************************************************************************
 *                                                                         *
 *   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) 2003-2007                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef CLASSPROPDLG_H
#define CLASSPROPDLG_H

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

#include "../umlnamespace.h"

class ClassGenPage;
class ClassifierListPage;
class ClassOpsPage;
class ClassTemplatePage;
class PkgContentsPage;
class AssocPage;
class ClassOptionsPage;
class UMLWidgetColorPage;

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

/**
 * @author Paul Hensgen <phensgen@techie.com>
 * @version 1.0
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
 */
class ClassPropDlg : public KDialogBase {
    Q_OBJECT
  
public:
    /**
     *  Sets up a ClassPropDlg.
     *
     *  @param  parent  The parent of the ClassPropDlg
     *  @param  c       The UMLObject to display properties of.
     *  @param  pageNum The page to show first.
     *  @param assoc    Determines whether to display associations
     */
    ClassPropDlg(TQWidget *parent, UMLObject *c, int pageNum = 0, bool assoc = false);

    /**
     *  Sets up a ClassPropDlg.
     *
     *  @param  parent  The parent of the ClassPropDlg
     *  @param  o       The ObjectWidget to display properties of.
     */
    ClassPropDlg(TQWidget *parent, ObjectWidget * o);

    /**
     *  Sets up a ClassPropDlg.
     *
     *  @param  parent  The parent of the ClassPropDlg
     *  @param  o       The UMLWidget to display properties of.
     */
    ClassPropDlg(TQWidget *parent, UMLWidget * o);


    /**
     *  Standard deconstructor
     */
    ~ClassPropDlg();

    enum Page{page_gen = 0, page_att, page_op, page_template,
              page_assoc, page_options, page_color, page_font};

protected slots:
    /**
     * Calls slotApply() and accepts (closes) the dialog
     */
    void slotOk();

    /**
     * Applies the settings in the dialog to the widget and object
     */
    void slotApply();

protected:
    /**
     * Sets up the general, attribute, operations, template and association pages as appropriate
     */
    void setupPages(UMLObject * c, bool assoc = false);

    /**
     * Sets up the general page for the component
     */
    void setupInstancePages(UMLWidget* widget);

    /**
     * Sets up the font page
     */
    void setupFontPage();
private:
    TDEFontChooser * m_pChooser;
    ClassGenPage * m_pGenPage;
    ClassifierListPage* m_pAttPage;
    ClassifierListPage* m_pOpsPage;
    ClassifierListPage* m_pTemplatePage;
    ClassifierListPage* m_pEnumLiteralPage;
    ClassifierListPage* m_pEntityAttributePage;
    PkgContentsPage * m_pPkgContentsPage;
    AssocPage * m_pAssocPage;
    ClassOptionsPage * m_pOptionsPage;
    UMLWidgetColorPage * m_pColorPage;
    UMLDoc *m_pDoc;

    UMLObject *m_pObject;
    UMLWidget * m_pWidget;

    enum Page_Type{  pt_Object = 1,    //Show General page + Assoc. page if Class i.e. no colours page
                     pt_ObjectWidget,  //Shows pages needed for an ObjectWidget
                     pt_Widget         //Shows pages needed for any other widget
                  };
    Page_Type m_Type;
};

#endif