group lveditor

Contains editor functionality and extension hooks.

Summary

Members Descriptions
classlv::CodeCompletionContext Base class for a code completion context, to be stored in a CodeCompletionModel.
classlv::CodeCompletionModel Code Completion Model used by the code completion assist.
classlv::CodeCompletionSuggestion Code completion suggestion used in the QCodeCompletionModel.
classlv::DocumentHandler Complements TextEdit in handling documents.
classlv::CodePalette Palette display of a property.
classlv::EditorGlobalObject Global object used through LiveKeys just to have access to project and the palette container.
classlv::EditorSettings Wrapper around a settings file for the editor.
classlv::PaletteContainer Stores all the palettes that are available in LiveKeys.
classlv::Project Abstraction of the open project in LiveKeys.
classlv::ProjectDocumentMarker Dynamic project document markers.
classlv::ProjectDocument Wrapper for any opened document in LiveKeys.
classlv::ProjectDocumentAction Undo/redo implementation for project documents.
classlv::ProjectDocumentSection Dynamic project document section.
classlv::ProjectDocumentModel It's a model containing all of the open files in our Project.
classlv::ProjectEntry An entry within a LiveKeys project, either a folder or a file.
classlv::ProjectFile Specialization of ProjectEntry for files.
classlv::ProjectFileModel The model of the whole project file system used when opening a project in LiveKeys.

class lv::CodeCompletionContext

Base class for a code completion context, to be stored in a CodeCompletionModel.

Summary

Members Descriptions
public virtual~CodeCompletionContext() Empty destructor.

Members

public virtual~CodeCompletionContext()

Empty destructor.

class lv::CodeCompletionModel

class lv::CodeCompletionModel
  : public QAbstractListModel

Code Completion Model used by the code completion assist.

Summary

Members Descriptions
publicCodeCompletionModel(QObject * parent) Default constructor of CodeCompletionModel.
public~CodeCompletionModel() Default destructor for CodeCompletionModel.
public inline introwCount(const QModelIndex & parent) const Returns the number of model entries, specifically filtered suggestions.
public QVariantdata(const QModelIndex & index,int role) const Override of standard model function for fetching data.
public inline QHash< int, QByteArray >roleNames() const Role names in this model.
public inline intcompletionPosition() const Returns completion position.
public inline boolisEnabled() const Shows if completion is enabled.
public voidresetModel() Function to reset the internal model representation.
public voidsetSuggestions(const QList<CodeCompletionSuggestion> & suggestions,const QString & suggestionFilter) Simple function to assign code completion suggestions and filter.
public inline voidsetCompletionPosition(int index) Completion position setter.
public voidsetFilter(const QString & filter) Simple function to set the given filter.
public inline const QString &filter() const Getter of filter.
public inlineCodeCompletionContext*completionContext() Completion context getter.
public voidsetCompletionContext(CodeCompletionContext* context) Sets given code completion context.
public voidremoveCompletionContext() Deletes the internal completion context.
{signal} public voidcompletionPositionChanged(int arg) completion position changed
{signal} public voidisEnabledChanged(bool arg) Shows if enabled state changed
{slot} public inline voidenable() Enables the model.
{slot} public inline voiddisable() Disables the model.
{slot} public inline intsuggestionCount() const Returns the number of model entries.
enumRoles Roles of the model.

Members

publicCodeCompletionModel(QObject * parent)

Default constructor of CodeCompletionModel.

public~CodeCompletionModel()

Default destructor for CodeCompletionModel.

public inline introwCount(const QModelIndex & parent) const

Returns the number of model entries, specifically filtered suggestions.

public QVariantdata(const QModelIndex & index,int role) const

Override of standard model function for fetching data.

public inline QHash< int, QByteArray >roleNames() const

Role names in this model.

public inline intcompletionPosition() const

Returns completion position.

public inline boolisEnabled() const

Shows if completion is enabled.

public voidresetModel()

Function to reset the internal model representation.

public voidsetSuggestions(const QList<CodeCompletionSuggestion> & suggestions,const QString & suggestionFilter)

Simple function to assign code completion suggestions and filter.

public inline voidsetCompletionPosition(int index)

Completion position setter.

public voidsetFilter(const QString & filter)

Simple function to set the given filter.

public inline const QString &filter() const

Getter of filter.

public inlineCodeCompletionContext*completionContext()

Completion context getter.

public voidsetCompletionContext(CodeCompletionContext* context)

Sets given code completion context.

public voidremoveCompletionContext()

Deletes the internal completion context.

{signal} public voidcompletionPositionChanged(int arg)

completion position changed

{signal} public voidisEnabledChanged(bool arg)

Shows if enabled state changed

{slot} public inline voidenable()

Enables the model.

{slot} public inline voiddisable()

Disables the model.

{slot} public inline intsuggestionCount() const

Returns the number of model entries.

enumRoles

Values Descriptions
Label
Info
Category
Completion
Documentation

Roles of the model.

class lv::CodeCompletionSuggestion

Code completion suggestion used in the QCodeCompletionModel.

Summary

Members Descriptions
publicCodeCompletionSuggestion(const QString & label,const QString & info,const QString & category,const QString & completion,const QString & documentation) Default constructor for CodeCompletionSuggestion, simply setting the given parameters.
public~CodeCompletionSuggestion() Blank destructor of CodeCOmpletionSuggestion.
public inline const QString &label() const Label getter.
public inline const QString &info() const Info getter.
public inline const QString &category() const Category getter.
public inline const QString &completion() const Completion getter.
public inline const QString &documentation() const Documentation getter.

Members

publicCodeCompletionSuggestion(const QString & label,const QString & info,const QString & category,const QString & completion,const QString & documentation)

Default constructor for CodeCompletionSuggestion, simply setting the given parameters.

public~CodeCompletionSuggestion()

Blank destructor of CodeCOmpletionSuggestion.

public inline const QString &label() const

Label getter.

public inline const QString &info() const

Info getter.

public inline const QString &category() const

Category getter.

public inline const QString &completion() const

Completion getter.

public inline const QString &documentation() const

Documentation getter.

class lv::DocumentHandler

