group lveditor

Contains editor functionality and extension hooks.

Summary

Members Descriptions
classlv::AbstractCodeHandler Base class for a code handler, managing assisted completion and custom highlighting.
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::CodePalette Palette display of a property.
classlv::DocumentHandler Complements TextEdit in handling documents.
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::EditorSettingsCategory Extendable class providing an interface for extracting settings from JSON or saving them in JSON.
classlv::PaletteContainer Stores all the palettes that are available in LiveKeys.
classlv::PaletteList List of available palettes returned by a PaletteLoader.
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::AbstractCodeHandler

class lv::AbstractCodeHandler
  : public QObject

Base class for a code handler, managing assisted completion and custom highlighting.

Summary

Members Descriptions
public explicitAbstractCodeHandler(QObject * parent) Blank constructor of AbstractCodeHandler.
public virtual~AbstractCodeHandler() Blank desctructor of AbstractCodeHandler.
public voidassistCompletion(const QTextCursor & cursor,const QChar & insertion,bool manuallyTriggered,CodeCompletionModel* model,QTextCursor & cursorChange) Assists code completion when typing.
public voidsetDocument(ProjectDocument* document) Sets the document being worked on.
public voiddocumentContentsChanged(int position,int charsRemoved,int charsAdded) Define on-change behaviour.
public voidrehighlightBlock(const QTextBlock & block) Block highlighting implementation.
public QPair< int, int >contextBlock(int position) Returns borders of the block containing the current position.

Members

public explicitAbstractCodeHandler(QObject * parent)

Blank constructor of AbstractCodeHandler.

public virtual~AbstractCodeHandler()

Blank desctructor of AbstractCodeHandler.

public voidassistCompletion(const QTextCursor & cursor,const QChar & insertion,bool manuallyTriggered,CodeCompletionModel* model,QTextCursor & cursorChange)

Assists code completion when typing.

public voidsetDocument(ProjectDocument* document)

Sets the document being worked on.

public voiddocumentContentsChanged(int position,int charsRemoved,int charsAdded)

Define on-change behaviour.

public voidrehighlightBlock(const QTextBlock & block)

Block highlighting implementation.

public QPair< int, int >contextBlock(int position)

Returns borders of the block containing the current position.

class lv::CodeCompletionContext

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

Summary

Members Descriptions
public inline virtual~CodeCompletionContext() Empty destructor.

Members

public inline 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.
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.

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) 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.

Members

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

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.

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 const QVariant &value() const Property value corresponding to this palette.
public inline voidsetValue(const QVariant & value) Value setter for palette.
public voidsetValueFromBinding(const QVariant & value) Assign property value (binding change)
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 inline QObject *extension() const Returns extension for palette
public inline voidsetExtension(QObject * extension,bool own) Extension setter for palette.
public inline QStringtype() const Returns the palette type.
public inline voidsetType(QString type) Type setter for palette.
{signal} public voiditemChanged() Item changed
{signal} public voidvalueChanged() Value changed
{signal} public voidextensionChanged() Extension changed
{signal} public voidtypeChanged() Type changed
{signal} public voidinit(const QVariant & value) Value was initialized
{signal} public voidcodeChanged(const QVariant & value) Code changed
{slot} public inline boolisBindingChange() const Shows if palette is currently in the middle of a binding change.

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 const QVariant &value() const

Property value corresponding to this palette.

Property value corresponding to this palette

public inline voidsetValue(const QVariant & value)

Value setter for palette.

public voidsetValueFromBinding(const QVariant & value)

Assign property value (binding change)

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 inline QObject *extension() const

Returns extension for palette

public inline voidsetExtension(QObject * extension,bool own)

Extension setter for palette.

public inline QStringtype() const

Returns the palette type.

Palette type

public inline voidsetType(QString type)

Type setter for palette.

{signal} public voiditemChanged()

Item changed

{signal} public voidvalueChanged()

