![]() |
![]() |
![]() |
Evolution Utilities Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
struct EConfig; struct EConfigItem; EConfigFactory; struct EConfigTarget; void (*EConfigFactoryFunc) (EConfig *config
,gpointer data
); gboolean (*EConfigCheckFunc) (EConfig *config
,const gchar *pageid
,gpointer data
); void (*EConfigItemsFunc) (EConfig *config
,GSList *items
,gpointer data
); GtkWidget (*EConfigItemFactoryFunc) (EConfig *config
,EConfigItem *item
,GtkWidget *parent
,GtkWidget *old
,gint position
,gpointer data
); EConfigFactory * e_config_class_add_factory (EConfigClass *klass
,const gchar *id
,EConfigFactoryFunc func
,gpointer user_data
); void e_config_class_remove_factory (EConfigClass *klass
,EConfigFactory *f
); EConfig * e_config_construct (EConfig *config
,gint type
,const gchar *id
); void e_config_add_items (EConfig *config
,GSList *items
,EConfigItemsFunc freefunc
,gpointer data
); void e_config_add_page_check (EConfig *config
,const gchar *pageid
,EConfigCheckFunc func
,gpointer data
); void e_config_set_page_is_finish (EConfig *config
,const gchar *pageid
,gboolean is_finish
); void e_config_add_skip_check (EConfig *config
,const gchar *pageid
,EConfigCheckFunc func
,gpointer data
); void e_config_set_target (EConfig *config
,EConfigTarget *target
); GtkWidget * e_config_create_widget (EConfig *config
); GtkWidget * e_config_create_window (EConfig *config
,GtkWindow *parent
,const gchar *title
); void e_config_target_changed (EConfig *config
,e_config_target_change_t how
); gboolean e_config_page_check (EConfig *config
,const gchar *pageid
); GtkWidget * e_config_page_get (EConfig *config
,const gchar *pageid
); const gchar * e_config_page_next (EConfig *config
,const gchar *pageid
); const gchar * e_config_page_prev (EConfig *config
,const gchar *pageid
); void e_config_abort (EConfig *config
); void e_config_commit (EConfig *config
); gpointer e_config_target_new (EConfig *config
,gint type
,gsize size
); void e_config_target_free (EConfig *config
,gpointer Param2
); struct EConfigHookGroup; struct EConfigHook; typedef EConfigHookTargetMap; typedef EConfigHookTargetMask; struct EConfigHookItemFactoryData; struct EConfigHookPageCheckData; void (*EConfigHookFunc) (EPlugin *plugin
,EConfigTarget *target
); void (*EConfigHookItemFactoryFunc) (EPlugin *plugin
,EConfigHookItemFactoryData *data
); void e_config_hook_class_add_target_map (EConfigHookClass *klass
,const EConfigHookTargetMap *map
);
struct EConfigItem { enum _e_config_t type; gchar *path; /* absolute path, must sort * ascii-lexographically into the right spot */ gchar *label; EConfigItemFactoryFunc factory; gpointer user_data; };
struct EConfigTarget { struct _EConfig *config; GtkWidget *widget; /* used if you need a parent toplevel, if available */ guint32 type; /* implementation fields follow, depends on window type */ };
gboolean (*EConfigCheckFunc) (EConfig *config
,const gchar *pageid
,gpointer data
);
GtkWidget (*EConfigItemFactoryFunc) (EConfig *config
,EConfigItem *item
,GtkWidget *parent
,GtkWidget *old
,gint position
,gpointer data
);
EConfigFactory * e_config_class_add_factory (EConfigClass *klass
,const gchar *id
,EConfigFactoryFunc func
,gpointer user_data
);
Add a config factory which will be called to add_items()
any
extra items's if wants to, to the current Config window.
TODO: Make the id a pattern?
|
Implementing class pointer. |
|
The name of the configuration window you're interested in. This may be NULL to be called for all windows. |
|
An EConfigFactoryFunc to call when the window id is being
created. |
|
Callback data. |
Returns : |
A handle to the factory. |
void e_config_class_remove_factory (EConfigClass *klass
,EConfigFactory *f
);
Removes a config factory.
|
an EConfigFactory |
EConfig * e_config_construct (EConfig *config
,gint type
,const gchar *id
);
Used by implementing classes to initialise base parameters.
|
The instance to initialise. |
|
The type of configuration manager, E_CONFIG_BOOK or
E_CONFIG_ASSISTANT . |
|
The name of the configuration window this manager drives. |
Returns : |
ep is returned. |
void e_config_add_items (EConfig *config
,GSList *items
,EConfigItemsFunc freefunc
,gpointer data
);
Add new EConfigItems to the configuration window. Nothing will be done with them until the widget is built.
TODO: perhaps commit and abort should just be signals.
|
An initialised implementing instance of EConfig. |
|
A list of EConfigItem's to add to the configuration manager
ec . |
|
If supplied, called to free the item list (and/or items) once they are no longer needed. |
|
Data for the callback methods. |
void e_config_add_page_check (EConfig *config
,const gchar *pageid
,EConfigCheckFunc func
,gpointer data
);
Add a page-checking function callback. It will be called to validate the
data in the given page or pages. If pageid
is NULL then it will be called
to validate every page, or the whole configuration window.
In the latter case, the pageid in the callback will be either the specific page being checked, or NULL when the whole config window is being checked.
The page check function is used to validate input before allowing the assistant to continue or the notebook to close.
|
Initialised implemeting instance of EConfig. |
|
pageid to check. |
|
checking callback. |
|
user-data for the callback. |
void e_config_set_page_is_finish (EConfig *config
,const gchar *pageid
,gboolean is_finish
);
With is_finish set on the pageid the page is treated as the last page in an assistant.
|
Initialised implementing instance of EConfig. |
|
pageid to change the value on. |
|
whether the pageid can finish immediately or not. |
void e_config_add_skip_check (EConfig *config
,const gchar *pageid
,EConfigCheckFunc func
,gpointer data
);
Adds a callback function to decide whether to skip the page in a GtkAssistant, useful if the page is blank in certain conditions.
The callback function should return TRUE
if the page should be
skipped, or FALSE
if the page should be visited.
|
an EConfig |
|
the page ID for the skip page callback |
|
the skip page callback function |
|
data to pass to the callback function |
void e_config_set_target (EConfig *config
,EConfigTarget *target
);
Sets the target object for the config window. Generally the target
is set only once, and will supply its own "changed" signal which
can be used to drive the modal. This is a virtual method so that
the implementing class can connect to the changed signal and
initiate a e_config_target_changed()
call where appropriate.
|
An initialised EConfig. |
|
A target allocated from emp . |
GtkWidget * e_config_create_widget (EConfig *config
);
Create the widget described by emp
. Only the core widget
appropriate for the given type is created, i.e. a GtkNotebook for
the E_CONFIG_BOOK type and a GtkAssistant for the E_CONFIG_ASSISTANT
type.
This object will be self-driving, but will not close itself once complete.
Unless reffed otherwise, the management object emp
will be
finalized when the widget is.
|
An initialised EConfig object. |
Returns : |
The widget, also available in emp.widget
|
GtkWidget * e_config_create_window (EConfig *config
,GtkWindow *parent
,const gchar *title
);
Create a managed GtkWindow object from emp
. This window will be
fully driven by the EConfig emp
. If emp.type
is
E_CONFIG_ASSISTANT
, then this will be a toplevel GtkWindow containing
a GtkAssistant. If it is E_CONFIG_BOOK
then it will be a GtkDialog
containing a Notebook.
Unless reffed otherwise, the management object emp
will be
finalized when the widget is.
|
Initialised and configured EMConfig derived instance. |
|
Parent window or NULL. |
|
Title of window or dialog. |
Returns : |
The window widget. This is also stored in emp.window . |
void e_config_target_changed (EConfig *config
,e_config_target_change_t how
);
Indicate that the target has changed. This may be called by the
self-aware target itself, or by the driving code. If how
is
E_CONFIG_TARGET_CHANGED_REBUILD
, then the entire configuration
widget may be recreated based on the changed target.
This is used to sensitise Assistant next/back buttons and the Apply button for the Notebook mode.
|
an EConfig |
|
an enum value indicating how the target has changed |
gboolean e_config_page_check (EConfig *config
,const gchar *pageid
);
Check that a given page is complete. If pageid
is NULL, then check
the whole config. No check is made that the page actually exists.
|
an EConfig |
|
the path of the page item |
Returns : |
FALSE if the data is inconsistent/incomplete. |
GtkWidget * e_config_page_get (EConfig *config
,const gchar *pageid
);
Retrieve the page widget corresponding to pageid
.
|
The path of the page item. |
Returns : |
The page widget. It will be the root GtkNotebook container or the GtkBox object inside the assistant. |
const gchar * e_config_page_next (EConfig *config
,const gchar *pageid
);
Find the path of the next visible page after pageid
. If pageid
is NULL then find the first visible page.
|
The path of the page item. |
Returns : |
The path of the next page, or NULL if pageid was the
last configured and visible page. |
const gchar * e_config_page_prev (EConfig *config
,const gchar *pageid
);
Find the path of the previous visible page before pageid
. If pageid
is NULL then find the last visible page.
|
an EConfig |
|
The path of the page item. |
Returns : |
The path of the previous page, or NULL if pageid was the
first configured and visible page. |
void e_config_abort (EConfig *config
);
Signify that the stateful configuration changes must be discarded to all listeners. This is used by self-driven assistant or notebook, or may be used by code using the widget directly.
|
an EConfig |
void e_config_commit (EConfig *config
);
Signify that the stateful configuration changes should be saved. This is used by the self-driven assistant or notebook, or may be used by code driving the widget directly.
|
an EConfig |
gpointer e_config_target_new (EConfig *config
,gint type
,gsize size
);
Allocate a new config target suitable for this class. Implementing classes will define the actual content of the target.
|
Parent EConfig object. |
|
type, up to implementor |
|
Size of object to allocate. |
void e_config_target_free (EConfig *config
,gpointer Param2
);
Free a target. The implementing class can override this method to free custom targets.
|
Parent EConfig object. |
|
The target to fre. |
struct EConfigHookGroup { struct _EConfigHook *hook; /* parent pointer */ gchar *id; /* target menu id for these config items */ gint target_type; /* target type of this group */ GSList *items; /* items to add to group */ gchar *check; /* validate handler, if set */ gchar *commit; /* commit handler, if set */ gchar *abort; /* abort handler, if set */ };
struct EConfigHookItemFactoryData { EConfig *config; EConfigItem *item; EConfigTarget *target; GtkWidget *parent; GtkWidget *old; gint position; };
struct EConfigHookPageCheckData { EConfig *config; EConfigTarget *target; const gchar *pageid; };
void (*EConfigHookItemFactoryFunc) (EPlugin *plugin
,EConfigHookItemFactoryData *data
);
void e_config_hook_class_add_target_map (EConfigHookClass *klass
,const EConfigHookTargetMap *map
);
class
: The dervied EconfigHook class.
map
: A map used to describe a single EConfigTarget type for this
class.
Add a targe tmap to a concrete derived class of EConfig. The target map enumates the target types available for the implenting class.