PkPackage: PackageKit Reference Manual

## PkPackage PkPackage — Package object |

## Functions

PkPackage * | pk_package_new ()
gboolean | pk_package_set_id ()
gboolean | pk_package_parse ()
void | pk_package_print ()
gboolean | pk_package_equal ()
gboolean | pk_package_equal_id ()
const gchar * | pk_package_get_id ()
PkInfoEnum | pk_package_get_info ()
void | pk_package_set_info ()
const gchar * | pk_package_get_summary ()
void | pk_package_set_summary ()
const gchar * | pk_package_get_name ()
const gchar * | pk_package_get_version ()
const gchar * | pk_package_get_arch ()
const gchar * | pk_package_get_data ()

## Types and Values

#define | PK_PACKAGE_TYPE_ERROR

## Description

This GObject represents a package from a transaction. These objects represent single items of data from the transaction, and are often present in lists (PkResults) or just refcounted in client programs.

## Functions

### pk_package_new ()

    PkPackage *
    pk_package_new (void);

#### Returns

a new PkPackage object.

Since: 0.5.4

### pk_package_set_id ()

    gboolean
    pk_package_set_id (PkPackage *package,
                       const gchar *package_id,
                       GError **error);

Sets the package object to have the given ID

#### Parameters

package | a valid PkPackage instance |
package_id | the valid package_id |
error | a GError to put the error code and message in, or `NULL` |

#### Returns

`TRUE` if the package_id was set

Since: 0.5.4

### pk_package_parse ()

    gboolean
    pk_package_parse (PkPackage *package,
                      const gchar *data,
                      GError **error);

Parses the data to populate the PkPackage.

#### Parameters

package | a valid PkPackage instance |
data | the data describing the package |
error | a GError to put the error code and message in, or `NULL` |

#### Returns

`TRUE` if the data was parsed correcty

Since: 0.8.11

### pk_package_print ()

    void
    pk_package_print (PkPackage *package);

Prints details about the package to standard out.

#### Parameters

package | a valid PkPackage instance |

Since: 0.5.4

### pk_package_equal ()

    gboolean
    pk_package_equal (PkPackage *package1,
                      PkPackage *package2);

Do the PkPackage's have the same ID.

#### Parameters

package1 | a valid PkPackage instance |
package2 | a valid PkPackage instance |

#### Returns

`TRUE` if the packages have the same package_id, info and summary.

Since: 0.5.4

### pk_package_equal_id ()

    gboolean
    pk_package_equal_id (PkPackage *package1,
                         PkPackage *package2);

Do the PkPackage's have the same ID.

#### Parameters

package1 | a valid PkPackage instance |
package2 | a valid PkPackage instance |

#### Returns

`TRUE` if the packages have the same package_id.

Since: 0.5.4

### pk_package_get_id ()

    const gchar *
    pk_package_get_id (PkPackage *package);

Gets the package object ID

#### Parameters

package | a valid PkPackage instance |

#### Returns

the ID, or `NULL` if unset

Since: 0.5.4

### pk_package_get_info ()

    PkInfoEnum
    pk_package_get_info (PkPackage *package);

Gets the package object ID

#### Parameters

package | a valid PkPackage instance |

#### Returns

the PkInfoEnum

Since: 0.5.4

### pk_package_set_info ()

    void
    pk_package_set_info (PkPackage *package,
                         PkInfoEnum info);

Sets the package info enum.

#### Parameters

package | a valid PkPackage instance |
info | the PkInfoEnum |

Since: 0.8.14

### pk_package_get_summary ()

    const gchar *
    pk_package_get_summary (PkPackage *package);

Gets the package object ID

#### Parameters

package | a valid PkPackage instance |

#### Returns

the summary, or `NULL` if unset

Since: 0.5.4

### pk_package_set_summary ()

    void
    pk_package_set_summary (PkPackage *package,
                            const gchar *summary);

Sets the package summary.

#### Parameters

package | a valid PkPackage instance |
summary | the package summary |

Since: 0.8.14

### pk_package_get_name ()

    const gchar *
    pk_package_get_name (PkPackage *package);

Gets the package name.

#### Parameters

package | a valid PkPackage instance |

#### Returns

the name, or `NULL` if unset

Since: 0.6.4

### pk_package_get_version ()

    const gchar *
    pk_package_get_version (PkPackage *package);

Gets the package version.

#### Parameters

package | a valid PkPackage instance |

#### Returns

the version, or `NULL` if unset

Since: 0.6.4

### pk_package_get_arch ()

    const gchar *
    pk_package_get_arch (PkPackage *package);

Gets the package arch.

#### Parameters

package | a valid PkPackage instance |

#### Returns

the arch, or `NULL` if unset

Since: 0.6.4

### pk_package_get_data ()

    const gchar *
    pk_package_get_data (PkPackage *package);

Gets the package data, which is usually the repository ID that contains the package. Special ID's include "installed" for installed packages, and "local" for local packages that exist on disk but not in a repository.

#### Parameters

package | a valid PkPackage instance |

#### Returns

the data, or `NULL` if unset

Since: 0.6.4

## Types and Values

### PK_PACKAGE_TYPE_ERROR

    #define PK_PACKAGE_TYPE_ERROR (pk_package_error_get_type ())