## ZifPackageRemote ZifPackageRemote — Remote package |

## Synopsis

    struct              ZifPackageRemote;
    struct              ZifPackageRemoteClass;
    gboolean            zif_package_remote_download         (ZifPackageRemote *pkg,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);
    ZifDelta *          zif_package_remote_download_delta   (ZifPackageRemote *pkg,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);
    ZifDelta *          zif_package_remote_get_delta        (ZifPackageRemote *package,
                                                             ZifState *state,
                                                             GError **error);
    ZifPackage *        zif_package_remote_get_installed    (ZifPackageRemote *pkg);
    ZifStoreRemote *    zif_package_remote_get_store_remote (ZifPackageRemote *pkg);
    ZifUpdate *         zif_package_remote_get_update_detail
                                                            (ZifPackageRemote *package,
                                                             ZifState *state,
                                                             GError **error);
    ZifPackage *        zif_package_remote_new              (void);
    gboolean            zif_package_remote_rebuild_delta    (ZifPackageRemote *pkg,
                                                             ZifDelta *delta,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);
    gboolean            zif_package_remote_set_from_repo    (ZifPackageRemote *pkg,
                                                             guint length,
                                                             gchar **type,
                                                             gchar **data,
                                                             const gchar *repo_id,
                                                             GError **error);
    void                zif_package_remote_set_installed    (ZifPackageRemote *pkg,
                                                             ZifPackage *installed);
    void                zif_package_remote_set_store_remote (ZifPackageRemote *pkg,
                                                             ZifStoreRemote *store);

## Object Hierarchy

      GObject
       +----ZifPackage
             +----ZifPackageRemote

## Description

This object is a subclass of ZifPackage

## Details

### struct ZifPackageRemote

    struct ZifPackageRemote;

### struct ZifPackageRemoteClass

    struct ZifPackageRemoteClass {
    	ZifPackageClass		 parent_class;
    	/* Padding for future expansion */
    	void (*_zif_reserved1) (void);
    	void (*_zif_reserved2) (void);
    	void (*_zif_reserved3) (void);
    	void (*_zif_reserved4) (void);
    };

### zif_package_remote_download ()

    gboolean            zif_package_remote_download         (ZifPackageRemote *pkg,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);

Downloads a package.

`pkg` : | A ZifPackageRemote
`directory` : | A local directory to save to, or `NULL` to use the package cache
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.3

### zif_package_remote_download_delta ()

    ZifDelta *          zif_package_remote_download_delta   (ZifPackageRemote *pkg,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);

Downloads a delta rpm if it exists.

`pkg` : | A ZifPackageRemote
`directory` : | A local directory to save to, or `NULL` to use the package cache
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | A `ZifDelta`, or `NULL` for failure. [transfer full]

Since 0.2.5

### zif_package_remote_get_delta ()

    ZifDelta *          zif_package_remote_get_delta        (ZifPackageRemote *package,
                                                             ZifState *state,
                                                             GError **error);

Gets the update detail for a package if it exists.

`package` : | A ZifPackageRemote
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | A `ZifUpdate`, or `NULL` for failure. [transfer full]

Since 0.1.3

### zif_package_remote_get_installed ()

    ZifPackage *        zif_package_remote_get_installed    (ZifPackageRemote *pkg);

Gets the installed package this package updates.

`pkg` : | A ZifPackageRemote
Returns : | A refcounted `ZifPackage`, or `NULL` for failure. Use `g_object_unref()` when done. [transfer full]

Since 0.1.3

### zif_package_remote_get_store_remote ()

    ZifStoreRemote *    zif_package_remote_get_store_remote (ZifPackageRemote *pkg);

Gets the store used to create this package.

`pkg` : | A ZifPackageRemote
Returns : | A refcounted `ZifStoreRemote`, or `NULL` for failure. Use `g_object_unref()` when done. [transfer full]

Since 0.1.3

### zif_package_remote_get_update_detail ()

    ZifUpdate *         zif_package_remote_get_update_detail
                                                            (ZifPackageRemote *package,
                                                             ZifState *state,
                                                             GError **error);

Gets the update detail for a package.

`package` : | A ZifPackageRemote
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | A `ZifUpdate`, or `NULL` for failure. [transfer full]

Since 0.1.3

### zif_package_remote_new ()

    ZifPackage *        zif_package_remote_new              (void);

Returns : | A new ZifPackageRemote instance.

Since 0.1.0

### zif_package_remote_rebuild_delta ()

    gboolean            zif_package_remote_rebuild_delta    (ZifPackageRemote *pkg,
                                                             ZifDelta *delta,
                                                             const gchar *directory,
                                                             ZifState *state,
                                                             GError **error);

Rebuilds an rpm from delta.

`pkg` : | A ZifPackageRemote
`delta` : | A ZifDelta
`directory` : | A local directory to save to, or `NULL` to use the package cache
`state` : | A ZifState to use for progress reporting
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.2.5

### zif_package_remote_set_from_repo ()

    gboolean            zif_package_remote_set_from_repo    (ZifPackageRemote *pkg,
                                                             guint length,
                                                             gchar **type,
                                                             gchar **data,
                                                             const gchar *repo_id,
                                                             GError **error);

Sets details on a remote package from repo data derived from the metadata xml.

`pkg` : | A ZifPackageRemote
`length` : | length of data and type arrays
`type` : | The data type array
`data` : | The data value array
`repo_id` : | The repository id
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_package_remote_set_installed ()

    void                zif_package_remote_set_installed    (ZifPackageRemote *pkg,
                                                             ZifPackage *installed);

Sets the installed package this package updates.

`pkg` : | A ZifPackageRemote
`installed` : | A ZifPackage that created this package

Since 0.1.3

### zif_package_remote_set_store_remote ()

    void                zif_package_remote_set_store_remote (ZifPackageRemote *pkg,
                                                             ZifStoreRemote *store);

Sets the store used to create this package, which we may need of we ever need to `ensure()` data at runtime.

This also sets the package to have a trust of `ZIF_PACKAGE_TRUST_KIND_PUBKEY_UNVERIFIED` if the repo claims to support GPG signing or `ZIF_PACKAGE_TRUST_KIND_NONE` otherwise.

`pkg` : | A ZifPackageRemote
`store` : | A ZifStoreRemote that created this package

Since 0.1.0