![]() |
![]() |
![]() |
libosso-rtcom-accounts Reference Manual | ![]() |
---|---|---|---|---|
RtcomWidgetIface; RtcomWidget; #define RTCOM_DEFINE_WIDGET_TYPE (TN, t_n, T_P) void rtcom_widget_instance_init (RtcomWidget *widget); void rtcom_widget_class_init (GObjectClass *object_class); void rtcom_widget_set_account (RtcomWidget *widget, RtcomAccountItem *account); RtcomAccountItem* rtcom_widget_get_account (RtcomWidget *widget); void rtcom_widget_set_msg_next (RtcomWidget *widget, const gchar *message); const gchar* rtcom_widget_get_msg_next (RtcomWidget *widget); void rtcom_widget_set_error_widget (RtcomWidget *widget, GtkWidget *error_widget); void rtcom_widget_focus_error (RtcomWidget *widget); gboolean rtcom_widget_validate (RtcomWidget *widget, GError **error); gboolean rtcom_widget_get_value (RtcomWidget *widget, GValue *value); void rtcom_widget_value_changed (RtcomWidget *widget);
This interface is to be implemented by all UI widgets that meet any of these needs:
Since this interface includes some hacks to support interface data, it's
recommended that you declare your widgets by the RTCOM_DEFINE_WIDGET_TYPE()
macro.
typedef struct { GTypeInterface g_iface; /* methods */ gboolean (* store_settings) (RtcomWidget *rtcom_widget, GError **error, RtcomAccountItem *item); void (* get_settings) (RtcomWidget *rtcom_widget, RtcomAccountItem *item); void (* set_account) (RtcomWidget *widget, RtcomAccountItem *account); gboolean (* validate) (RtcomWidget *widget, GError **error); gboolean (* get_value) (RtcomWidget *widget, GValue *value); } RtcomWidgetIface;
void rtcom_widget_instance_init (RtcomWidget *widget);
Call this function from the _init()
method of the widgets implementing this
interface (the RTCOM_DEFINE_WIDGET_TYPE()
macro does this for you).
widget : |
void rtcom_widget_class_init (GObjectClass *object_class);
Call this function at the end of the _class_init()
of the widgets
implementing this interface (the RTCOM_DEFINE_WIDGET_TYPE()
macro does this
for you).
object_class : |
the GObjectClass being initialized. |
void rtcom_widget_set_account (RtcomWidget *widget, RtcomAccountItem *account);
Associates widgets
with account
.
widget : |
the RtcomWidget. |
account : |
a RtcomAccountItem. |
RtcomAccountItem* rtcom_widget_get_account (RtcomWidget *widget);
widget : |
the RtcomWidget. |
Returns : | the RtcomAccountItem bound to widget .
|
void rtcom_widget_set_msg_next (RtcomWidget *widget, const gchar *message);
Sets the message to be displayed if the wizard's Next button is pressed
while widget
has its "can-next" property set to FALSE
.
widget : |
the RtcomWidget. |
message : |
the message. |
const gchar* rtcom_widget_get_msg_next (RtcomWidget *widget);
widget : |
the RtcomWidget. |
Returns : | the error-on-next message. |
void rtcom_widget_set_error_widget (RtcomWidget *widget, GtkWidget *error_widget);
For composite RtcomWidgets, determine which is the GtkWidget that is
causing the "can-next" propery to be FALSE
. This is using to set some error
indicator on the widget (typically, move the focus to it).
widget : |
the RtcomWidget. |
error_widget : |
a GtkWidget. |
void rtcom_widget_focus_error (RtcomWidget *widget);
Set some error indicator on the widget. In the current implementation, this function should set the focus to the widget.
widget : |
the RtcomWidget. |
gboolean rtcom_widget_validate (RtcomWidget *widget, GError **error);
Asks the widget to validate itself. The function will return TRUE
if
validation succeeded, otherwise it will return FALSE
and set error
. In the
latter case, the widget can also request the focus back to itself.
widget : |
the RtcomWidget. |
error : |
pointer to a GError variable to receive an error. |
Returns : | TRUE on success, FALSE otherwise.
|
gboolean rtcom_widget_get_value (RtcomWidget *widget, GValue *value);
Retrieve the value of widget
into value
. If value
is unset, the widget
will initialize it to the type most suitable for the widget data; otherwise,
it will try to return the value of the requested type.
widget : |
the RtcomWidget. |
value : |
a GValue, either unset or initialized with a type supported by the widget. |
Returns : | TRUE on success, FALSE otherwise.
|
void rtcom_widget_value_changed (RtcomWidget *widget);
Implementations call this method to signal their value has changed.
widget : |
the RtcomWidget. |