summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelistitem.h
blob: ca0cf17d24c5f04ddc457283639ef88e53abdb56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#ifndef PK_LISTITEM_H
#define PK_LISTITEM_H


#include <qstring.h>
//#include <qlistview.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qdict.h>

#include "listviewitemoipkg.h"
#include "package.h"
#include "pksettings.h"

class QPopupMenu;

class PackageListItem : public ListViewItemOipkg
{
public:
  PackageListItem(ListViewItemOipkg *parent, QString name, Type ittype);
  PackageListItem(
		  ListViewItemOipkg *parent, 
		  OipkgPackage *pack, 
		  PackageManagerSettings *s);
  PackageListItem(QListView*, OipkgPackage*, PackageManagerSettings*);
  ~PackageListItem();
  void paintCell( QPainter*, const QColorGroup&, int, int, int );
  void paintFocus( QPainter*, const QColorGroup&, const QRect&  );
  QPixmap statePixmap() const;
  QString key( int, bool ) const;
  OipkgPackage* getPackage() { return package; } ;
  QString getName() { return package->name(); } ;
  bool isInstalled(){ return package->installed(); };
  virtual void setOn ( bool );
  void displayDetails();

private:
  QPopupMenu *popupMenu;
  QPopupMenu *destsMenu;
  void init(OipkgPackage*, PackageManagerSettings*);
  virtual QPopupMenu* getPopupMenu();
  static QPopupMenu *_destsMenu;
	QCheckListItem *nameItem;
	QCheckListItem *destItem;
	QCheckListItem *linkItem;
	QCheckListItem *statusItem;
  PackageManagerSettings *settings;
  OipkgPackage *package;
protected slots:
 // void toggleProcess();
  virtual void menuAction( int );
};


#endif