![]() |
![]() |
![]() |
Evolution Shell Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <e-util/e-util.h> const gchar * e_get_user_data_dir (void); const gchar * e_get_accels_filename (void); void e_show_uri (GtkWindow *parent, const gchar *uri); void e_display_help (GtkWindow *parent, const gchar *link_id); GtkAction * e_lookup_action (GtkUIManager *ui_manager, const gchar *action_name); GtkActionGroup * e_lookup_action_group (GtkUIManager *ui_manager, const gchar *group_name); guint e_load_ui_definition (GtkUIManager *ui_manager, const gchar *basename); gint e_action_compare_by_label (GtkAction *action1, GtkAction *action2); void e_action_group_remove_all_actions (GtkActionGroup *action_group); GtkRadioAction * e_radio_action_get_current_action (GtkRadioAction *radio_action); void e_categories_add_change_hook (GHookFunc func, gpointer object); void e_type_traverse (GType parent_type, ETypeFunc func, gpointer user_data); gchar * e_str_without_underscores (const gchar *s); gint e_str_compare (gconstpointer x, gconstpointer y); gint e_str_case_compare (gconstpointer x, gconstpointer y); gint e_collate_compare (gconstpointer x, gconstpointer y); gint e_int_compare (gconstpointer x, gconstpointer y); gboolean e_write_file_uri (const gchar *filename, const gchar *data); guint32 e_color_to_value (GdkColor *color); gchar * e_format_number (gint number); gint (*ESortCompareFunc) (gconstpointer first, gconstpointer second, gpointer closure); void e_bsearch (gconstpointer key, gconstpointer base, gsize nmemb, gsize size, ESortCompareFunc compare, gpointer closure, gsize *start, gsize *end); gsize e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, const struct tm *tm); gsize e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, const struct tm *tm); const gchar * e_get_month_name (GDateMonth month, gboolean abbreviated); const gchar * e_get_weekday_name (GDateWeekday weekday, gboolean abbreviated); gdouble e_flexible_strtod (const gchar *nptr, gchar **endptr); gchar * e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d); cairo_font_options_t * get_font_options (void); void e_file_update_save_path (gchar *uri, gboolean free); gchar * e_file_get_save_path (void); gboolean e_file_lock_create (void); void e_file_lock_destroy (void); gboolean e_file_lock_exists (void); gchar * e_util_guess_mime_type (const gchar *filename, gboolean localfile); gchar * e_util_filename_to_uri (const gchar *filename); gchar * e_util_uri_to_filename (const gchar *uri); gboolean e_util_read_file (const gchar *filename, gboolean filename_is_uri, gchar **buffer, gsize *read, GError **error); GSList * e_util_get_category_filter_options (void); GSList * e_charset_add_radio_actions (GtkActionGroup *action_group, const gchar *action_prefix, const gchar *default_charset, GCallback callback, gpointer user_data); enum ECursorType; void e_cursor_set (GtkWidget *widget, ECursorType cursor); GSList * e_folder_map_local_folders (const gchar *local_dir, const gchar *type); glong e_fsutils_usage (const gchar *path); glong e_fsutils_avail (const gchar *path); gchar * e_mktemp (const gchar *template); gint e_mkstemp (const gchar *template); gchar * e_mkdtemp (const gchar *template);
const gchar * e_get_user_data_dir (void);
Returns the base directory for Evolution-specific user data. The string is owned by Evolution and must not be modified or freed.
Returns : |
base directory for user data |
const gchar * e_get_accels_filename (void);
Returns the name of the user data file containing custom keyboard accelerator specifications.
Returns : |
filename for accelerator specifications |
void e_show_uri (GtkWindow *parent, const gchar *uri);
Launches the default application to show the given URI. The URI must
be of a form understood by GIO. If the URI cannot be shown, it presents
a dialog describing the error. The dialog is set as transient to parent
if parent
is non-NULL
.
|
a parent GtkWindow or NULL
|
|
the URI to show |
void e_display_help (GtkWindow *parent, const gchar *link_id);
Opens the user documentation to the section given by link_id
, or to the
table of contents if link_id
is NULL
. If the user documentation cannot
be opened, it presents a dialog describing the error. The dialog is set
as transient to parent
if parent
is non-NULL
.
|
a parent GtkWindow or NULL
|
|
help section to present or NULL
|
GtkAction * e_lookup_action (GtkUIManager *ui_manager, const gchar *action_name);
Returns the first GtkAction named action_name
by traversing the
list of action groups in ui_manager
. If no such action exists, the
function emits a critical warning before returning NULL
, since this
probably indicates a programming error and most code is not prepared
to deal with lookup failures.
|
a GtkUIManager |
|
the name of an action |
Returns : |
the first GtkAction named action_name
|
GtkActionGroup * e_lookup_action_group (GtkUIManager *ui_manager, const gchar *group_name);
Returns the GtkActionGroup in ui_manager
named group_name
. If no
such action group exists, the function emits a critical warnings before
returning NULL
, since this probably indicates a programming error and
most code is not prepared to deal with lookup failures.
|
a GtkUIManager |
|
the name of an action group |
Returns : |
the GtkActionGroup named group_name
|
guint e_load_ui_definition (GtkUIManager *ui_manager, const gchar *basename);
Loads a UI definition into ui_manager
from Evolution's UI directory.
Failure here is fatal, since the application can't function without
its UI definitions.
|
a GtkUIManager |
|
basename of the UI definition file |
Returns : |
The merge ID for the merged UI. The merge ID can be used to
unmerge the UI with gtk_ui_manager_remove_ui() .
|
gint e_action_compare_by_label (GtkAction *action1, GtkAction *action2);
Compares the labels for action1
and action2
using g_utf8_collate()
.
|
a GtkAction |
|
a GtkAction |
Returns : |
< 0 if action1 compares before action2 , 0 if they
compare equal, > 0 if action1 compares after action2
|
void e_action_group_remove_all_actions (GtkActionGroup *action_group);
Removes all actions from the action group.
|
a GtkActionGroup |
GtkRadioAction * e_radio_action_get_current_action (GtkRadioAction *radio_action);
Returns the currently active member of the group to which radio_action
belongs.
|
a GtkRadioAction |
Returns : |
the currently active group member |
void e_categories_add_change_hook (GHookFunc func, gpointer object);
A saner alternative to e_categories_register_change_listener()
.
Adds a hook function to be called when a category is added, removed or
modified. If object
is not NULL
, the hook function is automatically
removed when object
is finalized.
|
a hook function |
|
a GObject to be passed to func , or NULL
|
void e_type_traverse (GType parent_type, ETypeFunc func, gpointer user_data);
Calls func
for all instantiable subtypes of parent_type
.
This is often useful for extending functionality by way of EModule.
A module may register a subtype of parent_type
in its e_module_load()
function. Then later on the application will call e_type_traverse()
to instantiate all registered subtypes of parent_type
.
|
the root GType to traverse from |
|
the function to call for each visited GType |
|
user data to pass to the function |
gchar * e_str_without_underscores (const gchar *s);
Strips underscores from a string in the same way
gtk_label_new_with_mnemonics
does. The returned string should be freed
using g_free()
.
|
|
Returns : |
a newly-allocated string without underscores |
gboolean e_write_file_uri (const gchar *filename, const gchar *data);
|
|
|
|
Returns : |
guint32 e_color_to_value (GdkColor *color);
Converts a GdkColor to a 24-bit RGB color value.
|
|
Returns : |
a 24-bit color value |
gint (*ESortCompareFunc) (gconstpointer first, gconstpointer second, gpointer closure);
|
|
|
|
|
|
Returns : |
void e_bsearch (gconstpointer key, gconstpointer base, gsize nmemb, gsize size, ESortCompareFunc compare, gpointer closure, gsize *start, gsize *end);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gsize e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, const struct tm *tm);
|
|
|
|
|
|
|
|
Returns : |
gsize e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, const struct tm *tm);
|
|
|
|
|
|
|
|
Returns : |
const gchar * e_get_month_name (GDateMonth month, gboolean abbreviated);
Returns the localized name for month
. If abbreviated
is TRUE
,
returns the locale's abbreviated month name.
|
month index |
|
if TRUE , abbreviate the month name
|
Returns : |
localized month name |
const gchar * e_get_weekday_name (GDateWeekday weekday, gboolean abbreviated);
Returns the localized name for weekday
. If abbreviated
is TRUE
,
returns the locale's abbreviated weekday name.
|
weekday index |
|
if TRUE , abbreviate the weekday name
|
Returns : |
localized weekday name |
gdouble e_flexible_strtod (const gchar *nptr, gchar **endptr);
Converts a string to a gdouble value. This function detects strings either in the standard C locale or in the current locale.
This function is typically used when reading configuration files or other non-user input that should not be locale dependent, but may have been in the past. To handle input from the user you should normally use the locale-sensitive system strtod function.
To convert from a double to a string in a locale-insensitive way, use
g_ascii_dtostr
.
|
the string to convert to a numeric value. |
|
if non-NULL, it returns the character after the last character used in the conversion. |
Returns : |
the gdouble value |
gchar * e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d);
Converts a double to a string, using the '.' as decimal_point. To format the number you pass in a printf-style formating string. Allowed conversion specifiers are eEfFgG.
If you want to generates enough precision that converting
the string back using g_strtod
gives the same machine-number
(on machines with IEEE compatible 64bit doubles) use the format
string "%.17g". If you do this it is guaranteed that the size
of the resulting string will never be larger than
G_ASCII_DTOSTR_BUF_SIZE
bytes.
|
A buffer to place the resulting string in |
|
The length of the buffer. |
|
The printf-style format to use for the code to use for converting. |
|
The double to convert |
Returns : |
the pointer to the buffer with the converted string |
void e_file_update_save_path (gchar *uri, gboolean free);
Save the save_dir path for evolution. If free is TRUE, uri gets freed when
done. Genearally, this should be called with the output of
gtk_file_chooser_get_current_folder_uri()
The URI must be a path URI, not a
file URI.
|
URI to store |
|
If TRUE, free uri |
gchar * e_file_get_save_path (void);
Return the save_dir path for evolution. If there isn't a save_dir, returns the users home directory. Returns an allocated URI that should be freed by the caller.
Returns : |
gchar * e_util_guess_mime_type (const gchar *filename, gboolean localfile);
Tries to determine the MIME type for filename
. Free the returned
string with g_free()
.
|
a local file name, or URI |
|
TRUE to check the file content, FALSE to check only the name
|
Returns : |
the MIME type of filename , or NULL if the the MIME type could
not be determined
|
gchar * e_util_filename_to_uri (const gchar *filename);
Converts a local file name to a URI. Free the returned string with
g_free()
.
|
local file name. |
Returns : |
a newly allocated string or NULL
|
gchar * e_util_uri_to_filename (const gchar *uri);
Converts a URI to a local file name. NULL
indicates no such
local file name exists. Free the returned string with g_free()
.
|
a URI |
Returns : |
either newly allocated string or NULL
|
gboolean e_util_read_file (const gchar *filename, gboolean filename_is_uri, gchar **buffer, gsize *read, GError **error);
Reads synchronously content of the file, to which is pointed either by path or by URI. Mount point should be already mounted when calling this function.
|
File name to read. |
|
Whether the file name is URI, if not, then it's a local path. |
|
Read content or the file. Should not be NULL. Returned value should be freed with g_free. |
|
Number of actually read bytes. Should not be NULL. |
|
Here will be returned an error from reading operations. Can be NULL. Not every time is set when returned FALSE. |
Returns : |
Whether was reading successful or not. |
GSList * e_charset_add_radio_actions (GtkActionGroup *action_group, const gchar *action_prefix, const gchar *default_charset, GCallback callback, gpointer user_data);
Adds a set of GtkRadioActions for available character sets to
action_group
. The default_charset
(or locale character set if
default_charset
is NULL
) will be added first, and selected by
default (except that ISO-8859-1 will always be used instead of
US-ASCII). Any other character sets of the same language class as
the default will be added next, followed by the remaining character
sets.
|
a GtkActionGroup |
|
a prefix for action names, or NULL
|
|
the default character set, or NULL to use the
locale character set
|
|
a callback function for actions in the group, or NULL
|
|
user data to be passed to callback , or NULL
|
Returns : |
the radio action group |
typedef enum { E_CURSOR_FAT_CROSS, E_CURSOR_THIN_CROSS, E_CURSOR_ARROW, E_CURSOR_MOVE, E_CURSOR_ZOOM_IN, E_CURSOR_ZOOM_OUT, E_CURSOR_SIZE_X, E_CURSOR_SIZE_Y, E_CURSOR_SIZE_TL, E_CURSOR_SIZE_TR, E_CURSOR_PRESS, E_CURSOR_HAND_OPEN, E_CURSOR_HAND_CLOSED, E_CURSOR_XTERM, E_CURSOR_NUM_CURSORS } ECursorType;
void e_cursor_set (GtkWidget *widget, ECursorType cursor);
Sets the cursor specified, to the top level window of the given widget. It is not window aware, so if you popup a window, it will not have busy cursor set. That has to be handled seperately with a new call to this function.
|
Any widget in a window, to which busy cursor has to be set cursor: The type of cursor to be set defined in e-cursor.h |
|
GSList * e_folder_map_local_folders (const gchar *local_dir, const gchar *type);
|
|
|
|
Returns : |
glong e_fsutils_usage (const gchar *path);
Calculate the amount of disk space used by a given path.
|
|
Returns : |
The number of 1024 byte blocks used by the filesystem. |
glong e_fsutils_avail (const gchar *path);
Find the available disk space at the given path.
|
|
Returns : |
-1 if it could not be determined, otherwise the number of disk blocks, expressed as system-independent, 1024 byte blocks. |