Files
qt-creator/src/libs/qmljs/qmljscompletioncontextfinder.h

42 lines
962 B
C
Raw Normal View History

#ifndef QMLJSCOMPLETIONCONTEXTFINDER_H
#define QMLJSCOMPLETIONCONTEXTFINDER_H
#include "qmljs_global.h"
#include <qmljs/qmljslineinfo.h>
#include <QtCore/QStringList>
#include <QtGui/QTextCursor>
namespace QmlJS {
class QMLJS_EXPORT CompletionContextFinder : public LineInfo
{
public:
CompletionContextFinder(const QTextCursor &cursor);
QStringList qmlObjectTypeName() const;
bool isInQmlContext() const;
bool isInLhsOfBinding() const;
bool isInRhsOfBinding() const;
bool isAfterOnInLhsOfBinding() const;
QStringList bindingPropertyName() const;
private:
int findOpeningBrace(int startTokenIndex);
void getQmlObjectTypeName(int startTokenIndex);
void checkBinding();
QTextCursor m_cursor;
QStringList m_qmlObjectTypeName;
QStringList m_bindingPropertyName;
int m_startTokenIndex;
int m_colonCount;
bool m_behaviorBinding;
};
} // namespace QmlJS
#endif // QMLJSCOMPLETIONCONTEXTFINDER_H