libyui-gtk  2.44.7
ygtksteps.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* YGtkSteps is a widget that displays a list of steps, useful
6  to show the progress of some configuration tool as it does
7  the work of updating files or services or whatever.
8 
9  You use the append functions to initializate the steps. If,
10  for some reason, you want one step to count as more than one
11  (ie. so that a ygtk_steps_advance() needs to be called more than
12  once to actually advance for a given step), you may append a
13  step with the same name of the previous, that they'll be collapsed.
14  (Internally, we call that the 'strength' of the step.)
15 
16  Using GtkLabels, so it should be ATK friendly.
17 */
18 
19 #ifndef YGTK_STEPS_H
20 #define YGTK_STEPS_H
21 #include <gtk/gtk.h>
22 G_BEGIN_DECLS
23 
24 #define YGTK_TYPE_STEPS (ygtk_steps_get_type ())
25 #define YGTK_STEPS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
26  YGTK_TYPE_STEPS, YGtkSteps))
27 #define YGTK_STEPS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
28  YGTK_TYPE_STEPS, YGtkStepsClass))
29 #define YGTK_IS_STEPS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
30  YGTK_TYPE_STEPS))
31 #define YGTK_IS_STEPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
32  YGTK_TYPE_STEPS))
33 #define YGTK_STEPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
34  YGTK_TYPE_STEPS, YGtkStepsClass))
35 
36 typedef struct _YGtkSteps
37 {
38  GtkVBox parent;
39 
40  // private:
41  gint current_step;
42  PangoLayout *check_mark_layout, *current_mark_layout, *todo_mark_layout;
43  // for current_mark little animation
44  guint current_mark_timeout_id, current_mark_frame;
45 
46 } YGtkSteps;
47 
48 typedef struct _YGtkStepsClass
49 {
50  GtkVBoxClass parent_class;
52 
53 GtkWidget* ygtk_steps_new (void);
54 GType ygtk_steps_get_type (void) G_GNUC_CONST;
55 
56 gint ygtk_steps_append (YGtkSteps *steps, const gchar *label);
57 void ygtk_steps_append_heading (YGtkSteps *steps, const gchar *heading);
58 
59 void ygtk_steps_set_current (YGtkSteps *steps, gint step); /* -1 = none */
60 gint ygtk_steps_total (YGtkSteps *steps);
61 const gchar *ygtk_steps_get_nth_label (YGtkSteps *steps, gint n);
62 
63 void ygtk_steps_clear (YGtkSteps *steps);
64 
65 G_END_DECLS
66 
67 #endif /* YGTK_STEPS_H */