KDevelop API Documentation

digraphview.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Bernd Gehrmann                                  *
00003  *   bernd@kdevelop.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #ifndef _DIGRAPHVIEW_H_
00013 #define _DIGRAPHVIEW_H_
00014 
00015 #include <qptrlist.h>
00016 #include <qscrollview.h>
00017 #include <qstringlist.h>
00018 
00019 class DigraphNode;
00020 class DigraphEdge;
00021 
00022 
00023 class DigraphView : public QScrollView
00024 {
00025     Q_OBJECT
00026     
00027 public:
00028     DigraphView(QWidget *parent, const char *name);
00029     ~DigraphView();
00030 
00031     void addEdge(const QString &name1, const QString &name2);
00032     void process();
00033     void clear();
00034     void setSelected(const QString &name);
00035     void ensureVisible(const QString &name);
00036     
00037 signals:
00038     void selected(const QString &name);
00039 
00040 protected:
00041     virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph);
00042     virtual void contentsMousePressEvent(QMouseEvent *e);
00043     virtual QSize sizeHint() const;
00044 
00045 private:
00046     int toXPixel(double x);
00047     int toYPixel(double x);
00048 
00049     void setRenderedExtent(double w, double h);
00050     void addRenderedNode(const QString &name,
00051                          double x, double y, double w, double h);
00052     void addRenderedEdge(const QString &name1, const QString &name2,
00053                          QMemArray<double> coords);
00054     static QStringList splitLine(QString str);
00055     void parseDotResults(const QStringList &list);
00056     
00057     double xscale, yscale;
00058     int width, height;
00059     QStringList inputs;
00060     QPtrList<DigraphNode> nodes;
00061     QPtrList<DigraphEdge> edges;
00062     DigraphNode *selNode;
00063 };
00064 
00065 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:38 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003