| pluma Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
enum PlumaSearchFlags; PlumaDocumentPrivate; struct PlumaDocument; enum PlumaDocumentSaveFlags; #define PLUMA_DOCUMENT_ERROR GQuark pluma_document_error_quark (void); PlumaDocument * pluma_document_new (void); gchar * pluma_document_get_uri (PlumaDocument *doc); gchar * pluma_document_get_uri_for_display (PlumaDocument *doc); gchar * pluma_document_get_short_name_for_display (PlumaDocument *doc); gchar * pluma_document_get_mime_type (PlumaDocument *doc); gboolean pluma_document_get_readonly (PlumaDocument *doc); void pluma_document_load (PlumaDocument *doc,const gchar *uri,const PlumaEncoding *encoding,gint line_pos,gboolean create); gboolean pluma_document_insert_file (PlumaDocument *doc,GtkTextIter *iter,const gchar *uri,const PlumaEncoding *encoding); gboolean pluma_document_load_cancel (PlumaDocument *doc); void pluma_document_save (PlumaDocument *doc,PlumaDocumentSaveFlags flags); void pluma_document_save_as (PlumaDocument *doc,const gchar *uri,const PlumaEncoding *encoding,PlumaDocumentSaveFlags flags); gboolean pluma_document_is_untouched (PlumaDocument *doc); gboolean pluma_document_is_untitled (PlumaDocument *doc); gboolean pluma_document_get_deleted (PlumaDocument *doc); gboolean pluma_document_goto_line (PlumaDocument *doc,gint line); void pluma_document_set_search_text (PlumaDocument *doc,const gchar *text,guint flags); gchar * pluma_document_get_search_text (PlumaDocument *doc,guint *flags); gboolean pluma_document_get_can_search_again (PlumaDocument *doc); gboolean pluma_document_search_forward (PlumaDocument *doc,const GtkTextIter *start,const GtkTextIter *end,GtkTextIter *match_start,GtkTextIter *match_end); gboolean pluma_document_search_backward (PlumaDocument *doc,const GtkTextIter *start,const GtkTextIter *end,GtkTextIter *match_start,GtkTextIter *match_end); gint pluma_document_replace_all (PlumaDocument *doc,const gchar *find,const gchar *replace,guint flags); void pluma_document_set_language (PlumaDocument *doc,GtkSourceLanguage *lang); void pluma_document_set_enable_search_highlighting (PlumaDocument *doc,gboolean enable); gboolean pluma_document_get_enable_search_highlighting (PlumaDocument *doc); #define PLUMA_SEARCH_IS_DONT_SET_FLAGS (sflags) #define PLUMA_SEARCH_SET_DONT_SET_FLAGS (sflags, state) #define PLUMA_SEARCH_IS_ENTIRE_WORD (sflags) #define PLUMA_SEARCH_SET_ENTIRE_WORD (sflags, state) #define PLUMA_SEARCH_IS_CASE_SENSITIVE (sflags) #define PLUMA_SEARCH_SET_CASE_SENSITIVE (sflags, state)
"can-search-again" gboolean : Read "content-type" gchar* : Read / Write "enable-search-highlighting" gboolean : Read / Write "encoding" PlumaEncoding* : Read "mime-type" gchar* : Read "newline-type" PlumaDocumentNewlineType : Read / Write "read-only" gboolean : Read "shortname" gchar* : Read / Write "uri" gchar* : Read
"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 {
PLUMA_SEARCH_DONT_SET_FLAGS = 1 << 0,
PLUMA_SEARCH_ENTIRE_WORD = 1 << 1,
PLUMA_SEARCH_CASE_SENSITIVE = 1 << 2,
PLUMA_SEARCH_PARSE_ESCAPES = 1 << 3
} PlumaSearchFlags;
typedef enum {
PLUMA_DOCUMENT_SAVE_IGNORE_MTIME = 1 << 0,
PLUMA_DOCUMENT_SAVE_IGNORE_BACKUP = 1 << 1,
PLUMA_DOCUMENT_SAVE_PRESERVE_BACKUP = 1 << 2
} PlumaDocumentSaveFlags;
gchar * pluma_document_get_uri_for_display (PlumaDocument *doc);
gchar * pluma_document_get_short_name_for_display
(PlumaDocument *doc);
void pluma_document_load (PlumaDocument *doc,const gchar *uri,const PlumaEncoding *encoding,gint line_pos,gboolean create);
Load a document. This results in the "load" signal to be emitted.
|
the PlumaDocument. |
|
the uri where to load the document from. |
|
the PlumaEncoding to encode the document. |
|
the line to show. |
|
whether the document should be created if it doesn't exist. |
gboolean pluma_document_insert_file (PlumaDocument *doc,GtkTextIter *iter,const gchar *uri,const PlumaEncoding *encoding);
gboolean pluma_document_load_cancel (PlumaDocument *doc);
Cancel load of a document.
|
the PlumaDocument. |
void pluma_document_save (PlumaDocument *doc,PlumaDocumentSaveFlags flags);
Save the document to its previous location. This results in the "save" signal to be emitted.
|
the PlumaDocument. |
|
optionnal PlumaDocumentSaveFlags. |
void pluma_document_save_as (PlumaDocument *doc,const gchar *uri,const PlumaEncoding *encoding,PlumaDocumentSaveFlags flags);
Save the document to a new location. This results in the "save" signal to be emitted.
|
the PlumaDocument. |
|
the uri where to save the document. |
|
the PlumaEncoding to encode the document. |
|
optionnal PlumaDocumentSaveFlags. |
void pluma_document_set_search_text (PlumaDocument *doc,const gchar *text,guint flags);
gchar * pluma_document_get_search_text (PlumaDocument *doc,guint *flags);
gboolean pluma_document_get_can_search_again (PlumaDocument *doc);
gboolean pluma_document_search_forward (PlumaDocument *doc,const GtkTextIter *start,const GtkTextIter *end,GtkTextIter *match_start,GtkTextIter *match_end);
gboolean pluma_document_search_backward (PlumaDocument *doc,const GtkTextIter *start,const GtkTextIter *end,GtkTextIter *match_start,GtkTextIter *match_end);
gint pluma_document_replace_all (PlumaDocument *doc,const gchar *find,const gchar *replace,guint flags);
void pluma_document_set_language (PlumaDocument *doc,GtkSourceLanguage *lang);
void pluma_document_set_enable_search_highlighting (PlumaDocument *doc,gboolean enable);
gboolean pluma_document_get_enable_search_highlighting
(PlumaDocument *doc);
#define PLUMA_SEARCH_IS_DONT_SET_FLAGS(sflags) ((sflags & PLUMA_SEARCH_DONT_SET_FLAGS) != 0)
#define PLUMA_SEARCH_IS_ENTIRE_WORD(sflags) ((sflags & PLUMA_SEARCH_ENTIRE_WORD) != 0)
#define PLUMA_SEARCH_IS_CASE_SENSITIVE(sflags) ((sflags & PLUMA_SEARCH_CASE_SENSITIVE) != 0)
"can-search-again" property "can-search-again" gboolean : Read
Whether it's possible to search again in the document.
Default value: FALSE
"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" PlumaDocumentNewlineType : Read / Write
The :newline-type property determines what is considered as a line ending when saving the document
Default value: PLUMA_DOCUMENT_NEWLINE_TYPE_LF
"read-only" property "read-only" gboolean : Read
Whether the document is read only or not.
Default value: FALSE
"shortname" property "shortname" gchar* : Read / Write
The document's short name.
Default value: NULL
"cursor-moved" signalvoid user_function (PlumaDocument *plumadocument,
gpointer user_data) : Run Last
"load" signalvoid user_function (PlumaDocument *document,
gchar *uri,
PlumaEncoding *encoding,
gint line_pos,
gboolean create,
gpointer user_data) : Run Last
The "load" signal is emitted when a document is loaded.
|
the PlumaDocument. |
|
the uri where to load the document from. |
|
the PlumaEncoding 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 (PlumaDocument *plumadocument,
gpointer arg1,
gpointer user_data) : Run Last
"loading" signalvoid user_function (PlumaDocument *plumadocument,
guint64 arg1,
guint64 arg2,
gpointer user_data) : Run Last
"save" signalvoid user_function (PlumaDocument *document,
gchar *uri,
PlumaEncoding *encoding,
PlumaDocumentSaveFlags flags,
gpointer user_data) : Run Last
The "save" signal is emitted when the document is saved.
|
the PlumaDocument. |
|
the uri where the document is about to be saved. |
|
the PlumaEncoding used to save the document. |
|
the PlumaDocumentSaveFlags for the save operation. |
|
user data set when the signal handler was connected. |
Since 2.20
"saved" signalvoid user_function (PlumaDocument *plumadocument,
gpointer arg1,
gpointer user_data) : Run Last
"saving" signalvoid user_function (PlumaDocument *plumadocument,
guint64 arg1,
guint64 arg2,
gpointer user_data) : Run Last
"search-highlight-updated" signalvoid user_function (PlumaDocument *plumadocument,
GtkTextIter *arg1,
GtkTextIter *arg2,
gpointer user_data) : Run Last