1
/* rpackagestatus.h - wrapper for accessing packagestatus information
3
* Copyright (c) 2000, 2001 Conectiva S/A
4
* 2002-2008 Michael Vogt <mvo@debian.org>
6
* Author: Alfredo K. Kojima <kojima@conectiva.com.br>
7
* Michael Vogt <mvo@debian.org>
9
* Portions Taken from Gnome APT
10
* Copyright (C) 1998 Havoc Pennington <hp@pobox.com>
13
* This program is free software; you can redistribute it and/or
14
* modify it under the terms of the GNU General Public License as
15
* published by the Free Software Foundation; either version 2 of the
16
* License, or (at your option) any later version.
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program; if not, write to the Free Software
25
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29
#ifndef _RPACKAGESTATUS_H_
30
#define _RPACKAGESTATUS_H_
36
#include <apt-pkg/configuration.h>
43
class RPackageStatus {
46
ToInstall, ToReInstall, ToUpgrade, ToDowngrade, ToRemove, ToPurge,
47
NotInstalled, NotInstalledLocked,
48
InstalledUpdated, InstalledOutdated, InstalledLocked,
54
// the supported archive-labels and components
55
vector<string> supportedLabels;
56
vector<string> supportedComponents;
59
// this is the short string to load the icons
60
const char *PackageStatusShortString[N_STATUS_COUNT];
61
// this is the long string for the gui description of the state
62
const char *PackageStatusLongString[N_STATUS_COUNT];
65
// this does the actual work
66
int getStatus(RPackage *pkg);
70
RPackageStatus() : markUnsupported(false) {};
71
virtual ~RPackageStatus() {};
73
// this reads the pixmaps and the colors
76
// here we get the description for the States
77
const char *getLongStatusString(int i) {
78
return PackageStatusLongString[i];
80
const char *getLongStatusString(RPackage *pkg) {
81
return PackageStatusLongString[getStatus(pkg)];
84
const char *getShortStatusString(int i) {
85
return PackageStatusShortString[i];
88
bool isSupported(RPackage *pkg);
90
// return the time until the package is supported
91
bool maintenanceEndTime(RPackage *pkg, struct tm *support_end_tm);