Value changed

{signal} public voidextensionChanged()

Extension changed

{signal} public voidtypeChanged()

Type changed

{signal} public voidinit(const QVariant & value)

Value was initialized

{signal} public voidcodeChanged(const QVariant & value)

Code changed

{slot} public inline boolisBindingChange() const

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

class lv::DocumentHandler

class lv::DocumentHandler
  : public QObject
  : public QQmlParserStatus

Complements TextEdit in handling documents.

Forwards everything to the highlighter, has a completion model in case there's a specific code handler attached to it, it can auto-complete code, which is all behavior inherited from the AbstractCodeHandler.

Summary

Members Descriptions
public explicitDocumentHandler(QObject * parent) Default constructor of the DocumentHandler.
public~DocumentHandler() Default destructor of DocumentHandler.
public inline QTextDocument *target() Returns the target text document.
public voidsetTarget(QTextDocument * target) Set the target doc
public inlineCodeCompletionModel*completionModel() const Completion model.
public voidrehighlightBlock(const QTextBlock & block) Triggers the code handler to call the highlighter on the given block.
public voidrehighlightSection(int position,int length) Triggers the rehighlighting of blocks in the section given by the position and length.
public inline voidsetIndentSize(int size) Indent size setter.
public inline voidclassBegin() Implementation of the respective function from QQmlParserStatus.
public voidcomponentComplete() Implementation of the respective function from QQmlParserStatus.
public inline TextEdit *textEdit() Returns the TextEdit.
public voidsetTextEdit(TextEdit * te) TextEdit setter.
public inline booleditorFocus() const Shows if the editor is in focus.
public inline voidsetEditorFocus(bool editorFocus) Sets the focus state of the editor.
public inlineAbstractCodeHandler*codeHandler() Code handler getter.
public voidrequestCursorPosition(int position) Cursor position request signal emitter.
public voidlineBoxAdded(int lineStart,int lineEnd,int height,QQuickItem * palette) Used to add and position the palette inside the editor.
public voidlineBoxRemoved(QQuickItem * palette) Used to remove a specific palette in the editor.
public voidlineBoxResized(QQuickItem * palette,int newHeight) Used to resize a given palette.
{signal} public voidtargetChanged() Target changed
{signal} public voidcursorPositionRequest(int position) Cursor position change request
{signal} public voidcontentsChangedManually() Document content was changed manually
{signal} public voideditorFocusChanged() Editor focus changed
{signal} public voidcodeHandlerChanged() Code handler changed
{slot} public voidinsertCompletion(int from,int to,const QString & completion) Adds specific completion that the user picked between given positions.
{slot} public voiddocumentContentsChanged(int position,int charsRemoved,int charsAdded) Slot that is connected to document changes.
{slot} public voidcursorWritePositionChanged(QTextCursor cursor) Slot reacting to cursor position change.
{slot} public voidsetDocument(lv::ProjectDocument* document,QJSValue options) Document that the document handler is operating on.
{slot} public voiddocumentFormatUpdate(int position,int length) Slot for changes in document format - triggers a rehighlight.
{slot} public voidgenerateCompletion(int cursorPosition) Generates code completion at a given cursor position.
{slot} public QJSValuecontextBlockRange(int cursorPosition) Finds the boundaries of the code block containing the cursor position.
{slot} public voidmanageIndent(int from,int length,bool undo) Used to manage indentation of selected text.

Members

public explicitDocumentHandler(QObject * parent)

Default constructor of the DocumentHandler.

Initialized from Editor.qml

public~DocumentHandler()

Default destructor of DocumentHandler.

public inline QTextDocument *target()

Returns the target text document.

public voidsetTarget(QTextDocument * target)

Set the target doc

public inlineCodeCompletionModel*completionModel() const

Completion model.

Model of suggestions that we get from the code handler

public voidrehighlightBlock(const QTextBlock & block)

