QmlJS: Completion for attached properties.

This commit is contained in:
Christian Kamm
2011-02-10 17:03:52 +01:00
parent 187ae1e94a
commit 490f2797f6
7 changed files with 128 additions and 12 deletions

View File

@@ -73,6 +73,7 @@ class Reference;
class ColorValue;
class AnchorLineValue;
class TypeEnvironment;
class AttachedTypeEnvironment;
typedef QList<const Value *> ValueList;
@@ -304,6 +305,7 @@ public:
QSharedPointer<const QmlComponentChain> qmlComponentScope;
QList<const ObjectValue *> qmlScopeObjects;
const TypeEnvironment *qmlTypes;
const AttachedTypeEnvironment *qmlAttachedTypes;
QList<const ObjectValue *> jsScopes;
// rebuilds the flat list of all scopes
@@ -461,6 +463,9 @@ public:
using ObjectValue::prototype;
const QmlObjectValue *prototype() const;
const QmlObjectValue *attachedType() const;
void setAttachedType(QmlObjectValue *value);
LanguageUtils::FakeMetaObject::ConstPtr metaObject() const;
QString packageName() const;
@@ -484,6 +489,7 @@ protected:
bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const;
private:
QmlObjectValue *_attachedType;
LanguageUtils::FakeMetaObject::ConstPtr _metaObject;
const QString _packageName;
const LanguageUtils::ComponentVersion _componentVersion;
@@ -1032,6 +1038,19 @@ public:
ImportInfo importInfo(const QString &name, const Context *context) const;
};
class QMLJS_EXPORT AttachedTypeEnvironment: public ObjectValue
{
const TypeEnvironment *_typeEnvironment;
public:
AttachedTypeEnvironment(const TypeEnvironment *typeEnv);
virtual const Value *lookupMember(const QString &name, const Context *context,
const ObjectValue **foundInObject = 0,
bool examinePrototypes = true) const;
virtual void processMembers(MemberProcessor *processor) const;
};
} } // namespace QmlJS::Interpreter
#endif // QMLJS_INTERPRETER_H