Complements TextEdit in handling documents.

Offers infrastructure for code completion, highlighting and other language specifics.

Summary

Members Descriptions

Members

class lv::CodePalette

class lv::CodePalette
  : public QObject

Palette display of a property.

Summary

Members Descriptions
public explicitCodePalette(QObject * parent) Default contructor of CodePalette.
public virtual~CodePalette() Default destructor.
public inline QQuickItem *item() Visual item for this palette.
public inline voidsetItem(QQuickItem * item) Item setter.
public inline boolhasItem() const Checks wether item is available.
public inline const QVariant &value() const Property value corresponding to this palette.
public voidsetValue(const QVariant & value) Value setter for palette.
public voidsetValueFromBinding(const QVariant & value) Assign property value (binding change)
public voidinitValue(const QVariant & value)
public voidinitViaSource()
public QStringname() const Palette name.
public inline voidsetPath(const QString & path) Path setter for palette.
public inline const QString &path() const Path getter for palette.
public inlineQmlEditFragment*editFragment() const Returns extension for palette
public inline voidsetEditFragment(QmlEditFragment* extension) Extension setter for palette.
public inline QStringtype() const Returns the palette type.
public inline voidsetType(QString type) Type setter for palette.
public inline const QJSValue &writer() const Returns the writer function set by this palette.
{signal} public voiditemChanged() Item changed
{signal} public voidvalueChanged() Value changed
{signal} public voideditFragmentChanged() Edit fragment changed
{signal} public voidtypeChanged() Type changed
{signal} public voidwriterChanged() Writer changed
{signal} public voidinit(const QVariant & value) Value was initialized
{signal} public voidsourceInit()
{signal} public voidvalueFromBindingChanged(const QVariant & value)
{slot} public inline boolisBindingChange() const Shows if palette is currently in the middle of a binding change.
{slot} public inline voidsetWriter(QJSValue writer)

Members

public explicitCodePalette(QObject * parent)

Default contructor of CodePalette.

public virtual~CodePalette()

Default destructor.

public inline QQuickItem *item()

Visual item for this palette.

Visual item for this palette

public inline voidsetItem(QQuickItem * item)

Item setter.

public inline boolhasItem() const

Checks wether item is available.

public inline const QVariant &value() const

Property value corresponding to this palette.

Property value corresponding to this palette

public voidsetValue(const QVariant & value)

Value setter for palette.

public voidsetValueFromBinding(const QVariant & value)

Assign property value (binding change)

public voidinitValue(const QVariant & value)

public voidinitViaSource()

public QStringname() const

Palette name.

Palette name

public inline voidsetPath(const QString & path)

Path setter for palette.

public inline const QString &path() const

Path getter for palette.

public inlineQmlEditFragment*editFragment() const

Returns extension for palette

public inline voidsetEditFragment(QmlEditFragment* extension)

Extension setter for palette.

public inline QStringtype() const

Returns the palette type.

Palette type

public inline voidsetType(QString type)

Type setter for palette.

public inline const QJSValue &writer() const

Returns the writer function set by this palette.

{signal} public voiditemChanged()

Item changed

{signal} public voidvalueChanged()

Value changed

{signal} public voideditFragmentChanged()

Edit fragment changed

{signal} public voidtypeChanged()

Type changed

{signal} public voidwriterChanged()

Writer changed

{signal} public voidinit(const QVariant & value)

Value was initialized

{signal} public voidsourceInit()

{signal} public voidvalueFromBindingChanged(const QVariant & value)

{slot} public inline boolisBindingChange() const

Shows if palette is currently in the middle of a binding change.

{slot} public inline voidsetWriter(QJSValue writer)

class lv::EditorGlobalObject

class lv::EditorGlobalObject
  : public QObject

Global object used through LiveKeys just to have access to project and the palette container.

Used by a lot of different classes just for sharing these two properties from their QML context.

Summary

Members Descriptions
public explicitEditorGlobalObject(Project* project,PaletteLoader* paletteContainer,QObject * parent) Default constructor of EditorGlobalObject.
publicProject*project() Project getter.
public inlinePaletteLoader*paletteContainer()
{signal} public voidprojectChanged()

Members

public explicitEditorGlobalObject(Project* project,PaletteLoader* paletteContainer,QObject * parent)

Default constructor of EditorGlobalObject.

publicProject*project()

Project getter.

public inlinePaletteLoader*paletteContainer()

{signal} public voidprojectChanged()

class lv::EditorSettings

class lv::EditorSettings
  : public QObject

Wrapper around a settings file for the editor.

We create small category nodes to add custom settings by assigning a key for each category in a JSON file and fetching it from a settings file.

Summary

Members Descriptions
public explicitEditorSettings(const QString & path,QObject * parent) Default constructor.
public~EditorSettings() Blank destructor.
public inline intfontSize() const Returns the font size.
public inline const QString &path() const Returns path of the settings
public voidfromJson(constMLNode& root) Populates the settings from a given JSON object.
publicMLNodetoJson() const Creates a JSON object from the settings.
public inlineMLNodereadFor(const QString & key) Find settings for given key
public inline voidwrite(const QString & key,constMLNode& settings) Write settings for given key
{signal} public voidinitError(const QString & errorString) Signals error with the given string.
{signal} public voidfontSizeChanged(int fontSize) Signals the fontSize property changed.
{signal} public voidrefresh() Signals when a resync is done from the file
{slot} public voidsyncWithFile() Synchronizes the settings with the file in a bidirectional manner.
{slot} public voidinit(const QByteArray & data) Initializes the settings from given data.
{slot} public inline const QByteArray &content() const Settings content getter.
{slot} public voiddocumentOpened(lv::ProjectDocument* document) Sets up the listener for changes to the project document.
{slot} public voiddocumentChanged() Triggers re-initialization of settings from the settings file on every document change.

Members

public explicitEditorSettings(const QString & path,QObject * parent)

Default constructor.

public~EditorSettings()

Blank destructor.

public inline intfontSize() const

Returns the font size.

Returns the font size

public inline const QString &path() const

Returns path of the settings

public voidfromJson(constMLNode& root)

Populates the settings from a given JSON object.

