2007-09-24 12:47:58 -07:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
|
|
|
|
*
|
|
|
|
* Licensed under the GNU General Public License Version 2
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PK_CLIENT_H
|
|
|
|
#define __PK_CLIENT_H
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include "pk-enum.h"
|
|
|
|
#include "pk-enum-list.h"
|
2007-10-19 06:15:13 -07:00
|
|
|
#include "pk-package-list.h"
|
2007-09-24 12:47:58 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define PK_TYPE_CLIENT (pk_client_get_type ())
|
|
|
|
#define PK_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_CLIENT, PkClient))
|
|
|
|
#define PK_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_CLIENT, PkClientClass))
|
|
|
|
#define PK_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_CLIENT))
|
|
|
|
#define PK_IS_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_CLIENT))
|
|
|
|
#define PK_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_CLIENT, PkClientClass))
|
|
|
|
|
2007-10-23 10:01:26 -07:00
|
|
|
#define PK_CLIENT_PERCENTAGE_INVALID 101
|
|
|
|
|
2007-09-24 12:47:58 -07:00
|
|
|
typedef struct PkClientPrivate PkClientPrivate;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
PkClientPrivate *priv;
|
|
|
|
} PkClient;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
} PkClientClass;
|
|
|
|
|
|
|
|
GType pk_client_get_type (void);
|
|
|
|
PkClient *pk_client_new (void);
|
|
|
|
|
|
|
|
gboolean pk_client_set_tid (PkClient *client,
|
|
|
|
const gchar *tid);
|
2007-10-24 10:41:48 -07:00
|
|
|
gboolean pk_client_set_promiscuous (PkClient *client,
|
|
|
|
gboolean enabled);
|
2007-09-24 12:47:58 -07:00
|
|
|
gchar *pk_client_get_tid (PkClient *client);
|
|
|
|
|
|
|
|
gboolean pk_client_set_use_buffer (PkClient *client,
|
|
|
|
gboolean use_buffer);
|
|
|
|
gboolean pk_client_get_use_buffer (PkClient *client);
|
|
|
|
|
|
|
|
/* general methods */
|
|
|
|
gboolean pk_client_get_status (PkClient *client,
|
|
|
|
PkStatusEnum *status);
|
|
|
|
gboolean pk_client_get_role (PkClient *client,
|
|
|
|
PkRoleEnum *role,
|
|
|
|
gchar **package_id);
|
2007-10-23 10:01:26 -07:00
|
|
|
gboolean pk_client_get_progress (PkClient *client,
|
|
|
|
guint *percentage,
|
|
|
|
guint *subpercentage,
|
|
|
|
guint *elapsed,
|
|
|
|
guint *remaining);
|
2007-09-24 12:47:58 -07:00
|
|
|
gboolean pk_client_get_package (PkClient *client,
|
|
|
|
gchar **package_id);
|
|
|
|
gboolean pk_client_cancel (PkClient *client);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gboolean pk_client_get_updates (PkClient *client);
|
|
|
|
gboolean pk_client_update_system (PkClient *client);
|
|
|
|
gboolean pk_client_search_name (PkClient *client,
|
|
|
|
const gchar *filter,
|
|
|
|
const gchar *search);
|
|
|
|
gboolean pk_client_search_details (PkClient *client,
|
|
|
|
const gchar *filter,
|
|
|
|
const gchar *search);
|
|
|
|
gboolean pk_client_search_group (PkClient *client,
|
|
|
|
const gchar *filter,
|
|
|
|
const gchar *search);
|
|
|
|
gboolean pk_client_search_file (PkClient *client,
|
|
|
|
const gchar *filter,
|
|
|
|
const gchar *search);
|
|
|
|
gboolean pk_client_get_depends (PkClient *client,
|
2007-11-07 10:47:11 -08:00
|
|
|
const gchar *package_id,
|
|
|
|
gboolean recursive);
|
2007-09-24 12:47:58 -07:00
|
|
|
gboolean pk_client_get_update_detail (PkClient *client,
|
|
|
|
const gchar *package_id);
|
|
|
|
gboolean pk_client_get_requires (PkClient *client,
|
2007-11-07 10:47:11 -08:00
|
|
|
const gchar *package_id,
|
|
|
|
gboolean recursive);
|
2007-09-24 12:47:58 -07:00
|
|
|
gboolean pk_client_get_description (PkClient *client,
|
|
|
|
const gchar *package_id);
|
2007-10-27 07:59:58 -07:00
|
|
|
gboolean pk_client_get_files (PkClient *client,
|
|
|
|
const gchar *package_id);
|
2007-09-24 12:47:58 -07:00
|
|
|
gboolean pk_client_remove_package (PkClient *client,
|
|
|
|
const gchar *package,
|
|
|
|
gboolean allow_deps);
|
|
|
|
gboolean pk_client_refresh_cache (PkClient *client,
|
|
|
|
gboolean force);
|
|
|
|
gboolean pk_client_install_package (PkClient *client,
|
|
|
|
const gchar *package_id);
|
2007-10-11 14:56:13 -07:00
|
|
|
gboolean pk_client_update_package (PkClient *client,
|
|
|
|
const gchar *package_id);
|
2007-09-30 09:10:42 -07:00
|
|
|
gboolean pk_client_install_file (PkClient *client,
|
|
|
|
const gchar *full_path);
|
2007-09-30 08:44:45 -07:00
|
|
|
gboolean pk_client_resolve (PkClient *client,
|
2007-10-19 07:27:58 -07:00
|
|
|
const gchar *filter,
|
2007-09-30 08:44:45 -07:00
|
|
|
const gchar *package);
|
2007-10-11 14:56:13 -07:00
|
|
|
gboolean pk_client_rollback (PkClient *client,
|
|
|
|
const gchar *transaction_id);
|
2007-09-24 12:47:58 -07:00
|
|
|
gboolean pk_client_cancel (PkClient *client);
|
2007-10-11 14:56:13 -07:00
|
|
|
gboolean pk_client_requeue (PkClient *client);
|
2007-09-24 12:47:58 -07:00
|
|
|
|
2007-10-14 02:31:35 -07:00
|
|
|
/* repo stuff */
|
|
|
|
gboolean pk_client_get_repo_list (PkClient *client);
|
|
|
|
gboolean pk_client_repo_enable (PkClient *client,
|
|
|
|
const gchar *repo_id,
|
|
|
|
gboolean enabled);
|
|
|
|
gboolean pk_client_repo_set_data (PkClient *client,
|
|
|
|
const gchar *repo_id,
|
|
|
|
const gchar *parameter,
|
|
|
|
const gchar *value);
|
|
|
|
|
2007-09-24 12:47:58 -07:00
|
|
|
/* cached stuff */
|
2007-10-19 06:15:13 -07:00
|
|
|
guint pk_client_package_buffer_get_size (PkClient *client);
|
|
|
|
PkPackageItem *pk_client_package_buffer_get_item (PkClient *client,
|
|
|
|
guint item);
|
2007-09-24 12:47:58 -07:00
|
|
|
PkRestartEnum pk_client_get_require_restart (PkClient *client);
|
|
|
|
|
|
|
|
/* not job specific */
|
|
|
|
PkEnumList *pk_client_get_actions (PkClient *client);
|
|
|
|
PkEnumList *pk_client_get_filters (PkClient *client);
|
|
|
|
PkEnumList *pk_client_get_groups (PkClient *client);
|
|
|
|
gboolean pk_client_reset (PkClient *client);
|
|
|
|
gboolean pk_client_get_old_transactions (PkClient *client,
|
|
|
|
guint number);
|
|
|
|
gboolean pk_client_get_backend_detail (PkClient *client,
|
|
|
|
gchar **name,
|
2007-10-30 01:03:19 -07:00
|
|
|
gchar **author);
|
2007-09-24 12:47:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __PK_CLIENT_H */
|