![]() |
![]() |
![]() |
Libfm Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define FM_TEMPLATE_TYPE FmTemplate; FmTemplateClass; gboolean fm_template_create_file (FmTemplate *templ
,GFile *path
,GError **error
,gboolean run_default
); FmIcon * fm_template_get_icon (FmTemplate *templ
); const gchar * fm_template_get_label (FmTemplate *templ
); FmMimeType * fm_template_get_mime_type (FmTemplate *templ
); const gchar * fm_template_get_name (FmTemplate *templ
,gint *nlen
); const gchar * fm_template_get_prompt (FmTemplate *templ
); gboolean fm_template_is_directory (FmTemplate *templ
); GList * fm_template_list_all (gboolean user_only
);
include
: libfm/fm.h
The FmTemplate object represents description which files was set for creation and how those files should be created - that includes custom prompt, file name template, and template contents.
gboolean fm_template_create_file (FmTemplate *templ
,GFile *path
,GError **error
,gboolean run_default
);
Tries to create file at path
using rules of creating from templ
.
|
a template descriptor. [allow-none] |
|
path to file to create |
|
location to retrieve error. [allow-none] |
|
TRUE to run default application on new file |
Returns : |
TRUE if file created successfully. |
Since 1.2.0
FmIcon * fm_template_get_icon (FmTemplate *templ
);
Retrieves icon defined for templ
. Returned data are owned by templ
and should be not freed by caller.
|
a template descriptor |
Returns : |
icon for template. [transfer none] |
Since 1.2.0
const gchar * fm_template_get_label (FmTemplate *templ
);
Retrieves label for templ
. It can be used as label in menu. Returned
data are owned by templ
and should be not freed by caller.
|
a template descriptor |
Returns : |
template label. [transfer none] |
Since 1.2.0
FmMimeType * fm_template_get_mime_type (FmTemplate *templ
);
Retrieves MIME type descriptor for templ
. Returned data are owned by
templ
and should be not freed by caller.
|
a template descriptor |
Returns : |
mime type descriptor. [transfer none] |
Since 1.2.0
const gchar * fm_template_get_name (FmTemplate *templ
,gint *nlen
);
Retrieves file name template for templ
. If nlen
isn't NULL
then it
will receive length of file name template without suffix (in characters).
Returned data are owned by templ
and should be not freed by caller.
|
a template descriptor |
|
location to get template name length. [allow-none] |
Returns : |
file name template. [transfer none] |
Since 1.2.0
const gchar * fm_template_get_prompt (FmTemplate *templ
);
Retrieves prompt for templ
. It can be used as label in entry for the
desired name. If no prompt is defined then returns NULL
. Returned
data are owned by templ
and should be not freed by caller.
|
a template descriptor |
Returns : |
file prompt. [transfer none] |
Since 1.2.0
gboolean fm_template_is_directory (FmTemplate *templ
);
Checks if templ
is directory template.
|
a template descriptor |
Returns : |
TRUE if templ is directory template. |
Since 1.2.0
GList * fm_template_list_all (gboolean user_only
);
Retrieves list of all templates. Returned data should be freed after usage with g_list_free_full(list, g_object_unref).
|
TRUE to ignore system templates |
Returns : |
list of all known templates. [transfer full][element-type FmTemplate] |
Since 1.2.0