• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • widgets
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-2013 *
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 
59  void askForNoteType(UMLWidget* &targetWidget);
60 
61  virtual bool loadFromXMI(QDomElement & qElement);
62  virtual void saveToXMI(QDomDocument & qDoc, QDomElement & qElement);
63 
64 public Q_SLOTS:
65  void slotMenuSelection(QAction* action);
66 
67 protected:
68  virtual QSizeF minimumSize();
69  virtual QSizeF calculateSize();
70  void paintText(QPainter *painter);
71  void paintTextWordWrap(QPainter *painter);
72  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
73 
74 private:
75  Uml::ID::Type m_diagramLink;
76  NoteType m_noteType;
77 
78  void rename();
79 };
80 
81 #endif
NoteWidget::stringToNoteType
static NoteType stringToNoteType(const QString &noteType)
Converts a string to NoteWidget::NoteType.
Definition: notewidget.cpp:118
NoteWidget::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
Loads a "notewidget" XMI element.
Definition: notewidget.cpp:200
NoteWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Will be called when a menu selection has been made from the popup menu.
Definition: notewidget.cpp:250
NoteWidget
Displays a note box to allow multiple lines of text to be displayed.
Definition: notewidget.h:30
NoteWidget::setNoteType
void setNoteType(NoteType noteType)
Sets the type of note.
Definition: notewidget.cpp:133
NoteWidget::~NoteWidget
virtual ~NoteWidget()
Destructor.
Definition: notewidget.cpp:51
NoteWidget::setDiagramLink
void setDiagramLink(Uml::ID::Type viewID)
Set the ID of the diagram hyperlinked to this note.
Definition: notewidget.cpp:163
QWidget
NoteWidget::PreCondition
Definition: notewidget.h:39
NoteWidget::paintText
void paintText(QPainter *painter)
Paints the text.
Definition: notewidget.cpp:331
NoteWidget::diagramLink
Uml::ID::Type diagramLink() const
Return the ID of the diagram hyperlinked to this note.
Definition: notewidget.cpp:152
umlwidget.h
NoteWidget::minimumSize
virtual QSizeF minimumSize()
Overrides method from UMLWidget.
Definition: notewidget.cpp:267
NoteWidget::NoteType
NoteType
This enum type is used to specify the type of note.
Definition: notewidget.h:36
NoteWidget::paintTextWordWrap
void paintTextWordWrap(QPainter *painter)
Paints the text.
Definition: notewidget.cpp:399
NoteWidget::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves to the "notewidget" XMI element.
Definition: notewidget.cpp:217
NoteWidget::Transformation
Definition: notewidget.h:41
Uml::ID::Type
std::string Type
Definition: basictypes.h:317
NoteWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Override default method.
Definition: notewidget.cpp:58
NoteWidget::calculateSize
virtual QSizeF calculateSize()
Overrides method from UMLWidget.
Definition: notewidget.cpp:299
NoteWidget::Normal
Definition: notewidget.h:38
NoteWidget::PostCondition
Definition: notewidget.h:40
NoteWidget::NoteWidget
NoteWidget(UMLScene *scene, NoteWidget::NoteType noteType=Normal, Uml::ID::Type id=Uml::ID::None)
Constructs a NoteWidget.
Definition: notewidget.cpp:40
NoteWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Event handler for moude double click events.
Definition: notewidget.cpp:494
NoteWidget::askForNoteType
void askForNoteType(UMLWidget *&targetWidget)
Display a dialog box to allow the user to choose the note's type.
Definition: notewidget.cpp:179
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:319
NoteWidget::noteType
NoteType noteType() const
Returns the type of note.
Definition: notewidget.cpp:110
UMLScene
UMLScene instances represent diagrams.
Definition: umlscene.h:70
UMLWidget
This is the base class for nearly all graphical widgets.
Definition: umlwidget.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal