| Evolution Shell Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
#include <shell/e-shell-module.h>
EShellModule;
EShellModuleInfo;
EShellModule * e_shell_module_new (struct _EShell *shell,
const gchar *filename);
gint e_shell_module_compare (EShellModule *shell_module_a,
EShellModule *shell_module_b);
const gchar * e_shell_module_get_config_dir (EShellModule *shell_module);
const gchar * e_shell_module_get_data_dir (EShellModule *shell_module);
const gchar * e_shell_module_get_filename (EShellModule *shell_module);
struct _EShell * e_shell_module_get_shell (EShellModule *shell_module);
void e_shell_module_add_activity (EShellModule *shell_module,
EActivity *activity);
gboolean e_shell_module_is_busy (EShellModule *shell_module);
gboolean e_shell_module_shutdown (EShellModule *shell_module);
void e_shell_module_set_info (EShellModule *shell_module,
const EShellModuleInfo *info);
"filename" gchar* : Read / Write / Construct Only "shell" EShell* : Read / Write / Construct Only
typedef struct _EShellModule EShellModule;
Contains only private data that should be read and manipulated using the functions below.
typedef struct {
const gchar *name;
const gchar *aliases;
const gchar *schemes;
gint sort_order;
gboolean (*is_busy) (EShellModule *shell_module);
gboolean (*shutdown) (EShellModule *shell_module);
} EShellModuleInfo;
const gchar * |
The name of the module. Also becomes the name of the corresponding EShellView subclass that the module will register. |
const gchar * |
Colon-separated list of aliases that can be used when referring to a module by name. |
const gchar * |
Colon-separated list of URI schemes. The EShell will forward command-line URIs to the appropriate module based on this list. |
gint |
Used to determine the order of modules listed in
the main menu and in the switcher. See
e_shell_module_compare().
|
|
Callback for querying whether the module has
operations in progress that cannot be cancelled
or finished immediately. Returning TRUE prevents
the application from shutting down.
|
|
Callback for notifying the module to begin
shutting down. Returning FALSE indicates there
are still unfinished operations and the EShell
should check back shortly.
|
EShellModule * e_shell_module_new (struct _EShell *shell, const gchar *filename);
Loads filename as a GTypeModule and tries to invoke a module
function named e_shell_module_init, passing
the newly loaded GTypeModule as an argument. The shell module is
responsible for defining such a function to perform the appropriate
initialization steps.
|
an EShell |
|
the name of the file containing the shell module |
Returns : |
a new EShellModule |
gint e_shell_module_compare (EShellModule *shell_module_a, EShellModule *shell_module_b);
Using the sort_order field from both modules'
EShellModuleInfo, compares shell_module_a with shell_mobule_b and
returns -1, 0 or +1 if shell_module_a is found to be less than, equal
to or greater than shell_module_b, respectively.
|
an EShellModule |
|
an EShellModule |
Returns : |
-1, 0 or +1, for a less than, equal to or greater than result |
const gchar * e_shell_module_get_config_dir (EShellModule *shell_module);
Returns the absolute path to the configuration directory for
shell_module. The string is owned by shell_module and should
not be modified or freed.
|
an EShellModule |
Returns : |
the module's configuration directory |
const gchar * e_shell_module_get_data_dir (EShellModule *shell_module);
Returns the absolute path to the data directory for shell_module.
The string is owned by shell_module and should not be modified or
freed.
|
an EShellModule |
Returns : |
the module's data directory |
const gchar * e_shell_module_get_filename (EShellModule *shell_module);
Returns the name of the file from which shell_module was loaded.
The string is owned by shell_module and should not be modified or
freed.
|
an EShellModule |
Returns : |
the module's file name |
struct _EShell * e_shell_module_get_shell (EShellModule *shell_module);
Returns the EShell that was passed to e_shell_module_new().
|
an EShellModule |
Returns : |
the EShell |
void e_shell_module_add_activity (EShellModule *shell_module, EActivity *activity);
Emits an "activity-added" signal.
|
an EShellModule |
|
an EActivity |
gboolean e_shell_module_is_busy (EShellModule *shell_module);
Returns TRUE if shell_module is busy and cannot be shutdown at
present. Each module must define what "busy" means to them and
determine an appropriate response.
XXX This function is likely to change or disappear. I'm toying with the idea of just having it check whether there are any unfinished EActivity's left, so we have a consistent and easily testable definition of what "busy" means.
|
an EShellModule |
Returns : |
TRUE if the module is busy
|
gboolean e_shell_module_shutdown (EShellModule *shell_module);
Alerts shell_module to begin shutdown procedures. If the module is
busy and cannot immediately shut down, the function returns FALSE.
A TRUE response implies shell_module has successfully shut down.
XXX This function is likely to change or disappear. I'm toying with the idea of just having it check whether there are any unfinished EActivity's left, so we have a consistent and easily testable definition of what "busy" means.
|
an EShellModule |
Returns : |
TRUE if the module has shut down, FALSE if the module is
busy and cannot immediately shut down
|
void e_shell_module_set_info (EShellModule *shell_module, const EShellModuleInfo *info);
Registers basic configuration information about shell_module that
the EShell can use for processing command-line arguments.
Configuration information should be registered from
shell_module's e_shell_module_init
initialization function. See e_shell_module_new() for more information.
|
an EShellModule |
|
an EShellModuleInfo |
"filename" property"filename" gchar* : Read / Write / Construct Only
The filename of the module.
Default value: NULL
"activity-added" signalvoid user_function (EShellModule *shell_module, EActivity *activity, gpointer user_data) : Run Last
Broadcasts a newly added activity.
|
the EShellModule that emitted the signal |
|
an EActivity |
|
user data set when the signal handler was connected. |