publicMLNodetoJson() const

Creates a JSON object from the settings.

public inlineMLNodereadFor(const QString & key)

Find settings for given key

public inline voidwrite(const QString & key,constMLNode& settings)

Write settings for given key

{signal} public voidinitError(const QString & errorString)

Signals error with the given string.

Signals error with given string

{signal} public voidfontSizeChanged(int fontSize)

Signals the fontSize property changed.

Font size changed

{signal} public voidrefresh()

Signals when a resync is done from the file

{slot} public voidsyncWithFile()

Synchronizes the settings with the file in a bidirectional manner.

If no file, we store the settings in one. If the file is open, we read from it.

{slot} public voidinit(const QByteArray & data)

Initializes the settings from given data.

{slot} public inline const QByteArray &content() const

Settings content getter.

{slot} public voiddocumentOpened(lv::ProjectDocument* document)

Sets up the listener for changes to the project document.

This happens when the user opens the settings file in LiveKeys

{slot} public voiddocumentChanged()

Triggers re-initialization of settings from the settings file on every document change.

class lv::PaletteContainer

Stores all the palettes that are available in LiveKeys.

More palettes can get populated when a new plugin is added.

Summary

Members Descriptions
publicPaletteContainer()
public~PaletteContainer()
public voidaddPalette(constUtf8& type,constUtf8& path,constUtf8& name,constUtf8& extension,constUtf8& plugin)
public voidclear()
publicUtf8toString() const
publicPaletteInfofindPaletteByName(constUtf8& name) const
publicPaletteInfofindFirstPalette(constUtf8& type) const
public std::list<PaletteInfo>findPalettes(constUtf8& type) const

Members

publicPaletteContainer()

public~PaletteContainer()

public voidaddPalette(constUtf8& type,constUtf8& path,constUtf8& name,constUtf8& extension,constUtf8& plugin)

public voidclear()

publicUtf8toString() const

publicPaletteInfofindPaletteByName(constUtf8& name) const

publicPaletteInfofindFirstPalette(constUtf8& type) const

public std::list<PaletteInfo>findPalettes(constUtf8& type) const

class lv::Project

class lv::Project
  : public QObject

Abstraction of the open project in LiveKeys.

Practically a singleton (not enforced), constructed at the start of the application, and destroyed right before closing. There are two types of projects - file-based projects and folder-based projects.

Summary

Members Descriptions
publicProject(el::Engine * engine,QObject * parent) Default constructor.
public~Project() Default destructor.
publicProjectFile*lookupBestFocus(ProjectEntry* entry) Finds the "best" file in the project to be the inital active file.
publicDocument*isOpened(const QString & rootPath) Checks whether there's a file opened at this specified path.
public inline lv::ProjectFileModel *fileModel() Getter of the file model.
public inline lv::ProjectNavigationModel *navigationModel() Getter of the navigation model.
public inlinelv::ProjectDocumentModel*documentModel() Getter of the document model.
public inlinelv::RunnableContainer*runnables() const Returns the opened runnables.
public inlinelv::Runnable*active() const
public inline const QString &rootPath() const Getter of the root path.
public inlineLockedFileIOSession::PtrlockedFileIO() Getter of the locked file session.
public inline lv::Project::RunTriggerrunTrigger() const Returns the trigger type to rerun the project.
public inline voidsetRunTrigger(lv::Project::RunTrigger runTrigger) Sets the trigger type to rerun the project.
public voidsetRunSpace(QObject * runSpace) Sets the load position for the project.
public voidexcludeRunTriggers(const QSet< QString > & paths) Exclude these paths from scheduling a run.
public voidremoveExcludedRunTriggers(const QSet< QString > & paths) Remove these paths from excluding a scheduled run.
{signal} public voidpathChanged(QString rootPath) path changed, means the whole project changed
{signal} public voidactiveChanged(lv::Runnable* active) active file has changed
{signal} public voiddocumentOpened(lv::Document* document) triggers when a document is opened
{signal} public voiddirectoryChanged(const QString & rootPath) refers to an internal project directory change, for example renaming
{signal} public voidfileChanged(const QString & rootPath) file changed (e.g. on save)
{signal} public voidrunTriggerChanged() run trigger changed
{signal} public voidaboutToClose() project is about to close
{slot} public voidnewProject() Creates a simple demo file project, and closes the previously opened one (if it exists)
{slot} public voidcloseProject() Closes the currently opened project.
{slot} publiclv::ProjectDocument*openTextFile(const QUrl & rootPath,int mode) QUrl variant of the other openFile function.
{slot} publiclv::ProjectDocument*openTextFile(const QString & rootPath,int mode) Opens the file given by the path, in the given mode.
{slot} publiclv::ProjectDocument*openTextFile(lv::ProjectFile* file,int mode) Opens the given file in the given mode, this time using the internal ProjectFile object.
{slot} publiclv::Document*openFile(const QString & path,int mode)
{slot} publiclv::Document*openFile(lv::ProjectFile* file,int mode)
{slot} public voidsetActive(const QString & rootPath) Set the active file given its path.
{slot} publiclv::Runnable*openRunnable(const QString & path,const QStringList & activations)
{slot} public boolisDirProject() const Shows if the project is of folder type.
{slot} public boolisFileInProject(const QUrl & rootPath) const QUrl variant of this function.
{slot} public boolisFileInProject(const QString & rootPath) const Shows if the file given by the QString path is inside this folder-based project.
{slot} public boolcanRunFile(const QString & path) const Checks whether the file can be run.
{slot} public voidopenProject(const QString & rootPath) Open project given by the path.
{slot} public voidopenProject(const QUrl & url) Opens project given by QUrl
{slot} public voidcloseFile(const QString & rootPath) Closes the file given the path.
{slot} public QStringdir() const Returns the path of the folder of the given file-based project, or the actual folder of a folder-based project.
{slot} public QStringpath(const QString & relative) const Returns an absolute path given a relative one.
{slot} public voidscheduleRun() Schedules a run in 1 second. Clears any previous schedule.
{slot} public voidrun() Run the current project.
{slot} public QObject *runSpace()
{slot} public QObject *appRoot()
{slot} public inline el::Engine *engine() Returns the Elements engine associated with this project.
enumRunTrigger

