umbrello: umbrello/dialogs/multipagedialogbase.h Source File

umbrello 2.32.0 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

multipagedialogbase.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2012-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef MULTIPAGEDIALOGBASE_H
12 #define MULTIPAGEDIALOGBASE_H
13
14 #include "icon_utils.h"
15
16 #include <kpagewidget.h>
17
18 // qt class includes
19 #include <QDialog>
20 #include <QWidget>
21
22 //forward declarations
23 class AssociationWidget;
24 class AssociationGeneralPage;
25 class AssociationRolePage;
26 class KFontChooser;
27 class KPageDialog;
28 class QAbstractButton;
29 class QFrame;
30 class NotePage;
31 class NoteWidget;
32 class MessageWidget;
33 class UMLWidget;
34 class SelectOperationPage;
35 class UMLWidgetStylePage;
36 class WidgetBase;
37 class UMLScene;
38 namespace Settings { class OptionState; }
39
51 class MultiPageDialogBase : public QWidget
52 {
53 Q_OBJECT
54
55 public:
57 typedef enum {
58 AutoLayoutPage,
59 ClassPage,
60 CodeImportPage,
61 CodeGenerationPage,
62 CodeViewerPage,
63 FontPage,
64 GeneralPage,
65 UserInterfacePage,
66 } PageType;
67
68 explicit MultiPageDialogBase(QWidget *parent, bool withDefaultButton=false);
69 virtual ~MultiPageDialogBase();
70
71 void apply();
72
73 void setCaption(const QString &caption);
74 void accept();
75 void reject();
76 KPageWidgetItem *currentPage();
77 void addPage(KPageWidgetItem *page);
78 void setCurrentPage(KPageWidgetItem *page);
79 static int spacingHint();
80 int exec();
81
82 virtual bool isModified();
83
84 signals:
85 void okClicked();
86 void applyClicked();
87 void defaultClicked();
88
89 protected slots:
90 void slotEnableButtonOk(bool state);
91
92 private slots:
93 void slotOkClicked();
94 void slotApplyClicked();
95 void slotDefaultClicked();
96 #if QT_VERSION >= 0x050000
97 void slotHelpClicked();
98 void slotButtonClicked(QAbstractButton *button);
99 #endif
100 protected:
101 AssociationGeneralPage *m_pAssocGeneralPage;
102 NotePage *m_notePage;
103 SelectOperationPage *m_operationGeneralPage;
104 AssociationRolePage *m_pRolePage;
105 KFontChooser *m_fontChooser;
106 UMLWidgetStylePage *m_pStylePage;
107 KPageWidgetItem *m_pageItem;
108 KPageDialog *m_pageDialog;
109 KPageWidget *m_pageWidget;
110 bool m_useDialog;
111 bool m_isModified;
112 virtual void keyPressEvent(QKeyEvent *event);
113
114 QFrame* createPage(const QString& name, const QString& header, Icon_Utils::IconType icon);
115 KPageWidgetItem *createPage(const QString &name, const QString &header, Icon_Utils::IconType icon, QWidget *widget);
116
117 void setupGeneralPage(AssociationWidget *widget);
118 void applyGeneralPage(AssociationWidget *widget);
119
120 void setupGeneralPage(NoteWidget *widget);
121 KPageWidgetItem *setupGeneralPage(MessageWidget *widget);
122 void applyGeneralPage(MessageWidget *widget);
123
124 KPageWidgetItem *setupFontPage(const QFont &font);
125 KPageWidgetItem *setupFontPage(UMLWidget *widget);
126 KPageWidgetItem *setupFontPage(AssociationWidget *widget);
127 void resetFontPage(QWidget *widget);
128 void applyFontPage(AssociationWidget *widget);
129 void applyFontPage(Settings::OptionState *state);
130 void applyFontPage(UMLScene *scene);
131 void applyFontPage(UMLWidget *widget);
132
133 KPageWidgetItem *setupStylePage(WidgetBase *widget);
134 KPageWidgetItem *setupStylePage(AssociationWidget *widget);
135 void applyStylePage();
136
137 KPageWidgetItem *setupAssociationRolePage(AssociationWidget *widget);
138 void applyAssociationRolePage();
139 };
140
141 #endif
AssociationGeneralPage
Display properties on a UMLObject.
Definition: associationgeneralpage.h:40
AssociationRolePage
Display properties on a UMLObject.
Definition: associationrolepage.h:35
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
MessageWidget
Displays a message.
Definition: messagewidget.h:41
MultiPageDialogBase
Definition: multipagedialogbase.h:52
MultiPageDialogBase::defaultClicked
void defaultClicked()
MultiPageDialogBase::resetFontPage
void resetFontPage(QWidget *widget)
Definition: multipagedialogbase.cpp:431
MultiPageDialogBase::MultiPageDialogBase
MultiPageDialogBase(QWidget *parent, bool withDefaultButton=false)
Definition: multipagedialogbase.cpp:85
MultiPageDialogBase::spacingHint
static int spacingHint()
Definition: multipagedialogbase.cpp:214
MultiPageDialogBase::applyAssociationRolePage
void applyAssociationRolePage()
Definition: multipagedialogbase.cpp:518
MultiPageDialogBase::okClicked
void okClicked()
MultiPageDialogBase::addPage
void addPage(KPageWidgetItem *page)
Definition: multipagedialogbase.cpp:193
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:223
MultiPageDialogBase::m_pStylePage
UMLWidgetStylePage * m_pStylePage
Definition: multipagedialogbase.h:106
MultiPageDialogBase::m_pRolePage
AssociationRolePage * m_pRolePage
Definition: multipagedialogbase.h:104
MultiPageDialogBase::reject
void reject()
Definition: multipagedialogbase.cpp:179
MultiPageDialogBase::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
Definition: multipagedialogbase.cpp:308
MultiPageDialogBase::m_fontChooser
KFontChooser * m_fontChooser
Definition: multipagedialogbase.h:105
MultiPageDialogBase::~MultiPageDialogBase
virtual ~MultiPageDialogBase()
Definition: multipagedialogbase.cpp:120
MultiPageDialogBase::createPage
QFrame * createPage(const QString &name, const QString &header, Icon_Utils::IconType icon)
Definition: multipagedialogbase.cpp:325
MultiPageDialogBase::slotDefaultClicked
void slotDefaultClicked()
Definition: multipagedialogbase.cpp:261
MultiPageDialogBase::PageType
PageType
Available page types.
Definition: multipagedialogbase.h:57
MultiPageDialogBase::UserInterfacePage
@ UserInterfacePage
Definition: multipagedialogbase.h:65
MultiPageDialogBase::CodeGenerationPage
@ CodeGenerationPage
Definition: multipagedialogbase.h:61
MultiPageDialogBase::GeneralPage
@ GeneralPage
Definition: multipagedialogbase.h:64
MultiPageDialogBase::FontPage
@ FontPage
Definition: multipagedialogbase.h:63
MultiPageDialogBase::CodeImportPage
@ CodeImportPage
Definition: multipagedialogbase.h:60
MultiPageDialogBase::ClassPage
@ ClassPage
Definition: multipagedialogbase.h:59
MultiPageDialogBase::AutoLayoutPage
@ AutoLayoutPage
Definition: multipagedialogbase.h:58
MultiPageDialogBase::CodeViewerPage
@ CodeViewerPage
Definition: multipagedialogbase.h:62
MultiPageDialogBase::slotApplyClicked
void slotApplyClicked()
Definition: multipagedialogbase.cpp:253
MultiPageDialogBase::setCaption
void setCaption(const QString &caption)
Definition: multipagedialogbase.cpp:162
MultiPageDialogBase::applyClicked
void applyClicked()
MultiPageDialogBase::m_operationGeneralPage
SelectOperationPage * m_operationGeneralPage
Definition: multipagedialogbase.h:103
MultiPageDialogBase::setupStylePage
KPageWidgetItem * setupStylePage(WidgetBase *widget)
Definition: multipagedialogbase.cpp:477
MultiPageDialogBase::setupFontPage
KPageWidgetItem * setupFontPage(const QFont &font)
Definition: multipagedialogbase.cpp:400
MultiPageDialogBase::m_pAssocGeneralPage
AssociationGeneralPage * m_pAssocGeneralPage
Definition: multipagedialogbase.h:101
MultiPageDialogBase::slotEnableButtonOk
void slotEnableButtonOk(bool state)
Definition: multipagedialogbase.cpp:126
MultiPageDialogBase::applyStylePage
void applyStylePage()
Definition: multipagedialogbase.cpp:498
MultiPageDialogBase::m_notePage
NotePage * m_notePage
Definition: multipagedialogbase.h:102
MultiPageDialogBase::applyGeneralPage
void applyGeneralPage(MessageWidget *widget)
MultiPageDialogBase::setupAssociationRolePage
KPageWidgetItem * setupAssociationRolePage(AssociationWidget *widget)
Definition: multipagedialogbase.cpp:508
MultiPageDialogBase::setupGeneralPage
void setupGeneralPage(AssociationWidget *widget)
Definition: multipagedialogbase.cpp:364
MultiPageDialogBase::m_useDialog
bool m_useDialog
Definition: multipagedialogbase.h:110
MultiPageDialogBase::accept
void accept()
Definition: multipagedialogbase.cpp:173
MultiPageDialogBase::setCurrentPage
void setCurrentPage(KPageWidgetItem *page)
Definition: multipagedialogbase.cpp:206
MultiPageDialogBase::isModified
virtual bool isModified()
Definition: multipagedialogbase.cpp:237
MultiPageDialogBase::currentPage
KPageWidgetItem * currentPage()
Definition: multipagedialogbase.cpp:185
MultiPageDialogBase::m_isModified
bool m_isModified
Definition: multipagedialogbase.h:111
MultiPageDialogBase::apply
void apply()
Definition: multipagedialogbase.cpp:140
MultiPageDialogBase::slotOkClicked
void slotOkClicked()
Definition: multipagedialogbase.cpp:245
MultiPageDialogBase::m_pageDialog
KPageDialog * m_pageDialog
Definition: multipagedialogbase.h:108
MultiPageDialogBase::applyFontPage
void applyFontPage(AssociationWidget *widget)
Definition: multipagedialogbase.cpp:441
MultiPageDialogBase::m_pageWidget
KPageWidget * m_pageWidget
Definition: multipagedialogbase.h:109
MultiPageDialogBase::m_pageItem
KPageWidgetItem * m_pageItem
Definition: multipagedialogbase.h:107
MultiPageDialogBase::applyGeneralPage
void applyGeneralPage(AssociationWidget *widget)
NotePage
Definition: notepage.h:24
NoteWidget
Displays a note box.
Definition: notewidget.h:31
SelectOperationPage
A dialog page to select an operation.
Definition: selectoperationpage.h:36
Settings::OptionState
Definition: optionstate.h:315
UMLScene
Definition: umlscene.h:70
UMLWidgetStylePage
Definition: umlwidgetstylepage.h:38
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:106
icon_utils.h
Icon_Utils::IconType
IconType
Definition: icon_utils.h:47
Settings
Definition: codeviewerstate.cpp:15