Debian Codegraph @

lib/packagekit-glib2/pk-progress-bar.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2009 Richard Hughes <[email protected]>
4 *
5 * Licensed under the GNU Lesser General Public License Version 2.1
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef __PK_PROGRESS_BAR_H
23 #define __PK_PROGRESS_BAR_H
24
25 #include <glib-object.h>
26
27 G_BEGIN_DECLS
28
29 #define PK_TYPE_PROGRESS_BAR (pk_progress_bar_get_type ())
30 #define PK_PROGRESS_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_PROGRESS_BAR, PkProgressBar))
31 #define PK_PROGRESS_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_PROGRESS_BAR, PkProgressBarClass))
32 #define PK_IS_PROGRESS_BAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_PROGRESS_BAR))
33 #define PK_IS_PROGRESS_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_PROGRESS_BAR))
34 #define PK_PROGRESS_BAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_PROGRESS_BAR, PkProgressBarClass))
35
36 typedef struct PkProgressBarPrivate PkProgressBarPrivate;
37
38 typedef struct
39 {
40 GObject parent;
41 PkProgressBarPrivate *priv;
42 } PkProgressBar;
43
44 typedef struct
45 {
46 GObjectClass parent_class;
47 } PkProgressBarClass;
48
49 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
50 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PkProgressBar, g_object_unref)
51 #endif
52
53 GType pk_progress_bar_get_type (void);
54 PkProgressBar *pk_progress_bar_new (void);
55 gboolean pk_progress_bar_set_size (PkProgressBar *progress_bar,
56 guint size);
57 gboolean pk_progress_bar_set_percentage (PkProgressBar *progress_bar,
58 gint percentage);
59 gboolean pk_progress_bar_start (PkProgressBar *progress_bar,
60 const gchar *text);
61 gboolean pk_progress_bar_end (PkProgressBar *progress_bar);
62
63 void pk_progress_bar_set_allow_restart (PkProgressBar *progress_bar,
64 gboolean allow_restart);
65
66 G_END_DECLS
67
68 #endif /* __PK_PROGRESS_BAR_H */