Members

publicProject(el::Engine * engine,QObject * parent)

Default constructor.

public~Project()

Default destructor.

publicProjectFile*lookupBestFocus(ProjectEntry* entry)

Finds the "best" file in the project to be the inital active file.

The preference is for "main.qml" first, then the first lowercase-named file

publicDocument*isOpened(const QString & rootPath)

Checks whether there's a file opened at this specified path.

public inline lv::ProjectFileModel *fileModel()

Getter of the file model.

The file model represents all of the opened files in the current project

public inline lv::ProjectNavigationModel *navigationModel()

Getter of the navigation model.

Used to search through the project for different files

public inlinelv::ProjectDocumentModel*documentModel()

Getter of the document model.

Shows all the opened files

public inlinelv::RunnableContainer*runnables() const

Returns the opened runnables.

public inlinelv::Runnable*active() const

public inline const QString &rootPath() const

Getter of the root path.

Actual path of the project, whether it's a file- or folder-based project.

public inlineLockedFileIOSession::PtrlockedFileIO()

Getter of the locked file session.

Implemention of the standard read-write model where there can be multiple readers, but a single writer, and the write mode is locked for access.

public inline lv::Project::RunTriggerrunTrigger() const

Returns the trigger type to rerun the project.

public inline voidsetRunTrigger(lv::Project::RunTrigger runTrigger)

Sets the trigger type to rerun the project.

public voidsetRunSpace(QObject * runSpace)

Sets the load position for the project.

public voidexcludeRunTriggers(const QSet< QString > & paths)

Exclude these paths from scheduling a run.

public voidremoveExcludedRunTriggers(const QSet< QString > & paths)

Remove these paths from excluding a scheduled run.

{signal} public voidpathChanged(QString rootPath)

path changed, means the whole project changed

{signal} public voidactiveChanged(lv::Runnable* active)

active file has changed

{signal} public voiddocumentOpened(lv::Document* document)

triggers when a document is opened

{signal} public voiddirectoryChanged(const QString & rootPath)

refers to an internal project directory change, for example renaming

{signal} public voidfileChanged(const QString & rootPath)

file changed (e.g. on save)

{signal} public voidrunTriggerChanged()

run trigger changed

{signal} public voidaboutToClose()

project is about to close

{slot} public voidnewProject()

Creates a simple demo file project, and closes the previously opened one (if it exists)

Nameless file with a simple Grid

{slot} public voidcloseProject()

Closes the currently opened project.

It doesn't destroy the singleton capital-P Project, simply leaves it in a blank state

{slot} publiclv::ProjectDocument*openTextFile(const QUrl & rootPath,int mode)

QUrl variant of the other openFile function.

See also: Project::openFile(const QString &path, int mode)

{slot} publiclv::ProjectDocument*openTextFile(const QString & rootPath,int mode)

Opens the file given by the path, in the given mode.

If the document is not opened, we use the third openFile function to do so. If it is, we update its monitoring state.

See also: Project::openFile(ProjectFile *file, int mode)

{slot} publiclv::ProjectDocument*openTextFile(lv::ProjectFile* file,int mode)

Opens the given file in the given mode, this time using the internal ProjectFile object.

All open documents are immediately added to the document model

{slot} publiclv::Document*openFile(const QString & path,int mode)

{slot} publiclv::Document*openFile(lv::ProjectFile* file,int mode)

{slot} public voidsetActive(const QString & rootPath)

Set the active file given its path.

This file is the one actually compiling

{slot} publiclv::Runnable*openRunnable(const QString & path,const QStringList & activations)

{slot} public boolisDirProject() const

Shows if the project is of folder type.

{slot} public boolisFileInProject(const QUrl & rootPath) const

QUrl variant of this function.

See also: Project::isFileInProject(const QString &path)

{slot} public boolisFileInProject(const QString & rootPath) const

Shows if the file given by the QString path is inside this folder-based project.

{slot} public boolcanRunFile(const QString & path) const

Checks whether the file can be run.

{slot} public voidopenProject(const QString & rootPath)

Open project given by the path.

It can be either a single file or an entire folder, as mentioned before

{slot} public voidopenProject(const QUrl & url)

Opens project given by QUrl

{slot} public voidcloseFile(const QString & rootPath)

Closes the file given the path.

{slot} public QStringdir() const

Returns the path of the folder of the given file-based project, or the actual folder of a folder-based project.

{slot} public QStringpath(const QString & relative) const

Returns an absolute path given a relative one.

{slot} public voidscheduleRun()

Schedules a run in 1 second. Clears any previous schedule.

{slot} public voidrun()

Run the current project.

{slot} public QObject *runSpace()

{slot} public QObject *appRoot()

{slot} public inline el::Engine *engine()

Returns the Elements engine associated with this project.

enumRunTrigger

Values Descriptions
RunManual
RunOnSave
RunOnChange

class lv::ProjectDocumentMarker

Dynamic project document markers.

Markers are wrappers around a position in a document. They get moved automatically with document changes, and get deleted when both characters surrounding them are deleted.

Summary

Members Descriptions
public inline intposition() const Marker position.
public inline boolisValid() const Shows if the marker is valid.
public inline~ProjectDocumentMarker() Destructor.
typedefPtr Shared pointer to the marker
typedefConstPtr Const shared pointer to the marker

Members

public inline intposition() const

Marker position.

public inline boolisValid() const

Shows if the marker is valid.

public inline~ProjectDocumentMarker()

Destructor.

typedefPtr

Shared pointer to the marker

typedefConstPtr

Const shared pointer to the marker

class lv::ProjectDocument

class lv::ProjectDocument
  : public lv::Document

Wrapper for any opened document in LiveKeys.

Summary

