umbrello API Documentation

notewidget.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2002-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef NOTEWIDGET_H
00013 #define NOTEWIDGET_H
00014 
00015 //app includes
00016 #include "umlwidget.h"
00017 
00018 // forward declarations
00019 class NoteWidgetController;
00020 
00021 // Qt forward declarations
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     // Data loaded/saved
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
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:58 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003