<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="PkDesktop">
<refmeta>
<refentrytitle role="top_of_page" id="PkDesktop.top_of_page">PkDesktop</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PACKAGEKIT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>PkDesktop</refname>
<refpurpose>Find desktop metadata about a package</refpurpose>
</refnamediv>

<refsynopsisdiv id="PkDesktop.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
#define             <link linkend="PK-DESKTOP-DEFAULT-DATABASE--CAPS">PK_DESKTOP_DEFAULT_DATABASE</link>
#define             <link linkend="PK-DESKTOP-DEFAULT-APPLICATION-DIR--CAPS">PK_DESKTOP_DEFAULT_APPLICATION_DIR</link>
                    <link linkend="PkDesktopPrivate">PkDesktopPrivate</link>;
                    <link linkend="PkDesktop-struct">PkDesktop</link>;
<link linkend="PkDesktop">PkDesktop</link> *         <link linkend="pk-desktop-new">pk_desktop_new</link>                      (void);
<link linkend="void">void</link>                <link linkend="pk-desktop-test">pk_desktop_test</link>                     (<link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-desktop-open-database">pk_desktop_open_database</link>            (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GPtrArray">GPtrArray</link> *         <link linkend="pk-desktop-get-files-for-package">pk_desktop_get_files_for_package</link>    (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *package,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GPtrArray">GPtrArray</link> *         <link linkend="pk-desktop-get-shown-for-package">pk_desktop_get_shown_for_package</link>    (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *package,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gchar">gchar</link> *             <link linkend="pk-desktop-get-package-for-file">pk_desktop_get_package_for_file</link>     (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>

<refsect1 id="PkDesktop.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----PkDesktop
</synopsis>
</refsect1>








<refsect1 id="PkDesktop.description" role="desc">
<title role="desc.title">Description</title>
<para>
Desktop metadata such as icon name and localised summary may be stored in
a local sqlite cache, and this module allows applications to query this.</para>
<para>
</para>
</refsect1>

<refsect1 id="PkDesktop.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PK-DESKTOP-DEFAULT-DATABASE--CAPS" role="macro">
<title>PK_DESKTOP_DEFAULT_DATABASE</title>
<indexterm zone="PK-DESKTOP-DEFAULT-DATABASE--CAPS"><primary sortas="PK_DESKTOP_DEFAULT_DATABASE">PK_DESKTOP_DEFAULT_DATABASE</primary></indexterm><programlisting>#define PK_DESKTOP_DEFAULT_DATABASE		LOCALSTATEDIR "/lib/PackageKit/desktop-files.db"
</programlisting>
<para>
The default location for the database</para>
<para>
</para></refsect2>
<refsect2 id="PK-DESKTOP-DEFAULT-APPLICATION-DIR--CAPS" role="macro">
<title>PK_DESKTOP_DEFAULT_APPLICATION_DIR</title>
<indexterm zone="PK-DESKTOP-DEFAULT-APPLICATION-DIR--CAPS"><primary sortas="PK_DESKTOP_DEFAULT_APPLICATION_DIR">PK_DESKTOP_DEFAULT_APPLICATION_DIR</primary></indexterm><programlisting>#define             PK_DESKTOP_DEFAULT_APPLICATION_DIR</programlisting>
<para>
The default location for the desktop files</para>
<para>
</para></refsect2>
<refsect2 id="PkDesktopPrivate" role="struct">
<title>PkDesktopPrivate</title>
<indexterm zone="PkDesktopPrivate"><primary sortas="PkDesktopPrivate">PkDesktopPrivate</primary></indexterm><programlisting>typedef struct _PkDesktopPrivate PkDesktopPrivate;</programlisting>
<para>
Private <link linkend="PkDesktop"><type>PkDesktop</type></link> data</para>
<para>
</para></refsect2>
<refsect2 id="PkDesktop-struct" role="struct">
<title>PkDesktop</title>
<indexterm zone="PkDesktop-struct"><primary sortas="PkDesktop">PkDesktop</primary></indexterm><programlisting>typedef struct _PkDesktop PkDesktop;</programlisting>
<para>
</para></refsect2>
<refsect2 id="pk-desktop-new" role="function">
<title>pk_desktop_new ()</title>
<indexterm zone="pk-desktop-new"><primary sortas="pk_desktop_new">pk_desktop_new</primary></indexterm><programlisting><link linkend="PkDesktop">PkDesktop</link> *         pk_desktop_new                      (void);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-desktop-test" role="function">
<title>pk_desktop_test ()</title>
<indexterm zone="pk-desktop-test"><primary sortas="pk_desktop_test">pk_desktop_test</primary></indexterm><programlisting><link linkend="void">void</link>                pk_desktop_test                     (<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-desktop-open-database" role="function">
<title>pk_desktop_open_database ()</title>
<indexterm zone="pk-desktop-open-database"><primary sortas="pk_desktop_open_database">pk_desktop_open_database</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_desktop_open_database            (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>desktop</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkDesktop"><type>PkDesktop</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if opened correctly
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-desktop-get-files-for-package" role="function">
<title>pk_desktop_get_files_for_package ()</title>
<indexterm zone="pk-desktop-get-files-for-package"><primary sortas="pk_desktop_get_files_for_package">pk_desktop_get_files_for_package</primary></indexterm><programlisting><link linkend="GPtrArray">GPtrArray</link> *         pk_desktop_get_files_for_package    (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *package,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Return all desktop files owned by a package, regardless if they are shown
in the main menu or not.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>desktop</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkDesktop"><type>PkDesktop</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package</parameter>&#160;:</term>
<listitem><simpara> the package name, e.g. "gnome-power-manager"
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><literal>GError</literal></link> to put the error code and message in, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> string array of results, free with <link linkend="g-ptr-array-unref"><function>g_ptr_array_unref()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-desktop-get-shown-for-package" role="function">
<title>pk_desktop_get_shown_for_package ()</title>
<indexterm zone="pk-desktop-get-shown-for-package"><primary sortas="pk_desktop_get_shown_for_package">pk_desktop_get_shown_for_package</primary></indexterm><programlisting><link linkend="GPtrArray">GPtrArray</link> *         pk_desktop_get_shown_for_package    (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *package,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Return all desktop files owned by a package that would be shown in a menu,
i.e are an application</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>desktop</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkDesktop"><type>PkDesktop</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package</parameter>&#160;:</term>
<listitem><simpara> the package name, e.g. "gnome-power-manager"
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><literal>GError</literal></link> to put the error code and message in, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> string array of results, free with <link linkend="g-ptr-array-unref"><function>g_ptr_array_unref()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-desktop-get-package-for-file" role="function">
<title>pk_desktop_get_package_for_file ()</title>
<indexterm zone="pk-desktop-get-package-for-file"><primary sortas="pk_desktop_get_package_for_file">pk_desktop_get_package_for_file</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_desktop_get_package_for_file     (<link linkend="PkDesktop">PkDesktop</link> *desktop,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Returns the package name that owns the desktop file. Fast.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>desktop</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkDesktop"><type>PkDesktop</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> a fully qualified filename
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><literal>GError</literal></link> to put the error code and message in, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> package name, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