Members Descriptions
public explicitProjectDocument(ProjectFile* file,bool isMonitored,Project* parent) Default constructor
public~ProjectDocument() ProjectDocument destructor.
public QTextDocument *textDocument() Text document which is wrapped inside the ProjectDocument.
public boolisActive() const Shows if the current document is active.
public virtual QByteArraycontent() Overrides Document::content.
public virtual voidsetContent(const QByteArray & content) Overrides Document::setContent.
public const QString &contentString()
publicProjectDocumentMarker::PtraddMarker(int position) Adds a marker at the given position.
public voidremoveMarker(ProjectDocumentMarker::Ptrmarker) Removes a given marker.
publicProjectDocumentSection::PtrcreateSection(int type,int position,int length) Creates a custom section with the given type, position and length.
publicSectionIteratorsectionsBegin() Begin-iterator of the sections.
publicSectionIteratorsectionsEnd() End-iterator of the sections.
publicSectionConstIteratorsectionsBegin() const Const begin-iterator of the sections.
publicSectionConstIteratorsectionsEnd() const Const end-iterator of the sections.
public inttotalSections() const Number of sections.
public boolhasSections() const Shows if the object has any sections.
publicProjectDocumentSection::PtrsectionAt(int position) Returns the section at the given position.
public boolremoveSectionAt(int position) Removes section at given position.
public voidremoveSection(ProjectDocumentSection::Ptrsection) Removes section given its pointer.
public QStringpeekContent(int position) const Shows a small text preview of the text around a given position, including a visual pointer to the position itself.
public voidaddEditingState(EditingStatetype) Adds editing state flag.
public voidremoveEditingState(EditingStatestate) Removes the given editing state flag.
public booleditingStateIs(int flag) const Shows if the editing state includes the given flags.
public voidresetEditingState() Resets all of the editing state flags.
public intlastCursorPosition()
public voidsetLastCursorPosition(int pos)
public inline voidresetCollapseSignal(int blockNumber)
public voidaddLineAtBlockNumber(QString line,int pos)
public voidremoveLineAtBlockNumber(int pos)
{signal} public voidformatChanged(int position,int length) shows if the format changed
{signal} public voidcontentsChange(int pos,int removed,int added) triggered when a contents changed inside the document
{signal} public voidresetCollapse(int blockNumber) triggered when we need to reset collapse state
{slot} public void__documentContentsChanged(int position,int charsRemoved,int charsAdded) Slot for tracking text document changes which updates markers and sections.
{slot} public void__documentModificationChanged()
{slot} public void__documentSaved()
{slot} public virtual voidreadContent()
{slot} public virtual intcontentLength()
{slot} public QStringsubstring(int from,int length) const
{slot} public voidinsert(int from,int length,const QString & text,int editingState)
{slot} public intoffsetAtLine(int line) const
enumEditingState Editing states of an opened document
typedefSectionIterator Iterator through sections
typedefSectionConstIterator Const iterator through sections

Members

public explicitProjectDocument(ProjectFile* file,bool isMonitored,Project* parent)

Default constructor

public~ProjectDocument()

ProjectDocument destructor.

public QTextDocument *textDocument()

Text document which is wrapped inside the ProjectDocument.

public boolisActive() const

Shows if the current document is active.

public virtual QByteArraycontent()

Overrides Document::content.

public virtual voidsetContent(const QByteArray & content)

Overrides Document::setContent.

public const QString &contentString()

publicProjectDocumentMarker::PtraddMarker(int position)

Adds a marker at the given position.

public voidremoveMarker(ProjectDocumentMarker::Ptrmarker)

Removes a given marker.

publicProjectDocumentSection::PtrcreateSection(int type,int position,int length)

Creates a custom section with the given type, position and length.

See also: lv::ProjectDocumentSection

publicSectionIteratorsectionsBegin()

Begin-iterator of the sections.

publicSectionIteratorsectionsEnd()

End-iterator of the sections.

publicSectionConstIteratorsectionsBegin() const

Const begin-iterator of the sections.

publicSectionConstIteratorsectionsEnd() const

Const end-iterator of the sections.

public inttotalSections() const

Number of sections.

public boolhasSections() const

Shows if the object has any sections.

publicProjectDocumentSection::PtrsectionAt(int position)

Returns the section at the given position.

public boolremoveSectionAt(int position)

Removes section at given position.

public voidremoveSection(ProjectDocumentSection::Ptrsection)

Removes section given its pointer.

public QStringpeekContent(int position) const

Shows a small text preview of the text around a given position, including a visual pointer to the position itself.

public voidaddEditingState(EditingStatetype)

Adds editing state flag.

public voidremoveEditingState(EditingStatestate)

Removes the given editing state flag.

public booleditingStateIs(int flag) const

Shows if the editing state includes the given flags.

public voidresetEditingState()

Resets all of the editing state flags.

public intlastCursorPosition()

public voidsetLastCursorPosition(int pos)

public inline voidresetCollapseSignal(int blockNumber)

public voidaddLineAtBlockNumber(QString line,int pos)

public voidremoveLineAtBlockNumber(int pos)

{signal} public voidformatChanged(int position,int length)

shows if the format changed

{signal} public voidcontentsChange(int pos,int removed,int added)

triggered when a contents changed inside the document

{signal} public voidresetCollapse(int blockNumber)

triggered when we need to reset collapse state

{slot} public void__documentContentsChanged(int position,int charsRemoved,int charsAdded)

Slot for tracking text document changes which updates markers and sections.

{slot} public void__documentModificationChanged()

{slot} public void__documentSaved()

{slot} public virtual voidreadContent()

{slot} public virtual intcontentLength()

{slot} public QStringsubstring(int from,int length) const

{slot} public voidinsert(int from,int length,const QString & text,int editingState)

{slot} public intoffsetAtLine(int line) const

enumEditingState

Values Descriptions
Manual 0 : coming from the user
Assisted 1 : coming from a code completion assistant
Silent 10 : does not trigger a recompile
Palette 110 : also silent (when a palette edits a section)
Runtime 1010 : also silent (comming from a runtime binding)
Read 10000 : populate from file, does not signal anything
Overlay 100000 : document under overlay mode, does not signal anything

Editing states of an opened document

typedefSectionIterator

Iterator through sections

typedefSectionConstIterator

Const iterator through sections

class lv::ProjectDocumentAction

class lv::ProjectDocumentAction
  : public QAbstractUndoItem

