Mercurial > projects > pk-update-icon
annotate pkui-backend.h @ 14:64f05992d8ec
GObject-based rewrite
use asynchronous packagekit-glib API
use persistent menu widget and notification object
update existing notification when new updates become available, close it when no updates are available
show status icon when updates are available, hide it when no updates are available
hide icon when gpk-update-viewer is executed, check for updates when gpk-update-viewer exits
introduce a startup delay before the first check for updates is made
add context menu item to manually trigger a check for updates
remove context menu item for quitting pk-update-icon
author | Guido Berhoerster <guido@berhoerster.name> |
---|---|
date | Thu, 20 Oct 2011 08:19:22 +0200 |
parents | |
children | f6edbee6441f |
rev | line source |
---|---|
14
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
1 /* |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
2 * (C) 2011 Guido Berhoerster <gber@opensuse.org> |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
3 * |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
4 * Licensed under the GNU General Public License Version 2 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
5 * |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
6 * This program is free software; you can redistribute it and/or modify |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
9 * (at your option) any later version. |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
10 * |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
14 * GNU General Public License for more details. |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
15 * |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
19 */ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
20 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
21 #ifndef __PKUI_BACKEND_H |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
22 #define __PKUI_BACKEND_H |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
23 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
24 #include <glib-object.h> |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
25 #include <packagekit-glib2/packagekit.h> |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
26 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
27 G_BEGIN_DECLS |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
28 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
29 #define PKUI_TYPE_BACKEND (pkui_backend_get_type()) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
30 #define PKUI_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
31 PKUI_TYPE_BACKEND, PkuiBackend)) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
32 #define PKUI_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
33 PKUI_TYPE_BACKEND)) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
34 #define PKUI_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
35 PKUI_TYPE_BACKEND, PkuiBackendClass)) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
36 #define PKUI_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
37 PKUI_TYPE_BACKEND)) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
38 #define PKUI_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \ |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
39 PKUI_TYPE_BACKEND, PkuiBackendClass)) |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
40 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
41 typedef struct _PkuiBackend PkuiBackend; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
42 typedef struct _PkuiBackendClass PkuiBackendClass; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
43 typedef struct _PkuiBackendPrivate PkuiBackendPrivate; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
44 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
45 struct _PkuiBackend |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
46 { |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
47 GObject parent_instance; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
48 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
49 PkuiBackendPrivate *priv; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
50 }; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
51 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
52 struct _PkuiBackendClass |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
53 { |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
54 GObjectClass parent_class; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
55 }; |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
56 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
57 PkuiBackend *pkui_backend_new(guint startup_delay, guint interval); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
58 guint pkui_backend_get_updates_normal(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
59 guint pkui_backend_get_updates_important(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
60 void pkui_backend_set_inhibit_check(PkuiBackend *self, gboolean inhibit_check); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
61 gboolean pkui_backend_get_inhibit_check(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
62 void pkui_backend_set_check_interval(PkuiBackend *self, guint check_interval); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
63 guint pkui_backend_get_check_interval(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
64 guint pkui_backend_get_startup_interval(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
65 void pkui_backend_check_now(PkuiBackend *self); |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
66 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
67 G_END_DECLS |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
68 |
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
diff
changeset
|
69 #endif /* __PKUI_BACKEND_H */ |