Files
qt-creator/src/plugins/qmljseditor/qmljsoutline.h

67 lines
1.3 KiB
C
Raw Normal View History

2010-07-08 11:32:45 +02:00
#ifndef QMLJSOUTLINE_H
#define QMLJSOUTLINE_H
2010-07-08 15:23:22 +02:00
#include "qmljseditor.h"
2010-07-08 11:32:45 +02:00
#include <texteditor/ioutlinewidget.h>
#include <QtGui/QTreeView>
namespace Core {
class IEditor;
}
namespace QmlJS {
class Editor;
};
namespace QmlJSEditor {
namespace Internal {
class QmlJSOutlineTreeView : public QTreeView
{
Q_OBJECT
public:
QmlJSOutlineTreeView(QWidget *parent = 0);
};
class QmlJSOutlineWidget : public TextEditor::IOutlineWidget
{
Q_OBJECT
public:
QmlJSOutlineWidget(QWidget *parent = 0);
void setEditor(QmlJSTextEditor *editor);
// IOutlineWidget
virtual void setCursorSynchronization(bool syncWithCursor);
private slots:
void modelUpdated();
void updateSelectionInTree(const QModelIndex &index);
2010-07-08 11:32:45 +02:00
void updateSelectionInText(const QItemSelection &selection);
private:
bool syncCursor();
private:
QmlJSOutlineTreeView *m_treeView;
QWeakPointer<QmlJSTextEditor> m_editor;
bool m_enableCursorSync;
bool m_blockCursorSync;
};
class QmlJSOutlineWidgetFactory : public TextEditor::IOutlineWidgetFactory
{
Q_OBJECT
public:
bool supportsEditor(Core::IEditor *editor) const;
TextEditor::IOutlineWidget *createWidget(Core::IEditor *editor);
};
} // namespace Internal
} // namespace QmlJSEditor
#endif // QMLJSOUTLINE_H