umbrello: umbrello/umlwidgets/notewidget.h Source File

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

notewidget.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) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef NOTEWIDGET_H
12 #define NOTEWIDGET_H
13
14 //app includes
15 #include "umlwidget.h"
16
17 // Qt forward declarations
18 class QPainter;
19
30 class NoteWidget : public UMLWidget
31 {
32 Q_OBJECT
33 public:
34
36 enum NoteType
37 {
38 Normal,
39 PreCondition,
40 PostCondition,
41 Transformation
42 };
43
44 explicit NoteWidget(UMLScene * scene, NoteWidget::NoteType noteType = Normal,
45 Uml::ID::Type id = Uml::ID::None);
46 virtual ~NoteWidget();
47
48 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
49
50 static NoteType stringToNoteType(const QString& noteType);
51
52 NoteType noteType() const;
53 void setNoteType(NoteType noteType);
54 void setNoteType(const QString& noteType);
55
56 Uml::ID::Type diagramLink() const;
57 void setDiagramLink(Uml::ID::Type viewID);
58 bool setDiagramLink(const QString &diagramName);
59
60 void askForNoteType(UMLWidget* &targetWidget);
61
62 virtual bool showPropertiesDialog();
63
64 virtual bool loadFromXMI1(QDomElement & qElement);
65 virtual void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
66 virtual QSizeF minimumSize() const;
67
68 static QPointer<NoteWidget> s_pCurrentNote;
69
70 public Q_SLOTS:
71 void slotMenuSelection(QAction* action);
72
73 protected:
74 virtual QSizeF calculateSize(bool withExtensions = true) const;
75 void paintText(QPainter *painter);
76 void paintTextWordWrap(QPainter *painter);
77 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
78
79 private:
80 Uml::ID::Type m_diagramLink;
81 NoteType m_noteType;
82 };
83
84 #endif
notewidget.h
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
NoteWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: notewidget.cpp:266
NoteWidget::paintTextWordWrap
void paintTextWordWrap(QPainter *painter)
Definition: notewidget.cpp:432
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:335
NoteDialog
Definition: notedialog.h:23
ListPopupMenu::mt_Properties
@ mt_Properties
Definition: listpopupmenu.h:182
NoteWidget::PreCondition
@ PreCondition
Definition: notewidget.h:39
docwindow.h
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::setDocumentation
virtual void setDocumentation(const QString &doc)
Definition: widgetbase.cpp:294
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:217
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:162
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:370
NoteWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: notewidget.cpp:67
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:94
UMLWidget::cleanup
virtual void cleanup()
Definition: umlwidget.cpp:1706
NoteWidget::NoteWidget
NoteWidget(UMLScene *scene, NoteWidget::NoteType noteType=Normal, Uml::ID::Type id=Uml::ID::None)
Definition: notewidget.cpp:49
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1280
DocWindow::updateDocumentation
void updateDocumentation(bool clear=false, bool startup=false)
Definition: docwindow.cpp:273
Uml::ID::Type
std::string Type
Definition: basictypes.h:368
NoteWidget::calculateSize
virtual QSizeF calculateSize(bool withExtensions=true) const
Definition: notewidget.cpp:330
NoteWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Definition: notewidget.cpp:526
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1285
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
NoteWidget::minimumSize
virtual QSizeF minimumSize() const
Definition: notewidget.cpp:320
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
UMLDoc::changeCurrentView
void changeCurrentView(Uml::ID::Type id)
Definition: umldoc.cpp:1774
NoteWidget::s_pCurrentNote
static QPointer< NoteWidget > s_pCurrentNote
Definition: notewidget.h:68
Uml::DiagramType::fromInt
Enum fromInt(int item)
Definition: basictypes.cpp:284
UMLView
Definition: umlview.h:35
NoteWidget::askForNoteType
void askForNoteType(UMLWidget *&targetWidget)
Definition: notewidget.cpp:221
UMLApp::docWindow
DocWindow * docWindow() const
Definition: uml.cpp:1886
NoteWidget::Transformation
@ Transformation
Definition: notewidget.h:41
NoteWidget::stringToNoteType
static NoteType stringToNoteType(const QString &noteType)
Definition: notewidget.cpp:126
umlwidget.h
UMLWidget::defaultMargin
static const int defaultMargin
Definition: umlwidget.h:49
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
i18n
#define i18n
Definition: main.cpp:39
Uml::DiagramType::N_DIAGRAMTYPES
@ N_DIAGRAMTYPES
Definition: basictypes.h:108
WidgetBase::documentation
QString documentation() const
Definition: widgetbase.cpp:269
NoteWidget::setDiagramLink
void setDiagramLink(Uml::ID::Type viewID)
Definition: notewidget.cpp:171
NoteWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: notewidget.cpp:302
NoteWidget
Displays a note box.
Definition: notewidget.h:31
NoteWidget::~NoteWidget
virtual ~NoteWidget()
Definition: notewidget.cpp:60
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
UMLDoc
Definition: umldoc.h:75
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3125
NoteWidget::setNoteType
void setNoteType(NoteType noteType)
Definition: notewidget.cpp:141
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
Uml
Definition: basictypes.cpp:37
NoteWidget::paintText
void paintText(QPainter *painter)
Definition: notewidget.cpp:365
DocWindow::showDocumentation
void showDocumentation(UMLObject *object, bool overwrite=false)
Definition: docwindow.cpp:130
uError
#define uError()
Definition: debug_utils.h:123
umlscene.h
NoteWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: notewidget.cpp:280
uml.h
NoteWidget::Normal
@ Normal
Definition: notewidget.h:38
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:223
debug_utils.h
notedialog.h
UMLScene::name
QString name() const
Definition: umlscene.cpp:410
NoteWidget::noteType
NoteType noteType() const
Definition: notewidget.cpp:118
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
WidgetBase::lineWidth
uint lineWidth() const
Definition: widgetbase.cpp:398
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:183
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:56
listpopupmenu.h
NoteWidget::PostCondition
@ PostCondition
Definition: notewidget.h:40
NoteWidget::m_noteType
NoteType m_noteType
The type of note.
Definition: notewidget.h:81
dialog_utils.h
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:442
NoteWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: notewidget.cpp:249
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
WidgetBase::asNoteWidget
NoteWidget * asNoteWidget()
Definition: widgetbase.cpp:1482
NoteWidget::m_diagramLink
Uml::ID::Type m_diagramLink
The diagram/scene this note links to.
Definition: notewidget.h:80
NoteWidget::NoteType
NoteType
This enum type is used to specify the type of note.
Definition: notewidget.h:37
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
UMLDoc::findView
UMLView * findView(Uml::ID::Type id)
Definition: umldoc.cpp:1003
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
umldoc.h
NoteWidget::diagramLink
Uml::ID::Type diagramLink() const
Definition: notewidget.cpp:160
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869