Undo/redo implementation for project documents.

Summary

Members Descriptions
publicProjectDocument*parent
public QStringcharsAdded
public QStringcharsRemoved
public intposition
public boolcommited
public inlineProjectDocumentAction(ProjectDocument* pParent,int pPosition,const QString & pCharsAdded,const QString & pCharsRemoved,bool pCommited) Default constructor
public voidundo() Undo implementation.
public voidredo() Redo implementation.

Members

publicProjectDocument*parent

public QStringcharsAdded

public QStringcharsRemoved

public intposition

public boolcommited

public inlineProjectDocumentAction(ProjectDocument* pParent,int pPosition,const QString & pCharsAdded,const QString & pCharsRemoved,bool pCommited)

Default constructor

public voidundo()

Undo implementation.

public voidredo()

Redo implementation.

class lv::ProjectDocumentSection

Dynamic project document section.

The section is defined by its position and length. Similar to the dynamic markers, this gets moved around and modified along with document changes.

Summary

Members Descriptions
public inline intposition() const Returns the first position of the section.
public inline intlength() const Returns the length of the section.
public inline inttype() const Returns the type of section set by the user.
public inline boolisValid() const Shows if the section is still valid.
public inline voidresize(int newLength)
public~ProjectDocumentSection() Default destructor.
public inline voidsetUserData(void * data) Set the custom user data inside the section.
public inline void *userData() Returns the custom user data.
public inlineProjectDocument*document() Returns the document the section belongs to.
public inline ProjectDocumentBlockData *parentBlock() Returns the block containing the first position of the section.
public voidonTextChanged(std::function< void(ProjectDocumentSection::Ptr, int, int, const QString &)> handler) Sets the callback funciton to be called when the text changes
typedefPtr Shared pointer to a section
typedefConstPtr Const shared pointer to a section

Members

public inline intposition() const

Returns the first position of the section.

public inline intlength() const

Returns the length of the section.

public inline inttype() const

Returns the type of section set by the user.

public inline boolisValid() const

Shows if the section is still valid.

public inline voidresize(int newLength)

public~ProjectDocumentSection()

Default destructor.

public inline voidsetUserData(void * data)

Set the custom user data inside the section.

public inline void *userData()

Returns the custom user data.

public inlineProjectDocument*document()

Returns the document the section belongs to.

public inline ProjectDocumentBlockData *parentBlock()

Returns the block containing the first position of the section.

public voidonTextChanged(std::function< void(ProjectDocumentSection::Ptr, int, int, const QString &)> handler)

Sets the callback funciton to be called when the text changes

typedefPtr

Shared pointer to a section

typedefConstPtr

Const shared pointer to a section

class lv::ProjectDocumentModel

class lv::ProjectDocumentModel
  : public QAbstractListModel

It's a model containing all of the open files in our Project.

Summary

Members Descriptions
publicProjectDocumentModel(Project* project) Default constructor
public~ProjectDocumentModel() Default destructor
public introwCount(const QModelIndex & parent) const implementation of the function inherited from QAbstractListModel
public QVariantdata(const QModelIndex & index,int role) const implementation of the function inherited from QAbstractListModel
public QHash< int, QByteArray >roleNames() const implementation of the function inherited from QAbstractListModel
public voidopenDocument(const QString & path,Document* document) Adds a document to the model
public voidrelocateDocument(const QString & path,const QString & newPath,Document* document) Changes the path of a document
public voidcloseDocuments() Closes all of the open documents
public inline const QHash< QString,Document* >openedFiles() const Returns the hashmap containing the open documents
public voidupdateDocumentMonitoring(Document* document,bool monitor) Change the monitoring state of a particular documetn
public voidcloseDocumentsInPath(const QString & path) Close all of the documents within a given folder path
public voidcloseDocument(const QString & path) Close the specific file with a given path.
{signal} public voidmonitoredDocumentChanged(lv::Document* document) Shows that the given document has changed
{signal} public voiddocumentChangedOutside(lv::Document* document) Shows that the given document was changed externally
{signal} public voidaboutToClose(lv::Document* document) Signals that the document is being closed
{slot} public voidrescanDocuments() Check for changes inside the open files (by comparing last mod timestamps)
{slot} public voidmonitoredFileChanged(const QString & path) Re-reads content of a monitored file that changed
{slot} public boolsaveDocuments() Saves all changed documents
{slot} publiclv::Document*isOpened(const QString & path) Returns if the file is opened.
{slot} publiclv::Document*lastOpened() Returns last opened file
{slot} publiclv::Document*documentByPathHash(const QString & pathHash) Returns the document given it's path hash, using lv::ProjectEntry::hashPath()
{slot} public QStringListlistUnsavedDocuments() Shows a list of all unsaved docs.
{slot} public QStringListlistUnsavedDocumentsInPath(const QString & path) Returns list of unsaved documents withing a folder.
enumRoles Model roles

Members

publicProjectDocumentModel(Project* project)

Default constructor

public~ProjectDocumentModel()

Default destructor

public introwCount(const QModelIndex & parent) const

implementation of the function inherited from QAbstractListModel

public QVariantdata(const QModelIndex & index,int role) const

implementation of the function inherited from QAbstractListModel

public QHash< int, QByteArray >roleNames() const

implementation of the function inherited from QAbstractListModel

public voidopenDocument(const QString & path,Document* document)

Adds a document to the model

public voidrelocateDocument(const QString & path,const QString & newPath,Document* document)

Changes the path of a document

public voidcloseDocuments()

Closes all of the open documents

public inline const QHash< QString,Document* >openedFiles() const

Returns the hashmap containing the open documents

public voidupdateDocumentMonitoring(Document* document,bool monitor)

Change the monitoring state of a particular documetn

public voidcloseDocumentsInPath(const QString & path)

Close all of the documents within a given folder path

public voidcloseDocument(const QString & path)

Close the specific file with a given path.

{signal} public voidmonitoredDocumentChanged(lv::Document* document)

Shows that the given document has changed

{signal} public voiddocumentChangedOutside(lv::Document* document)

Shows that the given document was changed externally

{signal} public voidaboutToClose(lv::Document* document)

