Debian Codegraph @

lib/packagekit-glib2/pk-desktop.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2008 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 #if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION)
23 #error "Only <packagekit.h> can be included directly."
24 #endif
25
26 #ifndef __PK_DESKTOP_H
27 #define __PK_DESKTOP_H
28
29 #include <glib-object.h>
30
31 G_BEGIN_DECLS
32
33 #define PK_TYPE_DESKTOP (pk_desktop_get_type ())
34 #define PK_DESKTOP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_DESKTOP, PkDesktop))
35 #define PK_DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_DESKTOP, PkDesktopClass))
36 #define PK_IS_DESKTOP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_DESKTOP))
37 #define PK_IS_DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_DESKTOP))
38 #define PK_DESKTOP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_DESKTOP, PkDesktopClass))
39
40 /**
41 * PK_DESKTOP_DEFAULT_DATABASE:
42 *
43 * The default location for the database
44 */
45 #define PK_DESKTOP_DEFAULT_DATABASE LOCALSTATEDIR "/lib/PackageKit/desktop-files.db"
46
47 /**
48 * PK_DESKTOP_DEFAULT_APPLICATION_DIR:
49 *
50 * The default location for the desktop files
51 */
52 #ifndef __FreeBSD__
53 #define PK_DESKTOP_DEFAULT_APPLICATION_DIR "/usr/share/applications"
54 #else
55 #define PK_DESKTOP_DEFAULT_APPLICATION_DIR "/usr/local/share/applications"
56 #endif
57
58 typedef struct _PkDesktopPrivate PkDesktopPrivate;
59 typedef struct _PkDesktop PkDesktop;
60 typedef struct _PkDesktopClass PkDesktopClass;
61
62 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
63 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PkDesktop, g_object_unref)
64 #endif
65
66 struct _PkDesktop
67 {
68 GObject parent;
69 PkDesktopPrivate *priv;
70 };
71
72 struct _PkDesktopClass
73 {
74 GObjectClass parent_class;
75 };
76
77 GType pk_desktop_get_type (void);
78 PkDesktop *pk_desktop_new (void);
79
80 gboolean pk_desktop_open_database (PkDesktop *desktop,
81 GError **error);
82 GPtrArray *pk_desktop_get_files_for_package (PkDesktop *desktop,
83 const gchar *package,
84 GError **error);
85 GPtrArray *pk_desktop_get_shown_for_package (PkDesktop *desktop,
86 const gchar *package,
87 GError **error);
88 gchar *pk_desktop_get_package_for_file (PkDesktop *desktop,
89 const gchar *filename,
90 GError **error);
91
92 G_END_DECLS
93
94 #endif /* __PK_DESKTOP_H */
95