Triggers the code handler to call the highlighter on the given block.

public voidrehighlightSection(int position,int length)

Triggers the rehighlighting of blocks in the section given by the position and length.

public inline voidsetIndentSize(int size)

Indent size setter.

public inline voidclassBegin()

Implementation of the respective function from QQmlParserStatus.

public voidcomponentComplete()

Implementation of the respective function from QQmlParserStatus.

public inline TextEdit *textEdit()

Returns the TextEdit.

Returns the TextEdit

public voidsetTextEdit(TextEdit * te)

TextEdit setter.

Usually from Editor.qml

public inline booleditorFocus() const

Shows if the editor is in focus.

public inline voidsetEditorFocus(bool editorFocus)

Sets the focus state of the editor.

public inlineAbstractCodeHandler*codeHandler()

Code handler getter.

public voidrequestCursorPosition(int position)

Cursor position request signal emitter.

public voidlineBoxAdded(int lineStart,int lineEnd,int height,QQuickItem * palette)

Used to add and position the palette inside the editor.

public voidlineBoxRemoved(QQuickItem * palette)

Used to remove a specific palette in the editor.

public voidlineBoxResized(QQuickItem * palette,int newHeight)

Used to resize a given palette.

{signal} public voidtargetChanged()

Target changed

{signal} public voidcursorPositionRequest(int position)

Cursor position change request

{signal} public voidcontentsChangedManually()

Document content was changed manually

{signal} public voideditorFocusChanged()

Editor focus changed

{signal} public voidcodeHandlerChanged()

Code handler changed

{slot} public voidinsertCompletion(int from,int to,const QString & completion)

Adds specific completion that the user picked between given positions.

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

Slot that is connected to document changes.

{slot} public voidcursorWritePositionChanged(QTextCursor cursor)

Slot reacting to cursor position change.

Potentially triggers the assisted completion

{slot} public voidsetDocument(lv::ProjectDocument* document,QJSValue options)

Document that the document handler is operating on.

It's a pre-requisite to set the document in order to have any functionality

{slot} public voiddocumentFormatUpdate(int position,int length)

Slot for changes in document format - triggers a rehighlight.

{slot} public voidgenerateCompletion(int cursorPosition)

Generates code completion at a given cursor position.

{slot} public QJSValuecontextBlockRange(int cursorPosition)

Finds the boundaries of the code block containing the cursor position.

Mostly used for fragments

{slot} public voidmanageIndent(int from,int length,bool undo)

Used to manage indentation of selected text.

When a user presses the Tab button, the whole selected text should move

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,PaletteContainer* paletteContainer,QObject * parent) Default constructor of EditorGlobalObject.
publicProject*project() Project getter.
public inlinePaletteContainer*paletteContainer()
{signal} public voidprojectChanged()

Members

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

Default constructor of EditorGlobalObject.

publicProject*project()

Project getter.

public inlinePaletteContainer*paletteContainer()

{signal} public voidprojectChanged()

class lv::EditorSettings

class lv::EditorSettings
  : public QObject

Wrapper around a settings file for the editor.

