Top |
GtexTemplatesPersonal implements GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest, GtkTreeSortable and GtkBuildable.
GtexTemplatesPersonal is a singleton class that stores information about pesonal templates.
Personal templates are stored in the ~/.local/share/enter-tex/
directory.
There is a templatesrc file that stores the list of names, icons and files.
GtexTemplatesPersonal *
gtex_templates_personal_get_instance (void
);
Gets the instance of the GtexTemplatesPersonal singleton.
gchar * gtex_templates_personal_get_contents (GtexTemplatesPersonal *templates
,GtkTreePath *path
);
Gets the contents of a personal template.
TODO load contents asynchronously.
templates |
the GtexTemplatesPersonal instance. |
|
path |
the GtkTreePath of a personal template. |
gboolean gtex_templates_personal_create (GtexTemplatesPersonal *templates
,const gchar *name
,const gchar *config_icon_name
,const gchar *contents
,GError **error
);
Creates a new personal template. The new template is added at the end of the list.
templates |
the GtexTemplatesPersonal instance. |
|
name |
the template's name. |
|
config_icon_name |
the icon name that will be stored in the config file. |
|
contents |
the template's contents. |
|
error |
[out][optional] |
gboolean gtex_templates_personal_delete (GtexTemplatesPersonal *templates
,GtkTreeIter *iter
,GError **error
);
Deletes a personal template.
templates |
the GtexTemplatesPersonal instance. |
|
iter |
a valid GtkTreeIter. |
|
error |
[out][optional] |
gboolean gtex_templates_personal_move_up (GtexTemplatesPersonal *templates
,GtkTreeIter *iter
,GError **error
);
Moves up a personal template. There must be a previous template before iter
.
templates |
the GtexTemplatesPersonal instance. |
|
iter |
a valid GtkTreeIter. |
|
error |
[out][optional] |
gboolean gtex_templates_personal_move_down (GtexTemplatesPersonal *templates
,GtkTreeIter *iter
,GError **error
);
Moves down a personal template. There must be a template after iter
.
templates |
the GtexTemplatesPersonal instance. |
|
iter |
a valid GtkTreeIter. |
|
error |
[out][optional] |