Foundry.TextManager

g Foundry.Contextual Foundry.Contextual Foundry.Service Foundry.Service Foundry.Contextual->Foundry.Service Foundry.TextManager Foundry.TextManager Foundry.Service->Foundry.TextManager GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

None

Methods

Inherited:

Foundry.Service (8), Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

Foundry.ServiceClass (3), GObject.ObjectClass (5)

apply_edits (edits, operation)

list_documents ()

load (file, operation, encoding)

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5)

Properties

Inherited:

Foundry.Contextual (1)

Signals

Inherited:

GObject.Object (1)

Name

Short Description

document-added

document-removed

document-saved

This signal is emitted whenever a [class`Foundry`.TextDocument] managed by the manager emits “saved”.

Fields

Inherited:

GObject.Object (1)

Class Details

class Foundry.TextManager(**kwargs)
Bases:

Foundry.Service

Abstract:

No

Structure:

Foundry.TextManagerClass

Manages text documents and provides text editing services.

Foundry.TextManager coordinates text buffer creation, document management, and provides a unified interface for text editing operations. It handles document loading, saving, and maintains relationships between files and their text representations.

apply_edits(edits, operation)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

Applies all of edits to the respective files.

list_documents()
Returns:

a [iface`Gio`.ListModel] of [class`Foundry`.TextDocument]

Return type:

Gio.ListModel

load(file, operation, encoding)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.TextDocument].

Return type:

Dex.Future

Loads the file as a text document.

Signal Details

Foundry.TextManager.signals.document_added(text_manager, object, p0)
Signal Name:

document-added

Flags:

RUN_LAST

Parameters:
Foundry.TextManager.signals.document_removed(text_manager, object)
Signal Name:

document-removed

Flags:

RUN_LAST

Parameters:
Foundry.TextManager.signals.document_saved(text_manager, document)
Signal Name:

document-saved

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a [class`Foundry`.TextDocument] managed by the manager emits “saved”.

New in version 1.1.