We create small EditorSettingsCategory objects (that class is extendable) 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(const QJsonObject & root) Populates the settings from a given JSON object.
public QJsonObjecttoJson() const Creates a JSON object from the settings.
public inlineEditorSettingsCategory*settingsFor(const QString & key) Find settings for given key
public inline voidaddSetting(const QString & key,EditorSettingsCategory* category) Add 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.
{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(const QJsonObject & root)

Populates the settings from a given JSON object.

public QJsonObjecttoJson() const

Creates a JSON object from the settings.

public inlineEditorSettingsCategory*settingsFor(const QString & key)

Find settings for given key

public inline voidaddSetting(const QString & key,EditorSettingsCategory* category)

Add 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

{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::EditorSettingsCategory

Extendable class providing an interface for extracting settings from JSON or saving them in JSON.

Summary

Members Descriptions
publicEditorSettingsCategory() Blank constructor.
public~EditorSettingsCategory() Blank destructor.
public inline virtual voidfromJson(const QJsonValue &) Blank implementation of fromJson.
public inline virtual QJsonValuetoJson() const Dummy implementation of toJson, returning a blank object.

Members

publicEditorSettingsCategory()

Blank constructor.

public~EditorSettingsCategory()

Blank destructor.

public inline virtual voidfromJson(const QJsonValue &)

Blank implementation of fromJson.

public inline virtual QJsonValuetoJson() const

Dummy implementation of toJson, returning a blank object.

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
public~PaletteContainer()
public voidscanPalettes(const QString & path) Recursively scans the given folder path for plugins.
public voidscanPalettes(Plugin::Ptrplugin) Extract the palettes from the given plugin.
public PaletteLoader *findPalette(const QString & type) const Finds a palette with a specific type.
publicPaletteList*findPalettes(const QString & type,PaletteList* list) Find a list of palettes of a given type.
public intcountPalettes(const QString & type) const Find the number of palettes of a given type.
public QStringpaletteName(PaletteLoader * loader) Get palette name from the interal PaletteLoader object.
publicCodePalette*createPalette(PaletteLoader * loader) Instantiates a new palette from the PaletteLoader.
public intsize() const Return number of palette inside the container.

Members

public~PaletteContainer()

public voidscanPalettes(const QString & path)

Recursively scans the given folder path for plugins.

public voidscanPalettes(Plugin::Ptrplugin)

Extract the palettes from the given plugin.

public PaletteLoader *findPalette(const QString & type) const

Finds a palette with a specific type.

publicPaletteList*findPalettes(const QString & type,PaletteList* list)

Find a list of palettes of a given type.

This list is Javascript-owned!

public intcountPalettes(const QString & type) const

Find the number of palettes of a given type.

public QStringpaletteName(PaletteLoader * loader)

Get palette name from the interal PaletteLoader object.

publicCodePalette*createPalette(PaletteLoader * loader)

Instantiates a new palette from the PaletteLoader.

Again, this object has Javascript ownership

public intsize() const

Return number of palette inside the container.

class lv::PaletteList

class lv::PaletteList
  : public QAbstractListModel

List of available palettes returned by a PaletteLoader.

Summary

Members Descriptions
public explicitPaletteList(PaletteContainer* container,QObject * parent) Default constructor.
public~PaletteList() Default destructor.
public inline voidsetPosition(int position) Sets position
public QVariantdata(const QModelIndex & index,int role) const Override of the respective QAbstractListModel function.
public inline introwCount(const QModelIndex & parent) const Override of the respective QAbstractListModel function.
public QHash< int, QByteArray >roleNames() const Override of the respective QAbstractListModel function.
public voidappend(PaletteLoader * loader) Appends the loader to the list.
public inline voidremove(PaletteLoader * loader) Remove all appearances of this loader in the palettes.
public inline PaletteLoader *loaderAt(int index) Returns loader at given index.
{slot} public inline intposition() const Returns position of palette.
{slot} public inline intsize() const Palettes size
{slot} publiclv::CodePalette*loadAt(int index) Creates a palette from a loader at the given index.

Members

public explicitPaletteList(PaletteContainer* container,QObject * parent)

Default constructor.

public~PaletteList()

Default destructor.

public inline voidsetPosition(int position)

Sets position

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

Override of the respective QAbstractListModel function.

public inline introwCount(const QModelIndex & parent) const

Override of the respective QAbstractListModel function.

public QHash< int, QByteArray >roleNames() const

Override of the respective QAbstractListModel function.

public voidappend(PaletteLoader * loader)

Appends the loader to the list.

public inline voidremove(PaletteLoader * loader)

Remove all appearances of this loader in the palettes.

public inline PaletteLoader *loaderAt(int index)

Returns loader at given index.

{slot} public inline intposition() const

Returns position of palette.

{slot} public inline intsize() const

Palettes size

{slot} publiclv::CodePalette*loadAt(int index)

Creates a palette from a loader at the given index.

It's a cpp-owned object!

class lv::Project

class lv::Project
  : public QObject

Abstraction of the open project in LiveKeys.

A single instance, 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(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.
publicProjectDocument*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::ProjectDocument* 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*openFile(const QUrl & rootPath,int mode) QUrl variant of the other openFile function.
{slot} publiclv::ProjectDocument*openFile(const QString & rootPath,int mode) Opens the file given by the path, in the given mode.
{slot} publiclv::ProjectDocument*openFile(lv::ProjectFile* file,int mode) Opens the given file in the given mode, this time using the internal ProjectFile object.
{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 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()
enumRunTrigger

Members

publicProject(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

publicProjectDocument*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::ProjectDocument* 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*openFile(const QUrl & rootPath,int mode)

QUrl variant of the other openFile function.

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

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

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

If it is, we update its monitoring state.

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

{slot} publiclv::ProjectDocument*openFile(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} 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 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()

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 QObject

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 inlinelv::ProjectFile*file() const File getter.
public inline QStringcontent() const Returns document content.
public inline voidsetIsDirty(bool isDirty) Sets the "dirty" indicator.
public inline boolisDirty() const
public inline voidsetIsMonitored(bool isMonitored) Sets the indicator for monitoring.
public inline boolisMonitored() const Shows if the document is monitored.
public inline const QDateTime &lastModified() const Returns the timestamp of last modification.
public inline voidsetLastModified(const QDateTime & lastModified) Sets the timestamp of latest modification.
publicProject*parentAsProject() Returns the parent, which is a Project.
public inline QTextDocument *textDocument() Text document which is wrapped inside the ProjectDocument.
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.
public inlineSectionIteratorsectionsBegin() Begin-iterator of the sections.
public inlineSectionIteratorsectionsEnd() End-iterator of the sections.
public inlineSectionConstIteratorsectionsBegin() const Const begin-iterator of the sections.
public inlineSectionConstIteratorsectionsEnd() const Const end-iterator of the sections.
public inline inttotalSections() const Number of sections.
public inline 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 boolisActive() const Shows if the current document is active.
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 inline voidaddEditingState(EditingStatetype) Adds editing state flag.
public inline voidremoveEditingState(EditingStatestate) Removes the given editing state flag.
public inline booleditingStateIs(int flag) const Shows if the editing state includes the given flags.
public inline voidresetEditingState() Resets all of the editing state flags.
{signal} public voidisDirtyChanged() shows dirty state changed
{signal} public voidisMonitoredChanged() shows if monitoring state changed
{signal} public voidfileChanged() triggered when the file changed
{signal} public voidsaved() triggered when the document was saved
{signal} public voidcontentChanged() shows if the document content changed
{signal} public voidformatChanged(int position,int length) shows if the format changed
{slot} public voiddocumentContentsChanged(int position,int charsRemoved,int charsAdded) Slot for tracking text document changes which updates markers and sections.
{slot} public voidsetContent(const QString & content) Sets the content of the document.
{slot} public voidreadContent() Open the document in a read states.
{slot} public boolsave() Save modified document to its respective file.
{slot} public boolsaveAs(const QString & path) Save document content in a different file.
{slot} public boolsaveAs(const QUrl & url) Variant of saveAs using QUrl parameter.
enumOpenMode Enum containing possible modes of opening documents
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 inlinelv::ProjectFile*file() const

File getter.

public inline QStringcontent() const

Returns document content.

public inline voidsetIsDirty(bool isDirty)

Sets the "dirty" indicator.

public inline boolisDirty() const

public inline voidsetIsMonitored(bool isMonitored)

Sets the indicator for monitoring.

public inline boolisMonitored() const

Shows if the document is monitored.

public inline const QDateTime &lastModified() const

Returns the timestamp of last modification.

public inline voidsetLastModified(const QDateTime & lastModified)

Sets the timestamp of latest modification.

publicProject*parentAsProject()

Returns the parent, which is a Project.

public inline QTextDocument *textDocument()

Text document which is wrapped inside the ProjectDocument.

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

public inlineSectionIteratorsectionsBegin()

Begin-iterator of the sections.

public inlineSectionIteratorsectionsEnd()

End-iterator of the sections.

public inlineSectionConstIteratorsectionsBegin() const

Const begin-iterator of the sections.

public inlineSectionConstIteratorsectionsEnd() const

Const end-iterator of the sections.

public inline inttotalSections() const

Number of sections.

public inline 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 boolisActive() const

Shows if the current document is active.

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 inline voidaddEditingState(EditingStatetype)

Adds editing state flag.

public inline voidremoveEditingState(EditingStatestate)

Removes the given editing state flag.

public inline booleditingStateIs(int flag) const

Shows if the editing state includes the given flags.

public inline voidresetEditingState()

Resets all of the editing state flags.

{signal} public voidisDirtyChanged()

shows dirty state changed

{signal} public voidisMonitoredChanged()

shows if monitoring state changed

{signal} public voidfileChanged()

triggered when the file changed

{signal} public voidsaved()

triggered when the document was saved

{signal} public voidcontentChanged()

shows if the document content changed

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

shows if the format changed

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

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

{slot} public voidsetContent(const QString & content)

Sets the content of the document.

{slot} public voidreadContent()

Open the document in a read states.

{slot} public boolsave()

Save modified document to its respective file.

{slot} public boolsaveAs(const QString & path)

Save document content in a different file.

{slot} public boolsaveAs(const QUrl & url)

Variant of saveAs using QUrl parameter.

See also: ProjectDocument::saveAs(const QString &path)

enumOpenMode

Values Descriptions
Edit The file open in the editor
Monitor Read-only, but any external change will be reflected
EditIfNotOpen If not opened, will be open for editing. If already monitored, it will not be available for editing.

Enum containing possible modes of opening documents

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,ProjectDocument* document) Adds a document to the model
public voidrelocateDocument(const QString & path,const QString & newPath,ProjectDocument* document) Changes the path of a document
public voidcloseDocuments() Closes all of the open documents
public inline const QHash< QString,ProjectDocument* >openedFiles() const Returns the hashmap containing the open documents
public voidupdateDocumentMonitoring(ProjectDocument* 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::ProjectDocument* document) Shows that the given document has changed
{signal} public voiddocumentChangedOutside(lv::ProjectDocument* document) Shows that the given document was changed externally
{signal} public voidaboutToClose(lv::ProjectDocument* 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::ProjectDocument*isOpened(const QString & path) Returns if the file is opened.
{slot} publiclv::ProjectDocument*lastOpened() Returns last opened file
{slot} publiclv::ProjectDocument*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,ProjectDocument* document)

Adds a document to the model

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

Changes the path of a document

public voidcloseDocuments()

Closes all of the open documents

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

Returns the hashmap containing the open documents

public voidupdateDocumentMonitoring(ProjectDocument* 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::ProjectDocument* document)

Shows that the given document has changed

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

Shows that the given document was changed externally

{signal} public voidaboutToClose(lv::ProjectDocument* 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::ProjectDocument*isOpened(const QString & path)

Returns if the file is opened.

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

{slot} publiclv::ProjectDocument*lastOpened()

Returns last opened file

{slot} publiclv::ProjectDocument*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 inlineProjectDocument*document() const Document getter
public voidsetDocument(lv::ProjectDocument* 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 inlineProjectDocument*document() const

Document getter

public voidsetDocument(lv::ProjectDocument* 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} 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} 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