PkPackage

PkPackage — Package object

Synopsis

#define             PK_PACKAGE_TYPE_ERROR
struct              PkPackage;
struct              PkPackageClass;
gboolean            pk_package_equal                    (PkPackage *package1,
                                                         PkPackage *package2);
gboolean            pk_package_equal_id                 (PkPackage *package1,
                                                         PkPackage *package2);
const gchar *       pk_package_get_arch                 (PkPackage *package);
const gchar *       pk_package_get_data                 (PkPackage *package);
const gchar *       pk_package_get_id                   (PkPackage *package);
PkInfoEnum          pk_package_get_info                 (PkPackage *package);
const gchar *       pk_package_get_name                 (PkPackage *package);
const gchar *       pk_package_get_summary              (PkPackage *package);
const gchar *       pk_package_get_version              (PkPackage *package);
PkPackage *         pk_package_new                      (void);
void                pk_package_print                    (PkPackage *package);
gboolean            pk_package_set_id                   (PkPackage *package,
                                                         const gchar *package_id,
                                                         GError **error);
void                pk_package_test                     (gpointer user_data);

Object Hierarchy

  GObject
   +----PkSource
         +----PkPackage

Properties

  "description"              gchar*                : Read / Write
  "group"                    guint                 : Read / Write
  "info"                     guint                 : Read / Write
  "license"                  gchar*                : Read / Write
  "package-id"               gchar*                : Read
  "size"                     guint64               : Read / Write
  "summary"                  gchar*                : Read / Write
  "update-bugzilla-url"      gchar*                : Read / Write
  "update-changelog"         gchar*                : Read / Write
  "update-cve-url"           gchar*                : Read / Write
  "update-issued"            gchar*                : Read / Write
  "update-obsoletes"         gchar*                : Read / Write
  "update-restart"           guint                 : Read / Write
  "update-state"             guint                 : Read / Write
  "update-text"              gchar*                : Read / Write
  "update-updated"           gchar*                : Read / Write
  "update-updates"           gchar*                : Read / Write
  "update-vendor-url"        gchar*                : Read / Write
  "url"                      gchar*                : Read / Write

Signals

  "changed"                                        : Run Last

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.

Details

PK_PACKAGE_TYPE_ERROR

#define PK_PACKAGE_TYPE_ERROR (pk_package_error_get_type ())

struct PkPackage

struct PkPackage;

struct PkPackageClass

struct PkPackageClass {
	PkSourceClass parent_class;

	/* signals */
	void		(* changed)			(PkPackage *package);
	/* padding for future expansion */
	void (*_pk_reserved1) (void);
	void (*_pk_reserved2) (void);
	void (*_pk_reserved3) (void);
	void (*_pk_reserved4) (void);
	void (*_pk_reserved5) (void);
};

pk_package_equal ()

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

Do the PkPackage's have the same ID.

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.

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_arch ()

const gchar *       pk_package_get_arch                 (PkPackage *package);

Gets the package arch.

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 repoitory.

package :

a valid PkPackage instance

Returns :

the data, or NULL if unset

Since 0.6.4


pk_package_get_id ()

const gchar *       pk_package_get_id                   (PkPackage *package);

Gets the package object ID

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

package :

a valid PkPackage instance

Returns :

the PkInfoEnum

Since 0.5.4


pk_package_get_name ()

const gchar *       pk_package_get_name                 (PkPackage *package);

Gets the package name.

package :

a valid PkPackage instance

Returns :

the name, or NULL if unset

Since 0.6.4


pk_package_get_summary ()

const gchar *       pk_package_get_summary              (PkPackage *package);

Gets the package object ID

package :

a valid PkPackage instance

Returns :

the summary, or NULL if unset

Since 0.5.4


pk_package_get_version ()

const gchar *       pk_package_get_version              (PkPackage *package);

Gets the package version.

package :

a valid PkPackage instance

Returns :

the version, or NULL if unset

Since 0.6.4


pk_package_new ()

PkPackage *         pk_package_new                      (void);

Returns :

a new PkPackage object.

Since 0.5.4


pk_package_print ()

void                pk_package_print                    (PkPackage *package);

Prints details about the package to standard out.

package :

a valid PkPackage instance

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

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_test ()

void                pk_package_test                     (gpointer user_data);

Property Details

The "description" property

  "description"              gchar*                : Read / Write

The package description.

Default value: NULL

Since 0.5.4


The "group" property

  "group"                    guint                 : Read / Write

The package group.

Allowed values: <= 35

Default value: 0

Since 0.5.4


The "info" property

  "info"                     guint                 : Read / Write

The PkInfoEnum package type, e.g. PK_INFO_ENUM_NORMAL.

Default value: 0

Since 0.5.4


The "license" property

  "license"                  gchar*                : Read / Write

The package license.

Default value: NULL

Since 0.5.4


The "package-id" property

  "package-id"               gchar*                : Read

The full package_id, e.g. 'gnome-power-manager;0.1.2;i386;fedora'.

Default value: NULL

Since 0.5.4


The "size" property

  "size"                     guint64               : Read / Write

The package size.

Default value: 0

Since 0.5.4


The "summary" property

  "summary"                  gchar*                : Read / Write

The package summary.

Default value: NULL

Since 0.5.4


The "update-bugzilla-url" property

  "update-bugzilla-url"      gchar*                : Read / Write

The update bugzilla URL.

Default value: NULL

Since 0.5.4


The "update-changelog" property

  "update-changelog"         gchar*                : Read / Write

The update ChangeLog.

Default value: NULL

Since 0.5.4


The "update-cve-url" property

  "update-cve-url"           gchar*                : Read / Write

The update CVE URL.

Default value: NULL

Since 0.5.4


The "update-issued" property

  "update-issued"            gchar*                : Read / Write

When the update was issued.

Default value: NULL

Since 0.5.4


The "update-obsoletes" property

  "update-obsoletes"         gchar*                : Read / Write

The update packages that are obsoleted.

Default value: NULL

Since 0.5.4


The "update-restart" property

  "update-restart"           guint                 : Read / Write

The update restart type.

Allowed values: <= 7

Default value: 0

Since 0.5.4


The "update-state" property

  "update-state"             guint                 : Read / Write

The update state.

Allowed values: <= 4

Default value: 0

Since 0.5.4


The "update-text" property

  "update-text"              gchar*                : Read / Write

The update description.

Default value: NULL

Since 0.5.4


The "update-updated" property

  "update-updated"           gchar*                : Read / Write

When the update was last updated.

Default value: NULL

Since 0.5.4


The "update-updates" property

  "update-updates"           gchar*                : Read / Write

The update packages.

Default value: NULL

Since 0.5.4


The "update-vendor-url" property

  "update-vendor-url"        gchar*                : Read / Write

The update vendor URL.

Default value: NULL

Since 0.5.4


The "url" property

  "url"                      gchar*                : Read / Write

The package homepage URL.

Default value: NULL

Since 0.5.4

Signal Details

The "changed" signal

void                user_function                      (PkPackage *package,
                                                        gpointer   user_data)      : Run Last

The ::changed signal is emitted when the package data may have changed.

package :

the PkPackage instance that emitted the signal

user_data :

user data set when the signal handler was connected.