1 /*
2     SPDX-License-Identifier: GPL-2.0-or-later
3     SPDX-FileCopyrightText: 2002-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5 
6 
7 #ifndef CLASSOPTIONSPAGE_H
8 #define CLASSOPTIONSPAGE_H
9 
10 #include "optionstate.h"
11 
12 #include <QWidget>
13 
14 class ClassifierWidget;
15 class EntityWidget;
16 class UMLScene;
17 class KComboBox;
18 class QCheckBox;
19 class QGroupBox;
20 class QLabel;
21 
22 /**
23  * A dialog page to display options for class related options.
24  * This dialog is either embedded into @ref SettingsDialog,
25  * @ref UMLViewDialog and @ref ClassPropertiesDialog
26  *
27  * @short A dialog page to display the class related options.
28  * @author Paul Hensgen <phensgen@techie.com>
29  * @see ClassPropertiesDialog
30  * @see SettingsDialog
31  * @see UMLViewDialog
32  * Bugs and comments to umbrello-devel@kde.org or https://bugs.kde.org
33  */
34 class ClassOptionsPage : public QWidget
35 {
36 public:
37     ClassOptionsPage(QWidget* pParent, ClassifierWidget* pWidget);
38     ClassOptionsPage(QWidget* pParent, UMLScene *scene);
39     ClassOptionsPage(QWidget* pParent, Settings::OptionState *options, bool isDiagram=true);
40     ClassOptionsPage(QWidget* pParent, EntityWidget* widget);
41     virtual ~ClassOptionsPage();
42 
43     void setDefaults();
44     void apply();
45 
46     void setWidget(ClassifierWidget * pWidget);
47 
48 protected:
49     void init();
50 
51     void setupPage();
52     void setupPageFromScene();
53     void setupClassPageOption();
54     void setupPageFromEntityWidget();
55 
56     void applyWidget();
57     void applyOptionState();
58     void applyScene();
59     void applyEntityWidget();
60 
61     KComboBox * createShowStereotypeCB(QGroupBox * grpBox);
62     void insertAttribScope(const QString& type, int index = -1);
63     void insertOperationScope(const QString& type, int index = -1);
64 
65     //GUI widgets
66     QGroupBox * m_visibilityGB;
67     QCheckBox * m_showVisibilityCB, * m_showAttSigCB;
68     QCheckBox * m_showOpSigCB, * m_showAttsCB, * m_showOpsCB;
69     KComboBox * m_showStereotypeCB;
70     QCheckBox * m_showPackageCB, * m_showPublicOnlyCB;
71     QCheckBox * m_showAttribAssocsCB;
72     QCheckBox * m_showDocumentationCB;
73     QCheckBox * m_drawAsCircleCB;
74 
75     QGroupBox * m_scopeGB;
76     QLabel * m_attributeLabel;
77     QLabel * m_operationLabel;
78     KComboBox * m_attribScopeCB;
79     KComboBox * m_operationScopeCB;
80 
81     ClassifierWidget* m_pWidget; ///< The classifier widget to represent in the dialog page.
82     EntityWidget* m_entityWidget; ///< The entity widget to represent in the dialog page.
83     UMLScene* m_scene; ///< The scene to represent in the dialog page.
84     Settings::OptionState *m_options; ///< The OptionState structure to represent in the dialog page.
85     bool m_isDiagram; ///< Flag indicating that page is for diagram property dialog
86 };
87 #endif
88