qmljscompletioncontextfinder.h 962 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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;
18
19
20
21
    bool isInQmlContext() const;

    bool isInLhsOfBinding() const;
    bool isInRhsOfBinding() const;
22

23
    bool isAfterOnInLhsOfBinding() const;
Christian Kamm's avatar
Christian Kamm committed
24
    QStringList bindingPropertyName() const;
25

26
27
28
private:
    int findOpeningBrace(int startTokenIndex);
    void getQmlObjectTypeName(int startTokenIndex);
29
    void checkBinding();
30
31
32

    QTextCursor m_cursor;
    QStringList m_qmlObjectTypeName;
Christian Kamm's avatar
Christian Kamm committed
33
    QStringList m_bindingPropertyName;
34
35
    int m_startTokenIndex;
    int m_colonCount;
36
    bool m_behaviorBinding;
37
38
39
40
41
};

} // namespace QmlJS

#endif // QMLJSCOMPLETIONCONTEXTFINDER_H