notewidget.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NOTEWIDGET_H
00013 #define NOTEWIDGET_H
00014
00015
00016 #include "umlwidget.h"
00017
00018
00019 class NoteWidgetController;
00020
00021
00022 class QPainter;
00023 class QTextEdit;
00024
00035 class NoteWidget : public UMLWidget {
00036 Q_OBJECT
00037 public:
00038 friend class NoteWidgetController;
00039
00047 explicit NoteWidget(UMLView * view, Uml::IDType id = Uml::id_None );
00048
00052 virtual ~NoteWidget();
00053
00057 QSize calculateSize();
00058
00064 QString getDoc() const;
00065
00071 void setDoc(const QString &newText);
00072
00079 void setDiagramLink(Uml::IDType viewID);
00080
00087 Uml::IDType getDiagramLink() const;
00088
00092 void draw(QPainter & p, int offsetX, int offsetY);
00093
00097 void setFont(QFont font);
00098
00102 void setX(int x);
00103
00107 void setY(int y);
00108
00112 void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
00113
00117 bool loadFromXMI( QDomElement & qElement );
00118
00119 public slots:
00120 void slotMenuSelection(int sel);
00121 void slotViewScrolled(int x, int y);
00122
00123 protected:
00124
00125 Uml::IDType m_DiagramLink;
00126
00130 void drawText(QPainter * p = NULL, int offsetX = 0, int offsetY = 0);
00131 private:
00135 void init();
00136
00137 void setEditorGeometry(int dx = 0, int dy = 0);
00138 #if defined (NOTEWIDGET_EMBED_EDITOR)
00139 QTextEdit *m_pEditor;
00140 #else
00141 QString m_Text;
00142 #endif
00143 };
00144
00145 #endif
This file is part of the documentation for umbrello Version 3.1.0.