1 /*
2  * GNT - The GLib Ncurses Toolkit
3  *
4  * GNT is the legal property of its developers, whose names are too numerous
5  * to list here.  Please refer to the COPYRIGHT file distributed with this
6  * source distribution.
7  *
8  * This library is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
21  */
22 
23 #ifndef GNT_PROGRESS_BAR_H
24 #define GNT_PROGRESS_BAR_H
25 /**
26  * SECTION:gntprogressbar
27  * @section_id: libgnt-gntprogressbar
28  * @title: GntProgressBar
29  * @short_description: A widget that shows progress visually
30  */
31 
32 #include "gnt.h"
33 #include "gntwidget.h"
34 
35 #define GNT_TYPE_PROGRESS_BAR          (gnt_progress_bar_get_type ())
36 #define GNT_PROGRESS_BAR(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBar))
37 #define GNT_PROGRESS_BAR_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST ((k), GNT_TYPE_PROGRESS_BAR, GntProgressBarClass))
38 #define GNT_IS_PROGRESS_BAR(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNT_TYPE_PROGRESS_BAR))
39 #define GNT_IS_PROGRESS_BAR_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), GNT_TYPE_PROGRESS_BAR))
40 #define GNT_PROGRESS_BAR_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), GNT_TYPE_PROGRESS_BAR, GntProgressBarClass))
41 
42 typedef enum _GntProgressBarOrientation
43 {
44    GNT_PROGRESS_LEFT_TO_RIGHT,
45    GNT_PROGRESS_RIGHT_TO_LEFT,
46    GNT_PROGRESS_BOTTOM_TO_TOP,
47    GNT_PROGRESS_TOP_TO_BOTTOM,
48 } GntProgressBarOrientation;
49 
50 typedef struct _GntProgressBar GntProgressBar;
51 
52 typedef struct _GntProgressBarClass
53 {
54    GntWidgetClass parent;
55 
56 	/*< private >*/
57    void (*gnt_reserved1)(void);
58    void (*gnt_reserved2)(void);
59    void (*gnt_reserved3)(void);
60    void (*gnt_reserved4)(void);
61 } GntProgressBarClass;
62 
63 G_BEGIN_DECLS
64 
65 /**
66  * gnt_progress_bar_get_type:
67  *
68  * Get the #GType for GntProgressBar
69  *
70  * Returns: The GType for GntProrgressBar
71  *
72  * Since: 2.6.0
73  */
74 GType
75 gnt_progress_bar_get_type (void);
76 
77 /**
78  * gnt_progress_bar_new:
79  *
80  * Create a new GntProgressBar
81  *
82  * Returns: The new GntProgressBar
83  *
84  * Since: 2.6.0
85  */
86 GntWidget *
87 gnt_progress_bar_new (void);
88 
89 /**
90  * gnt_progress_bar_set_fraction:
91  * @pbar: The GntProgressBar
92  * @fraction: The value between 0 and 1 to display
93  *
94  * Set the progress for a progress bar
95  *
96  * Since: 2.6.0
97  */
98 void
99 gnt_progress_bar_set_fraction (GntProgressBar *pbar, gdouble fraction);
100 
101 /**
102  * gnt_progress_bar_set_orientation:
103  * @pbar: The GntProgressBar
104  * @orientation: The orientation to use
105  *
106  * Set the orientation for a progress bar
107  *
108  * Since: 2.6.0
109  */
110 void
111 gnt_progress_bar_set_orientation (GntProgressBar *pbar, GntProgressBarOrientation orientation);
112 
113 /**
114  * gnt_progress_bar_set_show_progress:
115  * @pbar: The GntProgressBar
116  * @show: A boolean indicating if the value is shown
117  *
118  * Controls whether the progress value is shown
119  *
120  * Since: 2.6.0
121  */
122 void
123 gnt_progress_bar_set_show_progress (GntProgressBar *pbar, gboolean show);
124 
125 /**
126  * gnt_progress_bar_get_fraction:
127  * @pbar: The GntProgressBar
128  *
129  * Get the progress that is displayed
130  *
131  * Returns: The progress displayed as a value between 0 and 1
132  *
133  * Since: 2.6.0
134  */
135 gdouble
136 gnt_progress_bar_get_fraction (GntProgressBar *pbar);
137 
138 /**
139  * gnt_progress_bar_get_orientation:
140  * @pbar: The GntProgressBar
141  *
142  * Get the orientation for the progress bar
143  *
144  * Returns: The current orientation of the progress bar
145  *
146  * Since: 2.6.0
147  */
148 GntProgressBarOrientation
149 gnt_progress_bar_get_orientation (GntProgressBar *pbar);
150 
151 /**
152  * gnt_progress_bar_get_show_progress:
153  * @pbar: The GntProgressBar
154  *
155  * Get a boolean describing if the progress value is shown
156  *
157  * Returns: %TRUE if the progress value is shown, %FALSE otherwise.
158  *
159  * Since: 2.6.0
160  */
161 gboolean
162 gnt_progress_bar_get_show_progress (GntProgressBar *pbar);
163 
164 G_END_DECLS
165 
166 #endif /* GNT_PROGRESS_BAR_H */
167