Top |
GflsUnsavedDocumentTitles is used to give titles to unsaved documents, such as "Unsaved Document N" with 'N' replaced by a number.
This is for new documents that have never been saved before and reside in memory only. These documents have not yet an associated GFile.
Do not confuse it with documents with unsaved changes.
gchar *
(*GflsUnsavedDocumentTitleCallback) (gint num
);
Type definition for a function that will be called to create a string
containing num
, to give a name to a document not yet present on disk.
Since: 0.1
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_new (void
);
Since: 0.1
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_get_default
(void
);
Since: 0.1
gint
gfls_unsaved_document_titles_allocate_number
(GflsUnsavedDocumentTitles *titles
);
Allocates a number for an unsaved document. When the document is saved on
disk, you need to give back the number with
gfls_unsaved_document_titles_release_number()
.
The returned number is the lowest available value, starting at 1.
Since: 0.1
void gfls_unsaved_document_titles_release_number (GflsUnsavedDocumentTitles *titles
,gint number
);
Call this function to give back number
to titles
, so that it becomes
available for a next unsaved document. This is usually done when the document
is saved on disk.
Since: 0.1
gchar * gfls_unsaved_document_titles_get_title (GflsUnsavedDocumentTitles *titles
,gint number
);
Generates the title of an unsaved document. To customize the returned string,
you can use gfls_unsaved_document_titles_set_title_callback()
.
Since: 0.1
void gfls_unsaved_document_titles_set_title_callback (GflsUnsavedDocumentTitles *titles
,GflsUnsavedDocumentTitleCallback title_callback
);
Sets a GflsUnsavedDocumentTitleCallback function. To reset to the default
setting, pass NULL
to title_callback
.
The callback will be used by gfls_unsaved_document_titles_get_title()
.
Examples:
"Unsaved Document N"
"Unsaved File N"
"Untitled Document N"
"New Document N"
Etc.
[skip]
Since: 0.1