language/duchain
abstractnavigationwidget.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ABSTRACTNAVIGATIONWIDGET_H
00020 #define ABSTRACTNAVIGATIONWIDGET_H
00021
00022
00023 #include <QtCore/QObject>
00024 #include <QtCore/QPointer>
00025 #include <KDE/KSharedPtr>
00026 #include <ktextbrowser.h>
00027
00028 #include "../duchainpointer.h"
00029 #include "../../interfaces/quickopendataprovider.h"
00030 #include "../../languageexport.h"
00031 #include "abstractnavigationcontext.h"
00032
00033 class QWidget;
00034 class QTextBrowser;
00035
00036 namespace KDevelop {
00037 class UsesWidget;
00038
00043 class KDEVPLATFORMLANGUAGE_EXPORT AbstractNavigationWidget : public QWidget, public QuickOpenEmbeddedWidgetInterface
00044 {
00045 Q_OBJECT
00046 public:
00047 AbstractNavigationWidget();
00048
00049 virtual ~AbstractNavigationWidget();
00050
00051 void setContext(NavigationContextPointer context, int initBrowser = 400);
00052
00053 QSize sizeHint() const;
00054
00055 public slots:
00057 virtual void next();
00059 virtual void previous();
00061 virtual void accept();
00062 virtual void up();
00063 virtual void down();
00064 virtual void back();
00065
00068 void embeddedWidgetRight();
00070 void embeddedWidgetLeft();
00072 void embeddedWidgetAccept();
00073 void embeddedWidgetUp();
00074 void embeddedWidgetDown();
00075
00076 NavigationContextPointer context();
00077
00080 void executeContextAction(QString action);
00081
00082 Q_SIGNALS:
00083 void sizeHintChanged();
00084 public slots:
00085 void navigateDeclaration(KDevelop::IndexedDeclaration decl);
00086 private slots:
00087 void anchorClicked(const QUrl&);
00088 protected:
00089
00090 virtual void wheelEvent(QWheelEvent* );
00091 void updateIdealSize() const;
00092 virtual void keyPressEvent(QKeyEvent* event);
00093
00094 void initBrowser(int height);
00095 void update();
00096
00097 NavigationContextPointer m_context, m_startContext;
00098
00099 TopDUContextPointer m_topContext;
00100
00101 QPointer<QTextBrowser> m_browser;
00102 QWidget* m_currentWidget;
00103 QString m_currentText;
00104 mutable QSize m_idealTextSize;
00105
00106 };
00107 }
00108
00109
00110 #endif