Signals that the document is being closed

{slot} public voidrescanDocuments()

Check for changes inside the open files (by comparing last mod timestamps)

{slot} public voidmonitoredFileChanged(const QString & path)

Re-reads content of a monitored file that changed

{slot} public boolsaveDocuments()

Saves all changed documents

{slot} publiclv::Document*isOpened(const QString & path)

Returns if the file is opened.

By definition, if the file is inside this model, it's opened!

{slot} publiclv::Document*lastOpened()

Returns last opened file

{slot} publiclv::Document*documentByPathHash(const QString & pathHash)

Returns the document given it's path hash, using lv::ProjectEntry::hashPath()

{slot} public QStringListlistUnsavedDocuments()

Shows a list of all unsaved docs.

Useful for e.g. when we're closing a project

{slot} public QStringListlistUnsavedDocumentsInPath(const QString & path)

Returns list of unsaved documents withing a folder.

Useful for e.g. when you're moving or deleting a folder within a project

enumRoles

Values Descriptions
Name
Path
IsOpen

Model roles

class lv::ProjectEntry

class lv::ProjectEntry
  : public QObject

An entry within a LiveKeys project, either a folder or a file.

The whole hierarchy is in a tree-like structure

Summary

Members Descriptions
public explicitProjectEntry(const QString & path,ProjectEntry* parent) Default constructor
publicProjectEntry(const QString & path,const QString & name,ProjectEntry* parent) Constructor with a name parameter
public~ProjectEntry() Blank destructor
publicProjectEntry*child(int index) Return a child at a given index
public inlineProjectEntry*parentEntry() const Return the parent of this entry
publicProjectEntry*addEntry(const QString & name) Adds entry with a given name to this entry
publicProjectEntry*addFileEntry(const QString & name) Adds fuke entry with a given name to this entry
public intchildCount() const Number of entries
public intchildIndex() const Returns the position of this entry within its parent
public inline const QString &name() const Name getter
public voidsetName(const QString & name) Sets the name to the current entry, simultaneously changing the path as well.
public inline const QString &path() const Path getter
public inline boolisFile() const Shows if the entry is a file
public voidclearItems() Resets all the entries for which that's possible to do.
public inline boolcontains(const QString & name) const Shows if the entry contains a sub-entry with a given name
public inline booloperator<(constProjectEntry& other) const Less-than relational operator of entries, sorting by name
public inline booloperator>(constProjectEntry& other) const Greater-than relational operator of entries, sorting by name
public voidsetParentEntry(ProjectEntry* entry) Sets the parent entry
public voidaddChildEntry(ProjectEntry* entry) Adds child entry
public intfindEntryInsertionIndex(ProjectEntry* entry) Find a hypothetical insertion point for a given entry
public voidremoveChildEntry(ProjectEntry* entry) Remove a child entry
public inline const QDateTime &lastCheckTime() const Returns the last check time
public inline voidsetLastCheckTime(const QDateTime & lastCheckTime) Sets the last check time
public inline const QList<ProjectEntry* > &entries() const Returns the list of entries
public voidupdatePaths() Updates paths of child entries.
protectedProjectEntry(const QString & path,const QString & name,bool isFile,ProjectEntry* parent) Complex constructor with an indicator that the entry is a file
{signal} public voidnameChanged() Signals that the name has changed
{signal} public voidpathChanged() Signals that the path has changed
{slot} public QUrlpathUrl() const Returns the QUrl of the entry path
{slot} public QStringhashPath() const Returns the path hashed with md5 and converted to hex

Members

public explicitProjectEntry(const QString & path,ProjectEntry* parent)

Default constructor

publicProjectEntry(const QString & path,const QString & name,ProjectEntry* parent)

Constructor with a name parameter

public~ProjectEntry()

Blank destructor

publicProjectEntry*child(int index)

Return a child at a given index

public inlineProjectEntry*parentEntry() const

Return the parent of this entry

publicProjectEntry*addEntry(const QString & name)

Adds entry with a given name to this entry

publicProjectEntry*addFileEntry(const QString & name)

Adds fuke entry with a given name to this entry

public intchildCount() const

Number of entries

public intchildIndex() const

Returns the position of this entry within its parent

public inline const QString &name() const

Name getter

public voidsetName(const QString & name)

Sets the name to the current entry, simultaneously changing the path as well.

Useful for e.g. renaming folders

public inline const QString &path() const

Path getter

public inline boolisFile() const

Shows if the entry is a file

public voidclearItems()

Resets all the entries for which that's possible to do.

It's not possible to delete open files!

public inline boolcontains(const QString & name) const

Shows if the entry contains a sub-entry with a given name

public inline booloperator<(constProjectEntry& other) const

Less-than relational operator of entries, sorting by name

public inline booloperator>(constProjectEntry& other) const

Greater-than relational operator of entries, sorting by name

public voidsetParentEntry(ProjectEntry* entry)

Sets the parent entry

public voidaddChildEntry(ProjectEntry* entry)

Adds child entry

public intfindEntryInsertionIndex(ProjectEntry* entry)

Find a hypothetical insertion point for a given entry

public voidremoveChildEntry(ProjectEntry* entry)

Remove a child entry

public inline const QDateTime &lastCheckTime() const

Returns the last check time

public inline voidsetLastCheckTime(const QDateTime & lastCheckTime)

Sets the last check time

public inline const QList<ProjectEntry* > &entries() const

Returns the list of entries

public voidupdatePaths()

Updates paths of child entries.

Useful when moving folders in LiveKeys and re-updates the sub-entry paths

protectedProjectEntry(const QString & path,const QString & name,bool isFile,ProjectEntry* parent)

Complex constructor with an indicator that the entry is a file

{signal} public voidnameChanged()

Signals that the name has changed

{signal} public voidpathChanged()

Signals that the path has changed

{slot} public QUrlpathUrl() const

Returns the QUrl of the entry path

{slot} public QStringhashPath() const

Returns the path hashed with md5 and converted to hex

class lv::ProjectFile

class lv::ProjectFile
  : public lv::ProjectEntry

Specialization of ProjectEntry for files.

Summary

