Top | ![]() |
![]() |
![]() |
![]() |
GeditDocumentCompressionType | compression-type | Read / Write / Construct |
gchar * | content-type | Read / Write |
gboolean | empty-search | Read |
GeditEncoding * | encoding | Read |
GFile * | location | Read / Write |
gchar * | mime-type | Read |
GeditDocumentNewlineType | newline-type | Read / Write / Construct |
gboolean | read-only | Read |
gchar * | shortname | Read / Write |
GeditDocumentPrivate | |
struct | GeditDocument |
enum | GeditDocumentSaveFlags |
enum | GeditDocumentNewlineType |
#define | GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT |
enum | GeditDocumentCompressionType |
#define | GEDIT_DOCUMENT_ERROR |
void gedit_document_set_location (GeditDocument *doc
,GFile *location
);
gchar *
gedit_document_get_uri_for_display (GeditDocument *doc
);
Note: this never returns NULL
.
gchar *
gedit_document_get_short_name_for_display
(GeditDocument *doc
);
Note: this never returns NULL
.
void gedit_document_set_short_name_for_display (GeditDocument *doc
,const gchar *short_name
);
gchar *
gedit_document_get_mime_type (GeditDocument *doc
);
Note: this never returns NULL
.
void gedit_document_load (GeditDocument *doc
,GFile *location
,const GeditEncoding *encoding
,gint line_pos
,gint column_pos
,gboolean create
);
Load a document. This results in the "load" signal to be emitted.
doc |
the GeditDocument. |
|
location |
the location where to load the document from. |
|
encoding |
the GeditEncoding to encode the document, or |
[allow-none] |
line_pos |
the line to show. |
|
column_pos |
the column to show. |
|
create |
whether the document should be created if it doesn't exist. |
void gedit_document_load_stream (GeditDocument *doc
,GInputStream *stream
,const GeditEncoding *encoding
,gint line_pos
,gint column_pos
);
gboolean
gedit_document_load_cancel (GeditDocument *doc
);
Cancel load of a document.
void gedit_document_save (GeditDocument *doc
,GeditDocumentSaveFlags flags
);
Save the document to its previous location. This results in the "save" signal to be emitted.
void gedit_document_save_as (GeditDocument *doc
,GFile *location
,const GeditEncoding *encoding
,GeditDocumentNewlineType newline_type
,GeditDocumentCompressionType compression_type
,GeditDocumentSaveFlags flags
);
Save the document to a new location. This results in the "save" signal to be emitted.
doc |
the GeditDocument. |
|
location |
the location where to save the document. |
|
encoding |
the GeditEncoding to encode the document. |
|
newline_type |
the GeditDocumentNewlineType for the document. |
|
compression_type |
the compression type for the file. |
|
flags |
optionnal GeditDocumentSaveFlags. |
gboolean gedit_document_goto_line_offset (GeditDocument *doc
,gint line
,gint line_offset
);
void gedit_document_set_language (GeditDocument *doc
,GtkSourceLanguage *lang
);
GeditDocumentNewlineType
gedit_document_get_newline_type (GeditDocument *doc
);
GeditDocumentCompressionType
gedit_document_get_compression_type (GeditDocument *doc
);
void gedit_document_set_content_type (GeditDocument *doc
,const gchar *content_type
);
gchar * gedit_document_get_metadata (GeditDocument *doc
,const gchar *key
);
Gets the metadata assigned to key
.
void gedit_document_set_metadata (GeditDocument *doc
,const gchar *first_key
,...
);
Sets metadata on a document.
doc |
||
first_key |
name of the first key to set |
|
... |
value for the first key, followed optionally by more key/value pairs,
followed by |
[allow-none] |
void gedit_document_set_search_context (GeditDocument *doc
,GtkSourceSearchContext *search_context
);
Sets the new search context for the document. Use this function only when the search occurrences are highlighted. So this function should not be used for background searches. The purpose is to have only one highlighted search context at a time in the document.
After using this function, you should unref the search_context
. The doc
should be the only owner of the search_context
, so that the Clear Highlight
action works. If you need the search_context
after calling this function,
use gedit_document_get_search_context()
.
GtkSourceSearchContext *
gedit_document_get_search_context (GeditDocument *doc
);
Gets the search context. Use this function only if you have used
gedit_document_set_search_context()
before. You should not alter other search
contexts, so you have to verify that the returned search context is yours.
One way to verify that is to compare the search settings object, or to mark
the search context with g_object_set_data()
.
#define GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF
“compression-type”
property“compression-type” GeditDocumentCompressionType
The :compression-type property determines how to compress the document when saving
Flags: Read / Write / Construct
Default value: GEDIT_DOCUMENT_COMPRESSION_TYPE_NONE
“content-type”
property“content-type” gchar *
The document's Content Type.
Flags: Read / Write
Default value: NULL
“empty-search”
property“empty-search” gboolean
Flags: Read
Default value: TRUE
“encoding”
property“encoding” GeditEncoding *
The GeditEncoding used for the document.
Flags: Read
“mime-type”
property“mime-type” gchar *
The document's MIME Type.
Flags: Read
Default value: "text/plain"
“newline-type”
property“newline-type” GeditDocumentNewlineType
The :newline-type property determines what is considered as a line ending when saving the document
Flags: Read / Write / Construct
Default value: GEDIT_DOCUMENT_NEWLINE_TYPE_LF
“read-only”
property“read-only” gboolean
Whether the document is read only or not.
Flags: Read
Default value: FALSE
“shortname”
property“shortname” gchar *
The document's short name.
Flags: Read / Write
Default value: NULL
“cursor-moved”
signalvoid user_function (GeditDocument *geditdocument, gpointer user_data)
Flags: Run Last
“load”
signalvoid user_function (GeditDocument *document, GFile *location, GeditEncoding *encoding, gint line_pos, gint column_pos, gpointer user_data)
The "load" signal is emitted when a document is loaded.
document |
the GeditDocument. |
|
location |
the location where to load the document from. |
|
encoding |
the GeditEncoding to encode the document. |
|
line_pos |
the line to show. |
|
column_pos |
the column to show. |
|
create |
whether the document should be created if it doesn't exist. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 2.22
“loaded”
signalvoid user_function (GeditDocument *geditdocument, GError *arg1, gpointer user_data)
Flags: Run Last
“loading”
signalvoid user_function (GeditDocument *geditdocument, guint64 arg1, guint64 arg2, gpointer user_data)
Flags: Run Last
“save”
signalvoid user_function (GeditDocument *document, GFile *location, GeditEncoding *encoding, GeditDocumentNewlineType newline_type, GeditDocumentCompressionType compression_type, GeditDocumentSaveFlags flags, gpointer user_data)
The "save" signal is emitted when the document is saved.
document |
the GeditDocument. |
|
location |
the location where the document is about to be saved. |
|
encoding |
the GeditEncoding used to save the document. |
|
newline_type |
the GeditDocumentNewlineType used to save the document. |
|
compression_type |
the GeditDocumentCompressionType used to save the document. |
|
flags |
the GeditDocumentSaveFlags for the save operation. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 2.20
“saved”
signalvoid user_function (GeditDocument *geditdocument, GError *arg1, gpointer user_data)
Flags: Run Last
“saving”
signalvoid user_function (GeditDocument *geditdocument, guint64 arg1, guint64 arg2, gpointer user_data)
Flags: Run Last