- Home
- Installation
- Using Livekeys
- Plugins
- Developer
group lveditqmljs
Library used for extending and interacting with qml projects.
Summary
Members | Descriptions |
---|---|
class lv::DocumentQmlInfo::ValueReference |
Contains a reference to a value within a parsed qml document. |
class lv::DocumentQmlInfo::ASTReference |
Reference to an AST node within the parsed qml document. |
class lv::DocumentQmlInfo::Message |
Message information containing parsing status. |
class lv::DocumentQmlInfo::Import |
Import data associated with a lv::DocumentQmlInfo. |
class lv::DocumentQmlInfo |
Contains parsed information about a Project qml document. |
class lv::DocumentQmlValueObjects::RangeItem |
Base range item acting as a node in the hierarchy. |
class lv::DocumentQmlValueObjects::RangeProperty |
Property range item inside the ierarchy. |
class lv::DocumentQmlValueObjects::RangeObject |
Object range item inside the hierarchy. |
class lv::DocumentQmlValueObjects |
Contains the ierarchy of Qml objects and a reference to their AST. |
class lv::LanguageQmlHandler |
Main code handler for the qml extension. |
class lv::ProjectQmlExtension |
Main object used throughout qml extension plugin. |
class lv::ProjectQmlScope |
Contains all the loaded plugins of a project. |
class lv::QmlCompletionContext |
Contains a qml code completion context. |
class lv::QmlDeclaration |
Holds a qml property declaration. |
class lv::QmlEditFragment |
An editing fragment for a lv::ProjectDocument. |
class lv::DocumentQmlInfo::ValueReference
Contains a reference to a value within a parsed qml document.
Summary
Members | Descriptions |
---|---|
public const QmlJS::Value * value |
Internal reference to the value. |
public const DocumentQmlInfo * parent |
Reference to the parent. |
public inline ValueReference (const QmlJS::Value * val,const DocumentQmlInfo * p) |
ValueReference constructor. |
public inline ValueReference () |
ValueReference destructor. |
Members
public const QmlJS::Value *
value
Internal reference to the value.
public const
DocumentQmlInfo
*
parent
Reference to the parent.
public inline
ValueReference
(const QmlJS::Value * val,const
DocumentQmlInfo
* p)
ValueReference constructor.
public inline
ValueReference
()
ValueReference destructor.
class lv::DocumentQmlInfo::ASTReference
Reference to an AST node within the parsed qml document.
Summary
Members | Descriptions |
---|---|
public QmlJS::AST::Node * node |
Internal reference to the AST node. |
public inline ASTReference (QmlJS::AST::Node * n) |
ASTReference constructor. |
public inline ASTReference () |
ASTReference destructor. |
Members
public QmlJS::AST::Node *
node
Internal reference to the AST node.
public inline
ASTReference
(QmlJS::AST::Node * n)
ASTReference constructor.
public inline
ASTReference
()
ASTReference destructor.
class lv::DocumentQmlInfo::Message
Message information containing parsing status.
Summary
Members | Descriptions |
---|---|
public Severity
kind |
Message severity level. |
public int position |
Position the message was generated at. |
public int line |
Line the message was generated at. |
public QString text |
Message text. |
public inline Message ( Severity pkind,int pposition,int pline,const QString & ptext) |
DocumentQmlInfo::Message constructor. |
enum Severity |
Severity of a message. |
Members
public
Severity
kind
Message severity level.
public int
position
Position the message was generated at.
public int
line
Line the message was generated at.
public QString
text
Message text.
public inline
Message
(
Severity
pkind,int pposition,int pline,const QString & ptext)
DocumentQmlInfo::Message constructor.
enum
Severity
Values | Descriptions |
---|---|
Hint | Lowest severity level. |
MaybeWarning | Might be a warning. |
Warning | Warning Level. |
MaybeError | Might be an error. |
Error | Error level. |
Severity of a message.
class lv::DocumentQmlInfo::Import
Import data associated with a lv::DocumentQmlInfo.
Summary
Members | Descriptions |
---|---|
public Import ( Type importType,const QString & uri,const QString & as,int vMajor,int vMinor, Document::Location location) |
Import constructor. |
public Import ( Type importType,const QString & uri,const QString & relativeUri,const QString & as,int vMajor,int vMinor, Document::Location location) |
|
public inline void updateUri (const QString & uri) |
Updates the import uri for this import. |
public inline void setImportType ( Type importType) |
|
public inline Type
importType () const |
Returns the import type for this import. |
public inline const QString & uri () const |
Returns the path of this import. |
public inline const QString & relativeUri () const |
Returns the import relative uri. |
public inline const QString & as () const |
Returns the namespace this import was declared in. |
public inline int versionMajor () const |
Returns the major version of this import. |
public inline int versionMinor () const |
Returns the minor version of this import. |
public inline bool isVersionValid () const |
Returns true if this version is valid, false otherwise. |
public QString toString () const |
|
public QString versionString () const |
|
public void setLocation (const Document::Location & location) |
|
public const Document::Location & location () const |
|
public inline bool operator== (const Import & other) const |
Returns true if this object is the same as other , false otherwise. |
enum Type |
Import type |
Members
public
Import
(
Type
importType,const QString & uri,const QString & as,int vMajor,int vMinor,
Document::Location
location)
Import constructor.
Takes an importType
, the path
of the import, the as
namespace in which to import for this document and the two versions: vMajor
, vMinor
public
Import
(
Type
importType,const QString & uri,const QString & relativeUri,const QString & as,int vMajor,int vMinor,
Document::Location
location)
public inline void
updateUri
(const QString & uri)
Updates the import uri for this import.
public inline void
setImportType
(
Type
importType)
public inline
Type
importType
() const
Returns the import type for this import.
public inline const QString &
uri
() const
Returns the path of this import.
public inline const QString &
relativeUri
() const
Returns the import relative uri.
public inline const QString &
as
() const
Returns the namespace this import was declared in.
public inline int
versionMajor
() const
Returns the major version of this import.
public inline int
versionMinor
() const
Returns the minor version of this import.
public inline bool
isVersionValid
() const
Returns true if this version is valid, false otherwise.
public QString
toString
() const
public QString
versionString
() const
public void
setLocation
(const
Document::Location
& location)
public const
Document::Location
&
location
() const
public inline bool
operator==
(const
Import
& other) const
Returns true if this object is the same as other
, false otherwise.
enum
Type
Values | Descriptions |
---|---|
Invalid | Invalid type |
Library | Library based import with qmldir file. |
Directory | Directory based import |
ImplicitDirectory | Implicit import |
File | Js file import |
UnknownFile | Unknown file import |
Import type
class lv::DocumentQmlInfo
Contains parsed information about a Project qml document.
Summary
Members | Descriptions |
---|---|
public QStringList extractIds () const |
Extract the declared id's within a qml document. |
public const ValueReference
rootObject () |
Return a reference to the root object of this qml document. |
public const ValueReference
valueForId (const QString & id) const |
Returns a reference to the value represented by the given id. |
public lv::QmlTypeInfo::Ptr extractValueObject (const ValueReference & value, ValueReference * parent) const |
Extracts a usable object given a value reference. |
public lv::QmlTypeInfo::Ptr extractValueObjectWithExport (const ValueReference & value,const QString & componentName,const QString & libraryPath) const |
|
public QStringList extractTypeName (const ValueReference & value) const |
Extract the name of the type given by this value reference. |
public void extractTypeNameRange (const ValueReference & value,int & begin,int & end) const |
Extract the range of the type given by a value reference. |
public void extractRange (const ValueReference & value,int & begin,int & end) |
Extract the full range given by a value reference. |
public void createRanges () |
Finds the ranges within this document. |
public const ValueReference
valueAtPosition (int position) const |
Find the value reference at a given position . |
public const ValueReference
valueAtPosition (int position,int & begin,int & end) const |
Find the value reference and range at a given position . |
public const ASTReference
astObjectAtPosition (int position) |
Returns the reference to an AST node at a specified position . |
public QString propertySourceFromObjectId (const QString & componentId,const QString & propertyName) |
|
public bool isValueNull (const ValueReference & vr) const |
Check wether the value reference is null. |
public bool isParsedCorrectly () const |
Check wether the document was parsed correctly after calling the lv::DocumentQmlInfo::parse() method. |
public bool parse (const QString & source) |
Parses the source code to an AST form. |
public const QList< DocumentQmlInfo::Message > & diagnostics () const |
|
public QString path () const |
Return the path of the Document. |
public QString componentName () const |
Return the component name represented by this Document. |
public QString source () const |
|
public void tryExtractImports () |
Tries to extract imports from a document that was not correcly parsed. |
public DocumentQmlValueObjects::Ptr
createObjects () const |
Visit the AST and create the objects defined in this document. |
public DocumentQmlValueObjects::Ptr
createObjects (const ASTReference & ast) const |
Visit the AST from the given ast node and create the objects defined within. |
public ~DocumentQmlInfo () |
DocumentQmlInfo destructor. |
public void updateImportType (const QString & uri, Import::Type type) |
Updates the import at the given uri type. |
public bool hasImport (const Import & key) const |
|
public bool hasImport (const QString & importUri) const |
|
public bool hasImportAs (const QString & asKey) const |
|
public int totalImports () const |
Returns the total number of imports for this lv::ProjectDocument. |
public const ImportList & imports () const |
Returns the ImportList associated with this object. |
public void transferImports (const ImportList & imports) |
|
public void addImport (const Import & key) |
Adds an import path to a given key . |
protected DocumentQmlInfo (const QString & fileName) |
DocumentQmlInfo constructor. |
enum Dialect |
Dialect used by the source code of a file. |
typedef ImportList |
List of import entries |
typedef ConstPtr |
Constat SharedPointer to DocumentqmlInfo. |
typedef Ptr |
SharedPointer to DocumentqmlInfo. |
Members
public QStringList
extractIds
() const
Extract the declared id's within a qml document.
public const
ValueReference
rootObject
()
Return a reference to the root object of this qml document.
public const
ValueReference
valueForId
(const QString & id) const
Returns a reference to the value represented by the given id.
public lv::QmlTypeInfo::Ptr
extractValueObject
(const
ValueReference
& value,
ValueReference
* parent) const
Extracts a usable object given a value reference.
For example, you can use this class together with lv::DocumentQmlInfo::valueForId() to inspect a specific object defined with an id within the qml document.
public lv::QmlTypeInfo::Ptr
extractValueObjectWithExport
(const
ValueReference
& value,const QString & componentName,const QString & libraryPath) const
public QStringList
extractTypeName
(const
ValueReference
& value) const
Extract the name of the type given by this value reference.
public void
extractTypeNameRange
(const
ValueReference
& value,int & begin,int & end) const
Extract the range of the type given by a value reference.
begin
and end
will be populated with the given range, or -1 if the range cannot be extracted
public void
extractRange
(const
ValueReference
& value,int & begin,int & end)
Extract the full range given by a value reference.
begin
and end
will be populated with the given range, or -1 if the range cannot be extracted
public void
createRanges
()
Finds the ranges within this document.
public const
ValueReference
valueAtPosition
(int position) const
Find the value reference at a given position
.
public const
ValueReference
valueAtPosition
(int position,int & begin,int & end) const
Find the value reference and range at a given position
.
The begin
and end
arguments will be populated with the range positino
public const
ASTReference
astObjectAtPosition
(int position)
Returns the reference to an AST node at a specified position
.
public QString
propertySourceFromObjectId
(const QString & componentId,const QString & propertyName)
public bool
isValueNull
(const
ValueReference
& vr) const
Check wether the value reference is null.
Returns
true if vr
is null, false otherwise
public bool
isParsedCorrectly
() const
Check wether the document was parsed correctly after calling the lv::DocumentQmlInfo::parse() method.
Returns
true if it was, false otherwise
public bool
parse
(const QString & source)
Parses the source code to an AST form.
Returns
True if the parse went correctly, false otherwise
public const QList<
DocumentQmlInfo::Message
> &
diagnostics
() const
public QString
path
() const
Return the path of the Document.
public QString
componentName
() const
Return the component name represented by this Document.
public QString
source
() const
public void
tryExtractImports
()
Tries to extract imports from a document that was not correcly parsed.
public
DocumentQmlValueObjects::Ptr
createObjects
() const
Visit the AST and create the objects defined in this document.
Returns
A pointer to the lv::DocumentQmlValueObjects
public
DocumentQmlValueObjects::Ptr
createObjects
(const
ASTReference
& ast) const
Visit the AST from the given ast
node and create the objects defined within.
Returns
A pointer to the lv::DocumentQmlValueObjects
public
~DocumentQmlInfo
()
DocumentQmlInfo destructor.
public void
updateImportType
(const QString & uri,
Import::Type
type)
Updates the import at the given uri type.
public bool
hasImport
(const
Import
& key) const
public bool
hasImport
(const QString & importUri) const
public bool
hasImportAs
(const QString & asKey) const
public int
totalImports
() const
Returns the total number of imports for this lv::ProjectDocument.
public const
ImportList
&
imports
() const
Returns the ImportList associated with this object.
public void
transferImports
(const
ImportList
& imports)
public void
addImport
(const
Import
& key)
Adds an import path
to a given key
.
protected
DocumentQmlInfo
(const QString & fileName)
DocumentQmlInfo constructor.
This constructor is private. Use lv::DocumentQmlInfo::create() function.
enum
Dialect
Values | Descriptions |
---|---|
Unknown | Unknown dialect. |
Javascript | Javascript dialect. |
Qml | Qml dialect. |
QmlTypeInfo | QmlTypeInfo dialect. |
QmlProject | QmlProject dialect. |
Json | Json dialect. |
Dialect used by the source code of a file.
typedef
ImportList
List of import entries
typedef
ConstPtr
Constat SharedPointer to DocumentqmlInfo.
typedef
Ptr
SharedPointer to DocumentqmlInfo.
class lv::DocumentQmlValueObjects::RangeItem
Base range item acting as a node in the hierarchy.
Summary
Members | Descriptions |
---|---|
public inline virtual ~RangeItem () |
|
public RangeType rangeType () const |
|
public QmlJS::AST::Node * getAst () |
Returns internal AST node. |
public RangeItem * getParent () |
Returns the parent of this item, or nullptr if there isn't any. |
public void appendObject ( RangeObject * child) |
Appends an object to this item. |
public inline virtual void appendProperty ( RangeProperty *) |
Appends a property to this item. |
enum RangeType |
Members
public inline virtual
~RangeItem
()
public RangeType
rangeType
() const
public QmlJS::AST::Node *
getAst
()
Returns internal AST node.
public
RangeItem
*
getParent
()
Returns the parent of this item, or nullptr if there isn't any.
public void
appendObject
(
RangeObject
* child)
Appends an object to this item.
public inline virtual void
appendProperty
(
RangeProperty
*)
Appends a property to this item.
enum
RangeType
Values | Descriptions |
---|---|
Property | |
Object |
class lv::DocumentQmlValueObjects::RangeProperty
class lv::DocumentQmlValueObjects::RangeProperty
: public lv::DocumentQmlValueObjects::RangeItem
Property range item inside the ierarchy.
Summary
Members | Descriptions |
---|---|
public QmlJS::AST::Node * ast |
Internal AST node. |
public RangeItem * parent |
Parent of this item. |
public RangeObject * child |
Child object of this property if it has any. |
public int begin |
Start range of this property. |
public int propertyEnd |
Returns the end of this property's identifier declaration. |
public int valueBegin |
Returns the starting position of this property's value declaration. |
public int end |
Returns the end of this property. |
public inline RangeProperty () |
|
public inline ~RangeProperty () |
|
public inline virtual void appendObject ( RangeObject * object) |
Sets the value of this property to the specified object. |
public inline virtual RangeType rangeType () const |
|
public inline virtual QmlJS::AST::Node * getAst () |
Returns internal AST node. |
public inline virtual RangeItem * getParent () |
Returns the parent of this item, or nullptr if there isn't any. |
public QStringList name () const |
Returns the name chain of this property. |
public QStringList object () const |
Returns the declared object chain this property belongs to. |
public QString type () const |
Returns the declared type of this property if it has any. |
public bool hasType () const |
Returns true if this property's type was declared within this document, false otherwise. |
Members
public QmlJS::AST::Node *
ast
Internal AST node.
public
RangeItem
*
parent
Parent of this item.
public
RangeObject
*
child
Child object of this property if it has any.
public int
begin
Start range of this property.
public int
propertyEnd
Returns the end of this property's identifier declaration.
public int
valueBegin
Returns the starting position of this property's value declaration.
public int
end
Returns the end of this property.
public inline
RangeProperty
()
public inline
~RangeProperty
()
public inline virtual void
appendObject
(
RangeObject
* object)
Sets the value of this property to the specified object.
public inline virtual RangeType
rangeType
() const
public inline virtual QmlJS::AST::Node *
getAst
()
Returns internal AST node.
public inline virtual
RangeItem
*
getParent
()
Returns the parent of this item, or nullptr if there isn't any.
public QStringList
name
() const
Returns the name chain of this property.
For example
border.size : 20 // will return border.size
public QStringList
object
() const
Returns the declared object chain this property belongs to.
Returns the object type chain for this property.
public QString
type
() const
Returns the declared type of this property if it has any.
Returns the type of this property.
public bool
hasType
() const
Returns true if this property's type was declared within this document, false otherwise.
Checks wether this property was declared with a type.
Returns
True on success, false otherwise
class lv::DocumentQmlValueObjects::RangeObject
class lv::DocumentQmlValueObjects::RangeObject
: public lv::DocumentQmlValueObjects::RangeItem
Object range item inside the hierarchy.
Summary
Members | Descriptions |
---|---|
public QmlJS::AST::Node * ast |
Internal AST node. |
public RangeItem * parent |
Parent of this object. |
public QList< RangeObject * > children |
Children for this object. |
public QList< RangeProperty * > properties |
Properties for this obejct. |
public int begin |
Start position for this object. |
public int end |
End position for this object. |
public int identifierEnd |
|
public inline RangeObject () |
|
public inline ~RangeObject () |
|
public inline virtual RangeType rangeType () const |
|
public inline virtual void appendObject ( RangeObject * child) |
Appends a child object to this object. |
public inline virtual void appendProperty ( RangeProperty * property) |
Appends a property to this object. |
public inline virtual QmlJS::AST::Node * getAst () |
Returns internal AST node. |
public inline virtual RangeItem * getParent () |
Returns the parent of this object, or nullptr if there isn't any. |
Members
public QmlJS::AST::Node *
ast
Internal AST node.
public
RangeItem
*
parent
Parent of this object.
public QList<
RangeObject
* >
children
Children for this object.
public QList<
RangeProperty
* >
properties
Properties for this obejct.
public int
begin
Start position for this object.
public int
end
End position for this object.
public int
identifierEnd
public inline
RangeObject
()
public inline
~RangeObject
()
public inline virtual RangeType
rangeType
() const
public inline virtual void
appendObject
(
RangeObject
* child)
Appends a child object to this object.
public inline virtual void
appendProperty
(
RangeProperty
* property)
Appends a property to this object.
public inline virtual QmlJS::AST::Node *
getAst
()
Returns internal AST node.
public inline virtual
RangeItem
*
getParent
()
Returns the parent of this object, or nullptr if there isn't any.
class lv::DocumentQmlValueObjects
Contains the ierarchy of Qml objects and a reference to their AST.
This class can be used to extract parsed objects and their properties using their range and position in code.
Summary
Members | Descriptions |
---|---|
public ~DocumentQmlValueObjects () |
DocumentQmlValueObjects destructor. |
public inline RangeObject * root () |
Returns the root node of this ierarchy. |
public QString toString () const |
String representation of this object. |
public void visit (QmlJS::AST::Node * astroot) |
Visitor method implementation. |
public QList< RangeProperty * > propertiesBetween (int start,int end, RangeObject * root) |
Returns the properties between start and end for the given root object. |
public QList< RangeObject * > objectsBetween (int start,int end, RangeObject * root) |
|
public RangeObject * objectAtPosition (int position, RangeObject * root) |
|
public RangeObject * objectThatWrapsPosition (int position, RangeObject * root) |
|
typedef Ptr |
Shared Pointer to a lv::DocumentQmlValueObjects. |
typedef ConstPtr |
Const Shared Pointer to a lv::DocumentQmlValueObjects. |
Members
public
~DocumentQmlValueObjects
()
DocumentQmlValueObjects destructor.
public inline
RangeObject
*
root
()
Returns the root node of this ierarchy.
public QString
toString
() const
String representation of this object.
Will output the hierarchy of nodes defined in this object
public void
visit
(QmlJS::AST::Node * astroot)
Visitor method implementation.
public QList<
RangeProperty
* >
propertiesBetween
(int start,int end,
RangeObject
* root)
Returns the properties between start
and end
for the given root
object.
public QList<
RangeObject
* >
objectsBetween
(int start,int end,
RangeObject
* root)
public
RangeObject
*
objectAtPosition
(int position,
RangeObject
* root)
public
RangeObject
*
objectThatWrapsPosition
(int position,
RangeObject
* root)
typedef
Ptr
Shared Pointer to a lv::DocumentQmlValueObjects.
typedef
ConstPtr
Const Shared Pointer to a lv::DocumentQmlValueObjects.
class lv::LanguageQmlHandler
class lv::LanguageQmlHandler
: public QObject
Main code handler for the qml extension.
Handles code completion, palette control, property and item searching.
Summary
Members | Descriptions |
---|---|
public explicit LanguageQmlHandler ( ViewEngine * engine, Project * project,QmlJsSettings * settings, ProjectQmlExtension * projectHandler, ProjectDocument * document, CodeHandler * handler) |
LanguageQmlHandler constructor. |
public ~LanguageQmlHandler () |
LanguageQmlHandler destructor. |
public void assistCompletion (QTextCursor & cursor,const QChar & insertion,bool manuallyTriggered, CodeCompletionModel * model,QTextCursor & cursorChange) |
Implementation of code completion assist. |
public inline ProjectDocument * document () const |
|
public void rehighlightBlock (const QTextBlock & block) |
Calls a new rehighlight on the specified block. |
public QmlDeclaration::Ptr
getDeclarationViaCompletionContext (int position) |
|
public QList< lv::QmlDeclaration::Ptr > getDeclarationsViaParsedDocument (int position,int length) |
|
public QList< lv::QmlDeclaration::Ptr > getDeclarations (int position,int length) |
Get a list of declarations from a specific cursor. |
public QmlEditFragment * createInjectionChannel ( QmlDeclaration::Ptr property, QmlEditFragment * parent) |
Creates an injection channel between a declaration and the runtime. |
public bool addEditFragment ( QmlEditFragment * edit) |
Adds an editing fragment to the current document. |
public void removeEditFragment ( QmlEditFragment * edit) |
Removes an editing fragment from this document. |
public inline QmlJsSettings * settings () |
Returns the settings associated with this object. |
public void suggestionsForProposedExpression ( QmlDeclaration::Ptr declaration,const QString & expression, CodeCompletionModel * model,bool suggestFunctions) const |
|
public bool findBindingForExpression ( QmlEditFragment * edit,const QString & expression) |
|
public bool findFunctionBindingForExpression ( QmlEditFragment * edit,const QString & expression) |
|
public QmlUsageGraphScanner * createScanner () |
|
public void newDocumentScanReady ( DocumentQmlInfo::Ptr documentInfo) |
Handler for when a new document scope is ready. |
public inline QmlEditFragmentContainer * editContainer () |
|
public inline DocumentQmlChannels * bindingChannels () const |
|
public CodeHandler * code () const |
|
public QmlEditFragment * importsFragment () const |
|
public void setImportsFragment ( QmlEditFragment * importsFragment) |
|
public QmlEditFragment * rootFragment () const |
|
public void setRootFragment ( QmlEditFragment * rootFragment) |
|
public QmlInheritanceInfo
inheritanceInfo (const QmlTypeReference & name,int position) |
|
{signal} public void importsFragmentChanged () |
|
{signal} public void rootFragmentChanged () |
|
{slot} public bool areImportsScanned () |
|
{slot} public lv::QmlEditFragment * findObjectFragmentByPosition (int position) |
|
{slot} public lv::QmlEditFragment * findFragmentByPosition (int position) |
|
{slot} public void onDocumentParsed (QJSValue callback) |
|
{slot} public void onImportsScanned (QJSValue callback) |
|
{slot} public void removeSyncImportsListeners () |
|
{slot} public QList< int > languageFeatures () const |
|
{slot} public QString help (int position) |
|
{slot} public void toggleComment (int position,int length) |
|
{slot} public lv::QmlEditFragment * openConnection (int position) |
|
{slot} public lv::QmlEditFragment * openNestedConnection ( lv::QmlEditFragment * edit,int position) |
|
{slot} public lv::QmlEditFragment * openReadOnlyPropertyConnection ( lv::QmlEditFragment * parentFragment,QString name) |
|
{slot} public QList< QObject * > openNestedFragments ( lv::QmlEditFragment * edit,const QJSValue & options) |
|
{slot} public QJSValue editFragments () |
|
{slot} public void removeConnection ( lv::QmlEditFragment * edit) |
|
{slot} public void eraseObject ( lv::QmlEditFragment * edit,bool removeFragment) |
|
{slot} public QString defaultPalette ( lv::QmlEditFragment * fragment) |
|
{slot} public QJSValue findPalettesForFragment ( lv::QmlEditFragment * fragment) |
|
{slot} public QJSValue findPalettes (int position) |
Finds the available list of palettes at the current cursor position. |
{slot} public lv::QmlEditFragment * removePalette ( lv::CodePalette * palette) |
Removes a palette given its container object. |
{slot} public lv::CodePalette * openBinding ( lv::QmlEditFragment * edit,QString paletteName) |
Open a specific binding palette for edit fragment given a paletteList and an index . |
{slot} public void closeBinding (int position,int length) |
Closes the bindings between the given position and length. |
{slot} public QJSValue expand ( lv::QmlEditFragment * edit,const QJSValue & val) |
|
{slot} public QJSValue declarationInfo (int position,int length) |
|
{slot} public QJSValue contextBlockRange (int cursorPosition) |
Finds the boundaries of the code block containing the cursor position. |
{slot} public QJSValue getDocumentIds () |
|
{slot} public int checkPragma (int position) |
|
{slot} public lv::QmlMetaTypeInfo * typeInfo (const QJSValue & typeOrFragment) |
|
{slot} public lv::QmlImportsModel * importsModel () |
|
{slot} public int findImportsPosition () |
|
{slot} public int findRootPosition () |
|
{slot} public void suggestCompletion (int cursorPosition) |
|
{slot} public lv::CodePalette * edit ( lv::QmlEditFragment * ef) |
Opens an editing palette for the given edit fragment. |
{slot} public void cancelEdit () |
Cancels the current editing palette. |
{slot} public lv::QmlAddContainer * getAddOptions (QJSValue value) |
Get the insertion options at the given position . |
{slot} public QJSValue addPropertyToCode (int position,const QString & name,const QString & value, lv::QmlEditFragment * parentGroup) |
Add a property given the addText at the specified position . |
{slot} public int addObjectToCode (int position,const QJSValue & type,const QJSValue & properties) |
Adds an item given the addText at the specitied position . |
{slot} public int addEventToCode (int position,const QString & name) |
|
{slot} public void createObjectForProperty ( lv::QmlEditFragment * propertyFragment) |
|
{slot} public void createObjectInRuntime ( lv::QmlEditFragment * edit,const QJSValue & typeOptions,const QJSValue & properties) |
|
{slot} public void createRootObjectInRuntime (const QJSValue & typeOptions,const QJSValue & properties) |
|
{slot} public void __whenLibraryScanQueueCleared () |
|
{slot} public void __updateScope () |
Called when a new scope is available from the scanMonitor. |
{slot} public void __documentContentsChanged (int position,int charsRemoved,int charsAdded) |
DocumentContentsChanged handler. |
{slot} public void __documentFormatUpdate (int position,int length) |
|
{slot} public void __cursorWritePositionChanged (QTextCursor cursor) |
|
{slot} public void __newProjectScopeReady () |
Handler for when a new project scope is ready. |
{slot} public void __aboutToDelete () |
Members
public explicit
LanguageQmlHandler
(
ViewEngine
* engine,
Project
* project,QmlJsSettings * settings,
ProjectQmlExtension
* projectHandler,
ProjectDocument
* document,
CodeHandler
* handler)
LanguageQmlHandler constructor.
This is called through the ProjectQmlHandler.
public
~LanguageQmlHandler
()
LanguageQmlHandler destructor.
public void
assistCompletion
(QTextCursor & cursor,const QChar & insertion,bool manuallyTriggered,
CodeCompletionModel
* model,QTextCursor & cursorChange)
Implementation of code completion assist.
Handles bracket and paranthesis auto-completion together with suggestions population.
public inline
ProjectDocument
*
document
() const
public void
rehighlightBlock
(const QTextBlock & block)
Calls a new rehighlight on the specified block.
public
QmlDeclaration::Ptr
getDeclarationViaCompletionContext
(int position)
public QList<
lv::QmlDeclaration::Ptr
>
getDeclarationsViaParsedDocument
(int position,int length)
public QList<
lv::QmlDeclaration::Ptr
>
getDeclarations
(int position,int length)
Get a list of declarations from a specific cursor.
public
QmlEditFragment
*
createInjectionChannel
(
QmlDeclaration::Ptr
property,
QmlEditFragment
* parent)
Creates an injection channel between a declaration and the runtime.
This method will find all binding channels available by parsing the contents of the code structure, creating a set of binding pahts that describe where each component resides, and use those binding paths to connect the position of the code structure to the same values within the runtime.
public bool
addEditFragment
(
QmlEditFragment
* edit)
Adds an editing fragment to the current document.
public void
removeEditFragment
(
QmlEditFragment
* edit)
Removes an editing fragment from this document.
public inline QmlJsSettings *
settings
()
Returns the settings associated with this object.
public void
suggestionsForProposedExpression
(
QmlDeclaration::Ptr
declaration,const QString & expression,
CodeCompletionModel
* model,bool suggestFunctions) const
public bool
findBindingForExpression
(
QmlEditFragment
* edit,const QString & expression)
public bool
findFunctionBindingForExpression
(
QmlEditFragment
* edit,const QString & expression)
public
QmlUsageGraphScanner
*
createScanner
()
public void
newDocumentScanReady
(
DocumentQmlInfo::Ptr
documentInfo)
Handler for when a new document scope is ready.
public inline
QmlEditFragmentContainer
*
editContainer
()
public inline DocumentQmlChannels *
bindingChannels
() const
public
CodeHandler
*
code
() const
public
QmlEditFragment
*
importsFragment
() const
public void
setImportsFragment
(
QmlEditFragment
* importsFragment)
public
QmlEditFragment
*
rootFragment
() const
public void
setRootFragment
(
QmlEditFragment
* rootFragment)
public
QmlInheritanceInfo
inheritanceInfo
(const
QmlTypeReference
& name,int position)
{signal} public void
importsFragmentChanged
()
{signal} public void
rootFragmentChanged
()
{slot} public bool
areImportsScanned
()
{slot} public
lv::QmlEditFragment
*
findObjectFragmentByPosition
(int position)
{slot} public
lv::QmlEditFragment
*
findFragmentByPosition
(int position)
{slot} public void
onDocumentParsed
(QJSValue callback)
{slot} public void
onImportsScanned
(QJSValue callback)
{slot} public void
removeSyncImportsListeners
()
{slot} public QList< int >
languageFeatures
() const
{slot} public QString
help
(int position)
{slot} public void
toggleComment
(int position,int length)
{slot} public
lv::QmlEditFragment
*
openConnection
(int position)
{slot} public
lv::QmlEditFragment
*
openNestedConnection
(
lv::QmlEditFragment
* edit,int position)
{slot} public
lv::QmlEditFragment
*
openReadOnlyPropertyConnection
(
lv::QmlEditFragment
* parentFragment,QString name)
{slot} public QList< QObject * >
openNestedFragments
(
lv::QmlEditFragment
* edit,const QJSValue & options)
{slot} public QJSValue
editFragments
()
{slot} public void
removeConnection
(
lv::QmlEditFragment
* edit)
{slot} public void
eraseObject
(
lv::QmlEditFragment
* edit,bool removeFragment)
{slot} public QString
defaultPalette
(
lv::QmlEditFragment
* fragment)
{slot} public QJSValue
findPalettesForFragment
(
lv::QmlEditFragment
* fragment)
{slot} public QJSValue
findPalettes
(int position)
Finds the available list of palettes at the current cursor
position.
{slot} public
lv::QmlEditFragment
*
removePalette
(
lv::CodePalette
* palette)
Removes a palette given its container object.
{slot} public
lv::CodePalette
*
openBinding
(
lv::QmlEditFragment
* edit,QString paletteName)
Open a specific binding palette for edit
fragment given a paletteList
and an index
.
Returns
A pointer to the opened lv::CodePalette.
{slot} public void
closeBinding
(int position,int length)
Closes the bindings between the given position and length.
{slot} public QJSValue
expand
(
lv::QmlEditFragment
* edit,const QJSValue & val)
{slot} public QJSValue
declarationInfo
(int position,int length)
{slot} public QJSValue
contextBlockRange
(int cursorPosition)
Finds the boundaries of the code block containing the cursor position.
Mostly used for fragments
{slot} public QJSValue
getDocumentIds
()
{slot} public int
checkPragma
(int position)
{slot} public
lv::QmlMetaTypeInfo
*
typeInfo
(const QJSValue & typeOrFragment)
{slot} public
lv::QmlImportsModel
*
importsModel
()
{slot} public int
findImportsPosition
()
{slot} public int
findRootPosition
()
{slot} public void
suggestCompletion
(int cursorPosition)
{slot} public
lv::CodePalette
*
edit
(
lv::QmlEditFragment
* ef)
Opens an editing palette for the given edit
fragment.
{slot} public void
cancelEdit
()
Cancels the current editing palette.
{slot} public lv::QmlAddContainer *
getAddOptions
(QJSValue value)
Get the insertion options at the given position
.
Returns an lv::QmlAddContainer for all the options
{slot} public QJSValue
addPropertyToCode
(int position,const QString & name,const QString & value,
lv::QmlEditFragment
* parentGroup)
Add a property given the addText
at the specified position
.
{slot} public int
addObjectToCode
(int position,const QJSValue & type,const QJSValue & properties)
Adds an item given the addText
at the specitied position
.
{slot} public int
addEventToCode
(int position,const QString & name)
{slot} public void
createObjectForProperty
(
lv::QmlEditFragment
* propertyFragment)
{slot} public void
createObjectInRuntime
(
lv::QmlEditFragment
* edit,const QJSValue & typeOptions,const QJSValue & properties)
{slot} public void
createRootObjectInRuntime
(const QJSValue & typeOptions,const QJSValue & properties)
{slot} public void
__whenLibraryScanQueueCleared
()
{slot} public void
__updateScope
()
Called when a new scope is available from the scanMonitor.
{slot} public void
__documentContentsChanged
(int position,int charsRemoved,int charsAdded)
DocumentContentsChanged handler.
{slot} public void
__documentFormatUpdate
(int position,int length)
{slot} public void
__cursorWritePositionChanged
(QTextCursor cursor)
{slot} public void
__newProjectScopeReady
()
Handler for when a new project scope is ready.
{slot} public void
__aboutToDelete
()
class lv::ProjectQmlExtension
class lv::ProjectQmlExtension
: public QObject
: public QQmlParserStatus
Main object used throughout qml extension plugin.
To capture the object, you can use the workspace layer:
var projectQmlExtension = lk.layers.workspace.extensions["editqml"].globals
Summary
Members | Descriptions |
---|---|
public ProjectQmlExtension (QObject * parent) |
ProjectQmlExtension constructor with a parent parameter. |
public virtual ~ProjectQmlExtension () |
ProjectQmlExtension destructor. |
public void classBegin () |
Override of QQmlParserStatus::classBegin. |
public void componentComplete () |
Override of QQmlParserStatus::componentComplete. |
public inline QmlProjectMonitor * scanMonitor () |
Returns the lv::ProjectQmlScanMonitor associated with this object. |
public inline QmlBindingChannelsDispatcher * channelsDispatcher () |
Returns the channels dispatcher. |
public void addLanguageQmlHandler ( LanguageQmlHandler * handler) |
Adds a codeHandler to this object. |
public void removeLanguageQmlHandler ( LanguageQmlHandler * handler) |
Removes the handler from this object. |
public inline PaletteLoader * paletteContainer () |
Returns the lv::PaletteContainer associated with this object. |
public void setParams ( Settings * settings, Project * project, ViewEngine * engine,Workspace * workspace) |
Assign initialization params for this object. |
public inline Project * project () |
Returns the global lv::Project. |
{slot} public QObject * createHandler ( ProjectDocument * document, CodeHandler * handler) |
Creates a LanguageQmlHandler for the given document . |
Members
public
ProjectQmlExtension
(QObject * parent)
ProjectQmlExtension constructor with a parent
parameter.
public virtual
~ProjectQmlExtension
()
ProjectQmlExtension destructor.
public void
classBegin
()
Override of QQmlParserStatus::classBegin.
public void
componentComplete
()
Override of QQmlParserStatus::componentComplete.
public inline QmlProjectMonitor *
scanMonitor
()
Returns the lv::ProjectQmlScanMonitor associated with this object.
public inline QmlBindingChannelsDispatcher *
channelsDispatcher
()
Returns the channels dispatcher.
public void
addLanguageQmlHandler
(
LanguageQmlHandler
* handler)
Adds a codeHandler to this object.
CodeHandlers are updated each time the engine recompiles the code.
public void
removeLanguageQmlHandler
(
LanguageQmlHandler
* handler)
Removes the handler
from this object.
Note that this does not destroy the object.
public inline
PaletteLoader
*
paletteContainer
()
Returns the lv::PaletteContainer associated with this object.
public void
setParams
(
Settings
* settings,
Project
* project,
ViewEngine
* engine,Workspace * workspace)
Assign initialization params for this object.
public inline
Project
*
project
()
Returns the global lv::Project.
{slot} public QObject *
createHandler
(
ProjectDocument
* document,
CodeHandler
* handler)
Creates a LanguageQmlHandler for the given document
.
class lv::ProjectQmlScope
class lv::ProjectQmlScope
: public QObject
Contains all the loaded plugins of a project.
Summary
Members | Descriptions |
---|---|
public ~ProjectQmlScope () |
ProjectQmlScope destructor. |
public QmlLibraryInfo::Ptr addQmlGlobalLibrary (const QString & uri,int major,int minor) |
|
public QmlLibraryInfo::Ptr addQmlProjectLibrary (const QString & uri) |
|
public inline QList< QString > pathsForImport (const QString & importUri) |
Returns the stored paths for an import uri. |
public QString uriForPath (const QString & path) |
Returns the uri of a library from it's path. |
public inline void addDefaultLibraries (const QList< QString > & paths) |
Adds a set of paths to the default libraries. |
public inline const QList< QString > & defaultLibraries () const |
Returns the default libraries. |
public QmlLibraryInfo::Ptr libraryInfo (const QString & path) |
|
public bool libraryExists (const QString & path) |
|
public void addLibrary (const QString & path) |
|
public void assignLibrary (const QString & path,QmlLibraryInfo::Ptr libinfo) |
|
public void assignLibraries (const QHash< QString, QmlLibraryInfo::Ptr > & libinfos) |
|
public int totalLibraries () const |
Returns the total number of global libraries. |
public QList< QmlLibraryInfo::Ptr > getLibrariesInPath (const QString & path) |
|
public void resetLibrariesInPath (const QString & path) |
|
public void resetLibrary (const QString & path) |
|
public QString toString () |
|
public inline QmlLanguageScanMonitor * languageScanMonitor () |
|
public QmlLanguageScanner * languageScanner () |
|
{signal} public void __processQueue () |
|
{signal} public void libraryScanQueueCleared () |
|
{slot} public void __libraryUpdates () |
|
typedef ConstPtr |
Constant SharedPointer to ProjectQmlScope. |
typedef Ptr |
SharedPointer to ProjectQmlScope. |
Members
public
~ProjectQmlScope
()
ProjectQmlScope destructor.
public QmlLibraryInfo::Ptr
addQmlGlobalLibrary
(const QString & uri,int major,int minor)
public QmlLibraryInfo::Ptr
addQmlProjectLibrary
(const QString & uri)
public inline QList< QString >
pathsForImport
(const QString & importUri)
Returns the stored paths for an import uri.
public QString
uriForPath
(const QString & path)
Returns the uri of a library from it's path.
public inline void
addDefaultLibraries
(const QList< QString > & paths)
Adds a set of paths to the default libraries.
public inline const QList< QString > &
defaultLibraries
() const
Returns the default libraries.
public QmlLibraryInfo::Ptr
libraryInfo
(const QString & path)
public bool
libraryExists
(const QString & path)
public void
addLibrary
(const QString & path)
public void
assignLibrary
(const QString & path,QmlLibraryInfo::Ptr libinfo)
public void
assignLibraries
(const QHash< QString, QmlLibraryInfo::Ptr > & libinfos)
public int
totalLibraries
() const
Returns the total number of global libraries.
public QList< QmlLibraryInfo::Ptr >
getLibrariesInPath
(const QString & path)
public void
resetLibrariesInPath
(const QString & path)
public void
resetLibrary
(const QString & path)
public QString
toString
()
public inline
QmlLanguageScanMonitor
*
languageScanMonitor
()
public
QmlLanguageScanner
*
languageScanner
()
{signal} public void
__processQueue
()
{signal} public void
libraryScanQueueCleared
()
{slot} public void
__libraryUpdates
()
typedef
ConstPtr
Constant SharedPointer to ProjectQmlScope.
typedef
Ptr
SharedPointer to ProjectQmlScope.
class lv::QmlCompletionContext
class lv::QmlCompletionContext
: public lv::CodeCompletionContext
Contains a qml code completion context.
You can use the QmlCompletionContextFinder to find such a context at a given cursor position.
To find out the actual context state, use the QmlCompletionContext::context method.
QTextCursor cursor(document);
cursor.setPosition(100);
QmlCompletionContextFinder finder;
QmlCompltionContext::ConstPtr context = finder.getContext(cursor);
vlog() << (context->context() == QmlCompletionContext::InImport);
For a string based output, QmlCompletionContext::contextString() will give a concatenated string of the states
// ...
QmlCompletionContext::ConstPtr context = finder.getContext(cursor);
vlog() << context->contextString();
Summary
Members | Descriptions |
---|---|
public ~QmlCompletionContext () |
Completion context destructor. |
public inline int context () const |
Returns the current context state. |
public QString contextString () const |
Returns the context a string of concatenated states. |
public inline QString objectTypeName () const |
Returns the object typename for this context if it has any, or an empty string if it hasn't been captured. |
public inline const QStringList & objectTypePath () const |
Returns the object type for this context, or an empty list if it hasn't been captured. |
public inline QString propertyName () const |
Returns the property name for this completion context, or an empty string if it hasn't been captured. |
public inline const QStringList & propertyPath () const |
Returns the property type for this context, or an empty list if it hasn't been captured. |
public inline int propertyPosition () const |
Returns the property start position for this context, or -1 if it hasn't been captured. |
public inline const QStringList & expressionPath () const |
Returns the current expression the cursor is under. |
public bool operator== (const QmlCompletionContext & other) const |
Returns true if this QmlCompletionContext is equal to other, false otherwise. |
public bool operator!= (const QmlCompletionContext & other) const |
Returns true if this QmlCompletionContext is not equal to other, false otherwise. |
protected QmlCompletionContext (int context,const QStringList & objectTypePath,const QStringList & propertyPath,const QStringList & expressionPath,int propertyPosition) |
QmlCompletionContext constructor. |
enum Context |
Context state |
typedef ConstPtr |
Shared const pointer to QmlCompletionContext |
typedef Ptr |
Shared pointer to QmlCompletionContext |
Members
public
~QmlCompletionContext
()
Completion context destructor.
public inline int
context
() const
Returns the current context state.
public QString
contextString
() const
Returns the context a string of concatenated states.
public inline QString
objectTypeName
() const
Returns the object typename for this context if it has any, or an empty string if it hasn't been captured.
public inline const QStringList &
objectTypePath
() const
Returns the object type for this context, or an empty list if it hasn't been captured.
public inline QString
propertyName
() const
Returns the property name for this completion context, or an empty string if it hasn't been captured.
public inline const QStringList &
propertyPath
() const
Returns the property type for this context, or an empty list if it hasn't been captured.
public inline int
propertyPosition
() const
Returns the property start position for this context, or -1 if it hasn't been captured.
public inline const QStringList &
expressionPath
() const
Returns the current expression the cursor is under.
public bool
operator==
(const
QmlCompletionContext
& other) const
Returns true if this QmlCompletionContext is equal to other, false otherwise.
public bool
operator!=
(const
QmlCompletionContext
& other) const
Returns true if this QmlCompletionContext is not equal to other, false otherwise.
protected
QmlCompletionContext
(int context,const QStringList & objectTypePath,const QStringList & propertyPath,const QStringList & expressionPath,int propertyPosition)
QmlCompletionContext constructor.
Use lv::QmlCompletionContext::create() to create a new completion context.
enum
Context
Values | Descriptions |
---|---|
InImport | Context is within an import statement |
InImportVersion | Context is within an import statement at the version section |
InQml | Context is within qml |
InLhsOfBinding | Context is within the left side of the binding |
InRhsofBinding | Context is within the right side of the binding |
InAfterOnLhsOfBinding | Context is within the right side of a slot binding |
InStringLiteral | Context is within a string literal |
Context state
typedef
ConstPtr
Shared const pointer to QmlCompletionContext
typedef
Ptr
Shared pointer to QmlCompletionContext
class lv::QmlDeclaration
Holds a qml property declaration.
Item{
property int declaration: 20
}
In the above case, the lv::QmlDeclaration has the following properties:
identifierChain : the property identifier, in this case
declaration
identifierPosition: position of the
declaration
propertyidentifierLength: length of the
declaration
propertytype: type of the
declaration
property, in this caseint
document: document where the
declaration
property was declaredlength: length of the declaration property
valueOffset: offset for the value of the
declaration
property, in this case it's the position of the number20
minus the position of the propertyvalueLength: length of the value for the
declaration
property, or2
section: A section within the project document
Summary
Members | Descriptions |
---|---|
public ~QmlDeclaration () |
QmlDeclaration destructor. |
public inline int identifierPosition () const |
Returns the identifier position. |
public inline int identifierLength () const |
Returns the identifier length. |
public inline int position () const |
Returns position of this declaration, equivalent to identifier position. |
public inline int valuePosition () const |
Returns the value position for this delcaration, calculated relative to the identifierPosition. |
public inline const QStringList & identifierChain () const |
Returns the identifierChain for this delcaration. |
public inline const QmlTypeReference & type () const |
Returns the type of this declaration. |
public inline const QmlTypeReference & parentType () const |
Returns the object type for this declaration. |
public inline ProjectDocument * document () |
Returns the document this declaration is in. |
public inline int length () const |
Returns the length of this declaration. |
public inline int valueOffset () const |
Returns the valueOffset for this declaration. |
public inline void setValuePositionOffset (int positionOffset) |
Assings a new positionOffset for this declaration. |
public int valueObjectScopeOffset () const |
If this declaration is a property and initialises an object, this will return the start of the object scope. |
public void setValueObjectScopeOffset (int objectScopeOffset) |
If this declaration is a property and initialises an object, this will set the start of the object scope. |
public inline int valueLength () const |
Returns the value lenght of this declaration. |
public inline void setValueLength (int valueLength) |
Sets the value length of this declaration. |
public inline ProjectDocumentSection::Ptr
section () |
Returns the current lv::ProjectDocument section. |
public inline void setSection ( ProjectDocumentSection::Ptr section) |
Assigns the lv::ProjectDocument section. |
public inline bool isForList () const |
Checks wether this is a list-child declaration instead of a property-based one. |
public bool isForObject () const |
Returns true if this declaration is for an object. |
public bool isForComponent () const |
Returns true if this declaration is for a component. |
public bool isForProperty () const |
Returns true if this declaration is for a property. |
public bool isForSlot () const |
Returns true if this declaration is for a slot. |
public bool isForImports () const |
|
public inline bool isWritable () const |
|
enum SectionType |
ProjectDocument section type. |
typedef Ptr |
Shared pointer to QmlDeclaration |
typedef ConstPtr |
Shared const pointer to QmlDeclaration |
Members
public
~QmlDeclaration
()
QmlDeclaration destructor.
public inline int
identifierPosition
() const
Returns the identifier position.
public inline int
identifierLength
() const
Returns the identifier length.
public inline int
position
() const
Returns position of this declaration, equivalent to identifier position.
public inline int
valuePosition
() const
Returns the value position for this delcaration, calculated relative to the identifierPosition.
public inline const QStringList &
identifierChain
() const
Returns the identifierChain for this delcaration.
public inline const
QmlTypeReference
&
type
() const
Returns the type of this declaration.
public inline const
QmlTypeReference
&
parentType
() const
Returns the object type for this declaration.
public inline
ProjectDocument
*
document
()
Returns the document this declaration is in.
public inline int
length
() const
Returns the length of this declaration.
public inline int
valueOffset
() const
Returns the valueOffset for this declaration.
public inline void
setValuePositionOffset
(int positionOffset)
Assings a new positionOffset
for this declaration.
public int
valueObjectScopeOffset
() const
If this declaration is a property and initialises an object, this will return the start of the object scope.
public void
setValueObjectScopeOffset
(int objectScopeOffset)
If this declaration is a property and initialises an object, this will set the start of the object scope.
public inline int
valueLength
() const
Returns the value lenght of this declaration.
public inline void
setValueLength
(int valueLength)
Sets the value length of this declaration.
public inline
ProjectDocumentSection::Ptr
section
()
Returns the current lv::ProjectDocument section.
public inline void
setSection
(
ProjectDocumentSection::Ptr
section)
Assigns the lv::ProjectDocument section.
public inline bool
isForList
() const
Checks wether this is a list-child declaration instead of a property-based one.
public bool
isForObject
() const
Returns true if this declaration is for an object.
public bool
isForComponent
() const
Returns true if this declaration is for a component.
public bool
isForProperty
() const
Returns true if this declaration is for a property.
public bool
isForSlot
() const
Returns true if this declaration is for a slot.
public bool
isForImports
() const
public inline bool
isWritable
() const
enum
SectionType
Values | Descriptions |
---|---|
Section | Section type |
ProjectDocument section type.
typedef
Ptr
Shared pointer to QmlDeclaration
typedef
ConstPtr
Shared const pointer to QmlDeclaration
class lv::QmlEditFragment
class lv::QmlEditFragment
: public QObject
An editing fragment for a lv::ProjectDocument.
An editing fragment represents a section within a lv::ProjectDocument that is connected to the running application. Fragments have palettes associated with them, and can write code based on the given value of a palette. They provide the set of binding channels connected to the application.
Summary
Members | Descriptions |
---|---|
public QmlEditFragment ( QmlDeclaration::Ptr declaration, lv::LanguageQmlHandler * codeHandler,QObject * parent) |
QmlEditFragment contructor. |
public virtual ~QmlEditFragment () |
QmlEditFragment destructor. |
public void setPaletteForBinding ( CodePalette * palette) |
|
public inline bool hasPalette ( CodePalette * palette) |
|
public CodePalette * palette (const QString & type) |
|
public void addPalette ( CodePalette * palette) |
|
public void removePalette ( CodePalette * palette) |
|
public inline QList< CodePalette * >::iterator begin () |
|
public inline QList< CodePalette * >::iterator end () |
|
public void removeBindingPalette () |
|
public void setBindingPalette ( CodePalette * palette) |
|
public void addChildFragment ( QmlEditFragment * edit) |
|
public QmlEditFragment * findChildFragment ( QmlEditFragment * edit) |
|
public inline QmlDeclaration::Ptr
declaration () const |
Returns the lv::CodeDeclaration associated with this object. |
public void updatePaletteValue ( CodePalette * palette) |
|
public void initializePaletteValue ( CodePalette * palette) |
|
public inline QObject * visualParent () const |
|
public inline void setVisualParent (QObject * visualParent) |
|
public QmlEditFragment * rootFragment () |
|
public void setObjectInitializeType (const QmlTypeReference & type) |
|
public const QmlTypeReference & objectInitializeType () const |
|
public void emitRemoval () |
|
public inline QJSValue & whenBinding () |
|
public inline void setWhenBinding (const QJSValue & whenBinding) |
|
public void setChannel (QSharedPointer< QmlBindingChannel > channel) |
|
public inline const QSharedPointer< QmlBindingChannel > channel () const |
|
public QSharedPointer< QmlBindingPath > fullBindingPath () |
|
public Location location () const |
|
public Location valueLocation () const |
|
public bool isWritable () const |
|
public inline lv::LanguageQmlHandler * language () const |
|
public void setObjectId (QString id) |
|
public inline const QList< lv::QmlEditFragment * > & childFragments () |
|
public void checkIfGroup () |
|
public void removeFragmentType (FragmentType type) |
|
public void addFragmentType (FragmentType type) |
|
public bool isOfFragmentType (FragmentType type) const |
|
public bool isGroup () const |
|
{signal} public void visualParentChanged () |
|
{signal} public void connectionChanged (int index) |
|
{signal} public void aboutToRemovePalette ( lv::CodePalette * palette) |
|
{signal} public void aboutToBeRemoved () |
|
{signal} public void paletteListEmpty () |
|
{signal} public void objectAdded ( lv::QmlEditFragment * obj) |
|
{signal} public void childAdded ( lv::QmlEditFragment * ef,QJSValue context) |
|
{signal} public void refCountChanged () |
|
{signal} public void whenBindingChanged () |
|
{signal} public void typeChanged () |
|
{signal} public void isNullChanged () |
|
{slot} public inline int position () |
|
{slot} public int valuePosition () const |
Returns the lv::QmlDeclaration's value postion. |
{slot} public int valueLength () const |
Returns the lv::QmlDeclaration's value length. |
{slot} public int length () const |
|
{slot} public QString type () const |
|
{slot} public QString typeName () const |
|
{slot} public QString identifier () const |
|
{slot} public QString objectInitializerType () const |
|
{slot} public QString objectId () |
|
{slot} public int fragmentType () const |
|
{slot} public bool isBuilder () const |
|
{slot} public void rebuild () |
|
{slot} public QStringList bindingPath () |
|
{slot} public bool isNull () |
|
{slot} public bool isMethod () |
|
{slot} public void commit (const QVariant & value) |
|
{slot} public QObject * readObject () |
|
{slot} public QObject * propertyObject () |
|
{slot} public QString defaultValue () const |
|
{slot} public QString readValueText () const |
Reads the code value of this fragment and returns it. |
{slot} public QJSValue readValueConnection () const |
|
{slot} public QVariant parse () |
|
{slot} public bool bindExpression (const QString & expression) |
|
{slot} public bool bindFunctionExpression (const QString & expression) |
|
{slot} public void writeProperties (const QJSValue & properties) |
|
{slot} public void write (const QJSValue options) |
|
{slot} public void writeCode (const QString & code) |
Writes the code to the value part of this fragment. |
{slot} public int totalPalettes () const |
|
{slot} public QJSValue paletteList () const |
|
{slot} public void removePalettes () |
|
{slot} public inline lv::CodePalette * bindingPalette () |
|
{slot} public void updateBindings () |
|
{slot} public lv::QmlEditFragment * parentFragment () |
|
{slot} public QJSValue getChildFragments () const |
|
{slot} public void removeChildFragment ( QmlEditFragment * edit) |
|
{slot} public void incrementRefCount () |
|
{slot} public void decrementRefCount () |
|
{slot} public int refCount () |
|
{slot} public void suggestionsForExpression (const QString & expression, lv::CodeCompletionModel * model,bool suggestFunctions) |
|
{slot} public void signalChildAdded ( lv::QmlEditFragment * ef,const QJSValue & context) |
|
{slot} public void __updateFromPalette () |
|
{slot} public void __updateValue () |
|
{slot} public void __channelObjectErased () |
|
{slot} public void __inputRunnableObjectReady () |
|
{slot} public void __selectedChannelChanged () |
|
enum SectionType |
ProjectDocument section type for this QmlEditFragment |
enum Location |
|
enum FragmentType |
Members
public
QmlEditFragment
(
QmlDeclaration::Ptr
declaration,
lv::LanguageQmlHandler
* codeHandler,QObject * parent)
QmlEditFragment contructor.
The Fragment is constructed from a declaration
object and a palette
object.
public virtual
~QmlEditFragment
()
QmlEditFragment destructor.
public void
setPaletteForBinding
(
CodePalette
* palette)
public inline bool
hasPalette
(
CodePalette
* palette)
public
CodePalette
*
palette
(const QString & type)
public void
addPalette
(
CodePalette
* palette)
public void
removePalette
(
CodePalette
* palette)
public inline QList<
CodePalette
* >::iterator
begin
()
public inline QList<
CodePalette
* >::iterator
end
()
public void
removeBindingPalette
()
public void
setBindingPalette
(
CodePalette
* palette)
public void
addChildFragment
(
QmlEditFragment
* edit)
public
QmlEditFragment
*
findChildFragment
(
QmlEditFragment
* edit)
public inline
QmlDeclaration::Ptr
declaration
() const
Returns the lv::CodeDeclaration associated with this object.
public void
updatePaletteValue
(
CodePalette
* palette)
public void
initializePaletteValue
(
CodePalette
* palette)
public inline QObject *
visualParent
() const
public inline void
setVisualParent
(QObject * visualParent)
public
QmlEditFragment
*
rootFragment
()
public void
setObjectInitializeType
(const
QmlTypeReference
& type)
public const
QmlTypeReference
&
objectInitializeType
() const
public void
emitRemoval
()
public inline QJSValue &
whenBinding
()
public inline void
setWhenBinding
(const QJSValue & whenBinding)
public void
setChannel
(QSharedPointer< QmlBindingChannel > channel)
public inline const QSharedPointer< QmlBindingChannel >
channel
() const
public QSharedPointer< QmlBindingPath >
fullBindingPath
()
public Location
location
() const
public Location
valueLocation
() const
public bool
isWritable
() const
public inline
lv::LanguageQmlHandler
*
language
() const
public void
setObjectId
(QString id)
public inline const QList<
lv::QmlEditFragment
* > &
childFragments
()
public void
checkIfGroup
()
public void
removeFragmentType
(FragmentType type)
public void
addFragmentType
(FragmentType type)
public bool
isOfFragmentType
(FragmentType type) const
public bool
isGroup
() const
{signal} public void
visualParentChanged
()
{signal} public void
connectionChanged
(int index)
{signal} public void
aboutToRemovePalette
(
lv::CodePalette
* palette)
{signal} public void
aboutToBeRemoved
()
{signal} public void
paletteListEmpty
()
{signal} public void
objectAdded
(
lv::QmlEditFragment
* obj)
{signal} public void
childAdded
(
lv::QmlEditFragment
* ef,QJSValue context)
{signal} public void
refCountChanged
()
{signal} public void
whenBindingChanged
()
{signal} public void
typeChanged
()
{signal} public void
isNullChanged
()
{slot} public inline int
position
()
{slot} public int
valuePosition
() const
Returns the lv::QmlDeclaration's value postion.
{slot} public int
valueLength
() const
Returns the lv::QmlDeclaration's value length.
{slot} public int
length
() const
{slot} public QString
type
() const
{slot} public QString
typeName
() const
{slot} public QString
identifier
() const
{slot} public QString
objectInitializerType
() const
{slot} public QString
objectId
()
{slot} public int
fragmentType
() const
{slot} public bool
isBuilder
() const
{slot} public void
rebuild
()
{slot} public QStringList
bindingPath
()
{slot} public bool
isNull
()
{slot} public bool
isMethod
()
{slot} public void
commit
(const QVariant & value)
{slot} public QObject *
readObject
()
{slot} public QObject *
propertyObject
()
{slot} public QString
defaultValue
() const
{slot} public QString
readValueText
() const
Reads the code value of this fragment and returns it.
{slot} public QJSValue
readValueConnection
() const
{slot} public QVariant
parse
()
{slot} public bool
bindExpression
(const QString & expression)
{slot} public bool
bindFunctionExpression
(const QString & expression)
{slot} public void
writeProperties
(const QJSValue & properties)
{slot} public void
write
(const QJSValue options)
{slot} public void
writeCode
(const QString & code)
Writes the code
to the value part of this fragment.
{slot} public int
totalPalettes
() const
{slot} public QJSValue
paletteList
() const
{slot} public void
removePalettes
()
{slot} public inline
lv::CodePalette
*
bindingPalette
()
{slot} public void
updateBindings
()
{slot} public
lv::QmlEditFragment
*
parentFragment
()
{slot} public QJSValue
getChildFragments
() const
{slot} public void
removeChildFragment
(
QmlEditFragment
* edit)
{slot} public void
incrementRefCount
()
{slot} public void
decrementRefCount
()
{slot} public int
refCount
()
{slot} public void
suggestionsForExpression
(const QString & expression,
lv::CodeCompletionModel
* model,bool suggestFunctions)
{slot} public void
signalChildAdded
(
lv::QmlEditFragment
* ef,const QJSValue & context)
{slot} public void
__updateFromPalette
()
{slot} public void
__updateValue
()
{slot} public void
__channelObjectErased
()
{slot} public void
__inputRunnableObjectReady
()
{slot} public void
__selectedChannelChanged
()
enum
SectionType
Values | Descriptions |
---|---|
Section | Section Value |
ProjectDocument section type for this QmlEditFragment
enum
Location
Values | Descriptions |
---|---|
Imports | |
Object | |
Component | |
Property | |
Slot |
enum
FragmentType
Values | Descriptions |
---|---|
Builder | |
ReadOnly | |
Group | |
GroupChild |