File indexing completed on 2024-04-28 04:34:21
0001 /*************************************************************************** 0002 * Copyright 2009 Sandro Andrade <sandroandrade@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU Library General Public License as * 0006 * published by the Free Software Foundation; either version 2 of the * 0007 * License, or (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU Library General Public * 0015 * License along with this program; if not, write to the * 0016 * Free Software Foundation, Inc., * 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0018 ***************************************************************************/ 0019 0020 #ifndef CONTROLFLOWGRAPHVIEW_H 0021 #define CONTROLFLOWGRAPHVIEW_H 0022 0023 #include "ui_controlflowgraphview.h" 0024 0025 #include <QPointer> 0026 0027 namespace KParts 0028 { 0029 class ReadOnlyPart; 0030 } 0031 namespace KTextEditor 0032 { 0033 class View; 0034 class Cursor; 0035 } 0036 0037 class QGraphicsView; 0038 class KDevControlFlowGraphViewPlugin; 0039 class DUChainControlFlow; 0040 class DotControlFlowGraph; 0041 0042 class ControlFlowGraphView : public QWidget, public Ui::ControlFlowGraphView 0043 { 0044 Q_OBJECT 0045 public: 0046 explicit ControlFlowGraphView (KDevControlFlowGraphViewPlugin *plugin, QWidget *parent = 0); 0047 virtual ~ControlFlowGraphView (); 0048 0049 void refreshGraph(); 0050 void newGraph(); 0051 public Q_SLOTS: 0052 void setProjectButtonsEnabled(bool enabled); 0053 void cursorPositionChanged(KTextEditor::View *view, const KTextEditor::Cursor &cursor); 0054 0055 void exportControlFlowGraph(); 0056 0057 void updateLockIcon(bool checked); 0058 void setControlFlowClass(bool checked); 0059 void setControlFlowFunction(bool checked); 0060 void setControlFlowNamespace(bool checked); 0061 void setClusteringClass(bool checked); 0062 void setClusteringProject(bool checked); 0063 void setClusteringNamespace(bool checked); 0064 void setUseMaxLevel(bool checked); 0065 void setMaxLevel(int value); 0066 void setDrawIncomingArcs(bool checked); 0067 void setUseFolderName(bool checked); 0068 void setUseShortNames(bool checked); 0069 0070 private Q_SLOTS: 0071 void startingJob(); 0072 void graphDone(); 0073 0074 protected: 0075 void showEvent(QShowEvent *event); 0076 void hideEvent(QHideEvent *event); 0077 private: 0078 KDevControlFlowGraphViewPlugin *m_plugin; 0079 QPointer<KParts::ReadOnlyPart> m_part; 0080 QPointer<DotControlFlowGraph> m_dotControlFlowGraph; 0081 QPointer<DUChainControlFlow> m_duchainControlFlow; 0082 bool m_graphLocked; 0083 }; 0084 0085 #endif