Members Descriptions
public explicitProjectFile(const QString & path,ProjectEntry* parent) Default constructor
publicProjectFile(const QString & path,const QString & name,ProjectEntry* parent) Constructor with a name parameter given
public~ProjectFile() Blank destructor
public inlineDocument*document() const Document getter
public voidsetDocument(lv::Document* document) Document setter
public inline boolisOpen() const Shows if the file is opened
{signal} public voiddocumentChanged() Signals that the document associated with the file has changed
{slot} public inline boolexists() const Returns true if the file exists or false is a temporarry file.

Members

public explicitProjectFile(const QString & path,ProjectEntry* parent)

Default constructor

publicProjectFile(const QString & path,const QString & name,ProjectEntry* parent)

Constructor with a name parameter given

public~ProjectFile()

Blank destructor

public inlineDocument*document() const

Document getter

public voidsetDocument(lv::Document* document)

Document setter

public inline boolisOpen() const

Shows if the file is opened

{signal} public voiddocumentChanged()

Signals that the document associated with the file has changed

{slot} public inline boolexists() const

Returns true if the file exists or false is a temporarry file.

class lv::ProjectFileModel

class lv::ProjectFileModel
  : public QAbstractItemModel

The model of the whole project file system used when opening a project in LiveKeys.

It's a tree-like structure

Summary

Members Descriptions
publicProjectFileModel(QObject * parent) Default constructor
public~ProjectFileModel() Default destructor
public QVariantdata(const QModelIndex & index,int role) const Override of the standard function from QAbstractItemModel
public QModelIndexindex(int row,int column,const QModelIndex & parent) const Override of the standard function from QAbstractItemModel
public QModelIndexrootIndex()
public QModelIndexparent(const QModelIndex & index) const
public introwCount(const QModelIndex & parent) const
public intcolumnCount(const QModelIndex & parent) const
public boolhasChildren(const QModelIndex & parent) const
public Qt::ItemFlagsflags(const QModelIndex & index) const
public QHash< int, QByteArray >roleNames() const
public voidcreateProject()
public voidopenProject(const QString & path)
public voidcloseProject()
publicProjectFile*openFile(const QString & file)
publicProjectEntry*findPathInEntry(ProjectEntry* entry,const QString & path)
public inlineProjectEntry*root()
{signal} public voidprojectNodeChanged(QModelIndex index)
{signal} public voiderror(const QString & message)
{slot} public voidentryRemoved(const QModelIndex & item)
{slot} public voidentryRemoved(ProjectEntry* entry)
{slot} public voidentryRemoved(const QModelIndex & item,lv::ProjectEntry* entry)
{slot} public voidentryAdded(lv::ProjectEntry* item,lv::ProjectEntry* parent)
{slot} public voidmoveEntry(lv::ProjectEntry* item,lv::ProjectEntry* parent)
{slot} public voidrenameEntry(lv::ProjectEntry* item,const QString & newName)
{slot} publiclv::ProjectFile*addFile(lv::ProjectEntry* parentEntry,const QString & name)
{slot} publiclv::ProjectFile*addTemporaryFile()
{slot} publiclv::ProjectEntry*addDirectory(lv::ProjectEntry* parentEntry,const QString & name)
{slot} publiclv::ProjectEntry*findPath(const QString & path)
{slot} public boolremoveEntry(lv::ProjectEntry* entry)
{slot} public voidexpandEntry(lv::ProjectEntry* entry) const
{slot} public voidrescanEntries(lv::ProjectEntry* entry)
{slot} publiclv::ProjectEntry*itemAt(const QModelIndex & index) const
{slot} public QModelIndexitemIndex(lv::ProjectEntry* entry)
{slot} public QStringprintableName(const QString & name)
enumRoles

Members

publicProjectFileModel(QObject * parent)

Default constructor

public~ProjectFileModel()

Default destructor

public QVariantdata(const QModelIndex & index,int role) const

Override of the standard function from QAbstractItemModel

public QModelIndexindex(int row,int column,const QModelIndex & parent) const

Override of the standard function from QAbstractItemModel

public QModelIndexrootIndex()

public QModelIndexparent(const QModelIndex & index) const

public introwCount(const QModelIndex & parent) const

public intcolumnCount(const QModelIndex & parent) const

public boolhasChildren(const QModelIndex & parent) const

public Qt::ItemFlagsflags(const QModelIndex & index) const

public QHash< int, QByteArray >roleNames() const

public voidcreateProject()

public voidopenProject(const QString & path)

public voidcloseProject()

publicProjectFile*openFile(const QString & file)

publicProjectEntry*findPathInEntry(ProjectEntry* entry,const QString & path)

public inlineProjectEntry*root()

{signal} public voidprojectNodeChanged(QModelIndex index)

{signal} public voiderror(const QString & message)

{slot} public voidentryRemoved(const QModelIndex & item)

{slot} public voidentryRemoved(ProjectEntry* entry)

{slot} public voidentryRemoved(const QModelIndex & item,lv::ProjectEntry* entry)

{slot} public voidentryAdded(lv::ProjectEntry* item,lv::ProjectEntry* parent)

{slot} public voidmoveEntry(lv::ProjectEntry* item,lv::ProjectEntry* parent)

{slot} public voidrenameEntry(lv::ProjectEntry* item,const QString & newName)

{slot} publiclv::ProjectFile*addFile(lv::ProjectEntry* parentEntry,const QString & name)

{slot} publiclv::ProjectFile*addTemporaryFile()

{slot} publiclv::ProjectEntry*addDirectory(lv::ProjectEntry* parentEntry,const QString & name)

{slot} publiclv::ProjectEntry*findPath(const QString & path)

{slot} public boolremoveEntry(lv::ProjectEntry* entry)

{slot} public voidexpandEntry(lv::ProjectEntry* entry) const

{slot} public voidrescanEntries(lv::ProjectEntry* entry)

{slot} publiclv::ProjectEntry*itemAt(const QModelIndex & index) const

{slot} public QModelIndexitemIndex(lv::ProjectEntry* entry)

{slot} public QStringprintableName(const QString & name)

enumRoles

Values Descriptions
UrlStringRole