![]() |
![]() |
![]() |
gedit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
enum GeditSearchFlags; GeditDocumentPrivate; struct GeditDocument; enum GeditDocumentSaveFlags; #define GEDIT_DOCUMENT_ERROR GQuark gedit_document_error_quark (void
); GeditDocument * gedit_document_new (void
); GFile * gedit_document_get_location (GeditDocument *doc
); gchar * gedit_document_get_uri_for_display (GeditDocument *doc
); gchar * gedit_document_get_short_name_for_display (GeditDocument *doc
); gchar * gedit_document_get_mime_type (GeditDocument *doc
); gboolean gedit_document_get_readonly (GeditDocument *doc
); void gedit_document_load (GeditDocument *doc
,GFile *location
,const GeditEncoding *encoding
,gint line_pos
,gint column_pos
,gboolean create
); gboolean gedit_document_load_cancel (GeditDocument *doc
); void gedit_document_save (GeditDocument *doc
,GeditDocumentSaveFlags flags
); void gedit_document_save_as (GeditDocument *doc
,GFile *location
,const GeditEncoding *encoding
,GeditDocumentNewlineType newline_type
,GeditDocumentCompressionType compression_type
,GeditDocumentSaveFlags flags
); gboolean gedit_document_is_untouched (GeditDocument *doc
); gboolean gedit_document_is_untitled (GeditDocument *doc
); gboolean gedit_document_get_deleted (GeditDocument *doc
); gboolean gedit_document_goto_line (GeditDocument *doc
,gint line
); void gedit_document_set_search_text (GeditDocument *doc
,const gchar *text
,guint flags
); gchar * gedit_document_get_search_text (GeditDocument *doc
,guint *flags
); gboolean gedit_document_get_can_search_again (GeditDocument *doc
); gboolean gedit_document_search_forward (GeditDocument *doc
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
); gboolean gedit_document_search_backward (GeditDocument *doc
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
); gint gedit_document_replace_all (GeditDocument *doc
,const gchar *find
,const gchar *replace
,guint flags
); void gedit_document_set_language (GeditDocument *doc
,GtkSourceLanguage *lang
); void gedit_document_set_enable_search_highlighting (GeditDocument *doc
,gboolean enable
); gboolean gedit_document_get_enable_search_highlighting (GeditDocument *doc
); #define GEDIT_SEARCH_IS_DONT_SET_FLAGS (sflags) #define GEDIT_SEARCH_SET_DONT_SET_FLAGS (sflags, state) #define GEDIT_SEARCH_IS_ENTIRE_WORD (sflags) #define GEDIT_SEARCH_SET_ENTIRE_WORD (sflags, state) #define GEDIT_SEARCH_IS_CASE_SENSITIVE (sflags) #define GEDIT_SEARCH_SET_CASE_SENSITIVE (sflags, state)
"can-search-again" gboolean : Read "compression-type" GeditDocumentCompressionType : Read / Write / Construct "content-type" gchar* : Read / Write "enable-search-highlighting" gboolean : Read / Write "encoding" GeditEncoding* : Read "location" GFile* : Read / Write "mime-type" gchar* : Read "newline-type" GeditDocumentNewlineType : Read / Write / Construct "read-only" gboolean : Read "shortname" gchar* : Read / Write
"cursor-moved" :Run Last
"load" :Run Last
"loaded" :Run Last
"loading" :Run Last
"save" :Run Last
"saved" :Run Last
"saving" :Run Last
"search-highlight-updated" :Run Last
typedef enum { GEDIT_SEARCH_DONT_SET_FLAGS = 1 << 0, GEDIT_SEARCH_ENTIRE_WORD = 1 << 1, GEDIT_SEARCH_CASE_SENSITIVE = 1 << 2 } GeditSearchFlags;
typedef enum { GEDIT_DOCUMENT_SAVE_IGNORE_MTIME = 1 << 0, GEDIT_DOCUMENT_SAVE_IGNORE_BACKUP = 1 << 1, GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP = 1 << 2, GEDIT_DOCUMENT_SAVE_IGNORE_INVALID_CHARS= 1 << 3 } GeditDocumentSaveFlags;
save file despite external modifications. | |
write the file directly without attempting to backup. | |
preserve previous backup file, needed to support autosaving. | |
GFile * gedit_document_get_location (GeditDocument *doc
);
|
a GeditDocument |
Returns : |
a copy of the internal GFile. [allow-none][transfer full] |
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
.
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.
|
the GeditDocument. |
|
the location where to load the document from. |
|
the GeditEncoding to encode the document, or NULL . [allow-none]
|
|
the line to show. |
|
the column to show. |
|
whether the document should be created if it doesn't exist. |
gboolean gedit_document_load_cancel (GeditDocument *doc
);
Cancel load of a document.
|
the GeditDocument. |
void gedit_document_save (GeditDocument *doc
,GeditDocumentSaveFlags flags
);
Save the document to its previous location. This results in the "save" signal to be emitted.
|
the GeditDocument. |
|
optionnal GeditDocumentSaveFlags. |
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.
|
the GeditDocument. |
|
the location where to save the document. |
|
the GeditEncoding to encode the document. |
|
the GeditDocumentNewlineType for the document. |
|
optionnal GeditDocumentSaveFlags. |
void gedit_document_set_search_text (GeditDocument *doc
,const gchar *text
,guint flags
);
gchar * gedit_document_get_search_text (GeditDocument *doc
,guint *flags
);
|
. [allow-none] |
gboolean gedit_document_get_can_search_again (GeditDocument *doc
);
gboolean gedit_document_search_forward (GeditDocument *doc
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
);
|
. [allow-none] |
|
. [allow-none] |
|
. [allow-none] |
|
. [allow-none] |
gboolean gedit_document_search_backward (GeditDocument *doc
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
);
|
. [allow-none] |
|
. [allow-none] |
|
. [allow-none] |
|
. [allow-none] |
gint gedit_document_replace_all (GeditDocument *doc
,const gchar *find
,const gchar *replace
,guint flags
);
void gedit_document_set_language (GeditDocument *doc
,GtkSourceLanguage *lang
);
|
. [allow-none] |
void gedit_document_set_enable_search_highlighting (GeditDocument *doc
,gboolean enable
);
gboolean gedit_document_get_enable_search_highlighting
(GeditDocument *doc
);
#define GEDIT_SEARCH_IS_DONT_SET_FLAGS(sflags) ((sflags & GEDIT_SEARCH_DONT_SET_FLAGS) != 0)
#define GEDIT_SEARCH_IS_ENTIRE_WORD(sflags) ((sflags & GEDIT_SEARCH_ENTIRE_WORD) != 0)
#define GEDIT_SEARCH_IS_CASE_SENSITIVE(sflags) ((sflags & GEDIT_SEARCH_CASE_SENSITIVE) != 0)
"can-search-again"
property "can-search-again" gboolean : Read
Wheter it's possible to search again in the document.
Default value: FALSE
"compression-type"
property "compression-type" GeditDocumentCompressionType : Read / Write / Construct
The :compression-type property determines how to compress the document when saving
Default value: GEDIT_DOCUMENT_COMPRESSION_TYPE_NONE
"content-type"
property "content-type" gchar* : Read / Write
The document's Content Type.
Default value: NULL
"enable-search-highlighting"
property "enable-search-highlighting" gboolean : Read / Write
Whether all the occurences of the searched string must be highlighted.
Default value: FALSE
"mime-type"
property "mime-type" gchar* : Read
The document's MIME Type.
Default value: "text/plain"
"newline-type"
property "newline-type" GeditDocumentNewlineType : Read / Write / Construct
The :newline-type property determines what is considered as a line ending when saving the document
Default value: GEDIT_DOCUMENT_NEWLINE_TYPE_LF
"read-only"
property "read-only" gboolean : Read
Whether the document is read only or not.
Default value: FALSE
"cursor-moved"
signalvoid user_function (GeditDocument *geditdocument,
gpointer user_data) : Run Last
"load"
signalvoid user_function (GeditDocument *document,
GFile *location,
GeditEncoding *encoding,
gint line_pos,
gboolean create,
gpointer user_data) : Run Last
The "load" signal is emitted when a document is loaded.
|
the GeditDocument. |
|
the location where to load the document from. |
|
the GeditEncoding to encode the document. |
|
the line to show. |
|
whether the document should be created if it doesn't exist. |
|
user data set when the signal handler was connected. |
Since 2.22
"loaded"
signalvoid user_function (GeditDocument *geditdocument,
GError *arg1,
gpointer user_data) : Run Last
"loading"
signalvoid user_function (GeditDocument *geditdocument,
guint64 arg1,
guint64 arg2,
gpointer user_data) : Run Last
"save"
signalvoid user_function (GeditDocument *document,
GFile *location,
GeditEncoding *encoding,
GeditDocumentNewlineType flags,
GeditDocumentCompressionType arg4,
GeditDocumentSaveFlags arg5,
gpointer user_data) : Run Last
The "save" signal is emitted when the document is saved.
|
the GeditDocument. |
|
the location where the document is about to be saved. |
|
the GeditEncoding used to save the document. |
|
the GeditDocumentSaveFlags for the save operation. |
|
user data set when the signal handler was connected. |
Since 2.20
"saved"
signalvoid user_function (GeditDocument *geditdocument,
GError *arg1,
gpointer user_data) : Run Last
"saving"
signalvoid user_function (GeditDocument *geditdocument,
guint64 arg1,
guint64 arg2,
gpointer user_data) : Run Last
"search-highlight-updated"
signalvoid user_function (GeditDocument *geditdocument,
GtkTextIter *arg1,
GtkTextIter *arg2,
gpointer user_data) : Run Last