/*
 * $Id: scpm_types.h,v 1.15 2005/02/10 17:02:21 jg Exp $
 *
 * Type definitions for the SCPM interface.
 *
 * Copyright 2001 SuSE GbmH
 *           2002-2004 SuSE Linux AG
 *
 * Author: Joachim Gleissner <jg@suse.de>
 *
 *   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 SCPM_TYPES_H
#define SCPM_TYPES_H

#include <string>
#include <vector>

typedef enum save_mode_t {
  normal,
  save_all,
  patch_all
} ;

typedef struct resource_group_t {
  string name;
  string description;
  bool user_defined;
  bool user_modified;
  bool active;
} ;

typedef struct resource_entry_t {
  string name;
  string type;
  bool active;
  bool user_defined;
} ;

typedef struct resource_info_t {
  string resource_name;
  string resource_type;
  bool   is_new;
  bool   is_deleted;
  bool   save;
  save_mode_t save_mode;
  vector<resource_group_t> groups;
} ;

typedef struct switch_info_t {
  bool profile_modified;
  string profile_name;
  vector<resource_info_t> modified_resources;
} ;

typedef struct scpm_status_t {
  bool initialized;
  bool enabled;
  bool db_loaded;
  bool db_uptodate;
  bool locked;
  bool needs_reinit;
  bool needs_recover;
  string active_profile;
  string scpm_version;
  string db_version;
  string db_format;
  string db_format_version;
} ;

typedef struct backup_info_t {
  string name;
  string type;
  string profile;
} ;

typedef enum rebuild_mode_t {
  REBUILD_MODE_QUICK,
  REBUILD_MODE_RESOURCES_ONLY,
  REBUILD_MODE_DATA_ONLY,
  REBUILD_MODE_FULL
};

extern char *scpm_error;
extern int scpm_journal_abort_steps;

const int scpm_flag_force           = 1;
const int scpm_flag_skip            = 2;
const int scpm_flag_quiet           = 4;
const int scpm_flag_verbose         = 8;
const int scpm_flag_hash            = 16;
const int scpm_flag_debug           = 32;
const int scpm_flag_boot            = 64;
const int scpm_flag_exit_on_warning = 128;
const int scpm_flag_skip_load       = 256;
const int scpm_flag_force_db        = 512;
const int scpm_flag_read_only       = 1024;
const int scpm_flag_wait_commit     = 2048;

#endif
