KDevelop API Documentation

navigator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Alexander Dymo                                  *
00003  *   adymo@mksat.net                                                       *
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  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef NAVIGATOR_H
00021 #define NAVIGATOR_H
00022 
00023 #include <qobject.h>
00024 #include <codemodel.h>
00025 
00026 class QTimer;
00027 class ClassViewPart;
00028 class QListViewItem;
00029 
00030 #define NAV_NODEFINITION "(no function)"
00031 
00032 class Navigator : public QObject
00033 {
00034 Q_OBJECT
00035 public:
00036     enum NavigationState { GoToDefinitions, GoToDeclarations };
00037     
00038     Navigator(ClassViewPart *parent, const char *name = 0);
00039     ~Navigator();
00040     
00041     void stopTimer();
00042     void refreshNavBars(const QString &activeFileName, bool clear = true);
00043 
00044     QString fullFunctionDefinitionName(FunctionDefinitionDom fun);
00045     QString fullFunctionDeclarationName(FunctionDom fun);
00046     
00047 public slots:
00048     void selectFunctionNav(QListViewItem *item);
00049     void syncFunctionNav();
00050     void syncFunctionNavDelayed(int delay);
00051     void functionNavFocused();
00052     void functionNavUnFocused();
00053     void slotCursorPositionChanged();
00054     void refresh();
00055     void addFile(const QString &file);
00056     
00057 protected:
00058     FunctionDefinitionDom currentFunctionDefinition();
00059     FunctionDefinitionDom functionDefinitionAt(int line, int column);
00060     FunctionDefinitionDom functionDefinitionAt(NamespaceDom ns, int line, int column);
00061     FunctionDefinitionDom functionDefinitionAt(ClassDom klass, int line, int column);
00062     FunctionDefinitionDom functionDefinitionAt(FunctionDefinitionDom fun, int line, int column);
00063     
00064     FunctionDom currentFunctionDeclaration();
00065     FunctionDom functionDeclarationAt(int line, int column);
00066     FunctionDom functionDeclarationAt(NamespaceDom ns, int line, int column);
00067     FunctionDom functionDeclarationAt(ClassDom klass, int line, int column);
00068     FunctionDom functionDeclarationAt(FunctionDom fun, int line, int column);
00069         
00070 private:
00071     ClassViewPart *m_part;
00072     QTimer *m_syncTimer;
00073     NavigationState m_state;
00074 
00075     bool m_navNoDefinition;
00076 
00077     QMap<QString, QListViewItem*> functionNavDefs;
00078     QMap<QString, QListViewItem*> functionNavDecls;
00079 };
00080 
00081 #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