| Evolution Shell Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <e-util/e-util.h> 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); 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); gchar * e_str_without_underscores (const gchar *string); 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); 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); 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); GSList * e_util_get_category_filter_options (void); gboolean e_binding_transform_color_to_string (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used); gboolean e_binding_transform_string_to_color (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used); gboolean e_binding_transform_enum_nick_to_value (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used); gboolean e_binding_transform_enum_value_to_nick (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used); gboolean e_binding_transform_source_to_uid (GBinding *binding,const GValue *source_value,GValue *target_value,ESourceList *source_list); gboolean e_binding_transform_uid_to_source (GBinding *binding,const GValue *source_value,GValue *target_value,ESourceList *source_list); GSList * e_charset_add_radio_actions (GtkActionGroup *action_group,const gchar *action_prefix,const gchar *default_charset,GCallback callback,gpointer user_data); EActivity * e_file_replace_contents_async (GFile *file,const gchar *contents,gsize length,const gchar *etag,gboolean make_backup,GFileCreateFlags flags,GAsyncReadyCallback callback,gpointer user_data); gboolean e_file_replace_contents_finish (GFile *file,GAsyncResult *result,gchar **new_etag,GError **error); gchar * e_mktemp (const gchar *template); gint e_mkstemp (const gchar *template); gchar * e_mkdtemp (const gchar *template);
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.
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
|
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.
gchar * e_str_without_underscores (const gchar *string);
Strips underscores from a string in the same way
gtk_label_new_with_mnemonics does. The returned string should be freed
using g_free().
|
the string to strip underscores from |
Returns : |
a newly-allocated string without underscores |
guint32 e_color_to_value (GdkColor *color);
Converts a GdkColor to a 24-bit RGB color value.
|
a GdkColor |
Returns : |
a 24-bit color value |
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);
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 |
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().
gboolean e_binding_transform_color_to_string (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used);
Transforms a GdkColor value to a color string specification.
|
a GBinding |
|
a GValue of type GDK_TYPE_COLOR |
|
a GValue of type G_TYPE_STRING |
|
not used |
Returns : |
TRUE always |
gboolean e_binding_transform_string_to_color (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used);
Transforms a color string specification to a GdkColor.
|
a GBinding |
|
a GValue of type G_TYPE_STRING |
|
a GValue of type GDK_TYPE_COLOR |
|
not used |
Returns : |
TRUE if color string specification was valid |
gboolean e_binding_transform_enum_nick_to_value (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used);
Transforms an enumeration nickname to its corresponding value.
|
a GBinding |
|
a GValue of type G_TYPE_STRING |
|
a GValue whose type is derived from G_TYPE_ENUM |
|
not_used |
Returns : |
TRUE if the enum nickname has a corresponding value |
gboolean e_binding_transform_enum_value_to_nick (GBinding *binding,const GValue *source_value,GValue *target_value,gpointer not_used);
Transforms an enumeration value to its corresponding nickname.
|
a GBinding |
|
a GValue whose type is derived from G_TYPE_ENUM |
|
a GValue of type G_TYPE_STRING |
|
not used |
Returns : |
TRUE if the enum value has a corresponding nickname |
gboolean e_binding_transform_source_to_uid (GBinding *binding,const GValue *source_value,GValue *target_value,ESourceList *source_list);
Transforms an ESource object to its UID string.
|
a GBinding |
|
a GValue of type E_TYPE_SOURCE |
|
a GValue of type G_TYPE_STRING |
|
an ESourceList |
Returns : |
TRUE if source_value was an ESource object |
gboolean e_binding_transform_uid_to_source (GBinding *binding,const GValue *source_value,GValue *target_value,ESourceList *source_list);
Transforms an ESource UID string to the corresponding ESource object
in source_list.
|
a GBinding |
|
a GValue of type G_TYPE_STRING |
|
a GValue of type E_TYPE_SOURCe |
|
an ESourceList |
Returns : |
TRUE if source_list had an ESource object with a matching
UID string |
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 |
EActivity * e_file_replace_contents_async (GFile *file,const gchar *contents,gsize length,const gchar *etag,gboolean make_backup,GFileCreateFlags flags,GAsyncReadyCallback callback,gpointer user_data);
This is a wrapper for g_file_replace_contents_async() that also returns
an EActivity to track the file operation. Cancelling the activity will
cancel the file operation. See g_file_replace_contents_async() for more
details.
|
input GFile |
|
string of contents to replace the file with |
|
the length of contents in bytes |
|
a new entity tag for the file, or NULL
|
|
TRUE if a backup should be created |
|
a set of GFileCreateFlags |
|
a GAsyncReadyCallback to call when the request is satisfied |
|
the data to pass to the callback function |
Returns : |
an EActivity for the file operation |
gboolean e_file_replace_contents_finish (GFile *file,GAsyncResult *result,gchar **new_etag,GError **error);
Finishes an asynchronous replace of the given file. See
e_file_replace_contents_async(). Sets new_etag to the new entity
tag for the document, if present. Free it with g_free() when it is
no longer needed.