File: pkg.h

package info (click to toggle)
paco 2.0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,136 kB
  • sloc: sh: 10,464; cpp: 6,463; ansic: 338; makefile: 277; perl: 260
file content (79 lines) | stat: -rw-r--r-- 1,820 bytes parent folder | download | duplicates (3)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//=======================================================================
// pkg.h
//-----------------------------------------------------------------------
// This file is part of the package paco
// Copyright (C) 2004-2009 David Rosal
// For more information visit http://paco.sourceforge.net
//=======================================================================

#ifndef GPACO_PKG_H
#define GPACO_PKG_H

#include "paco/basepkg.h"
#include <glibmm/ustring.h>
#include <glibmm/refptr.h>

namespace Gdk
{
	class Pixbuf;
}

namespace Gpaco {

typedef Paco::File File;

class PkgWindow;

enum {
	TAB_FILES,
	TAB_INFO,
	TAB_REMOVE,
	TAB_PACKAGE,
	N_TABS
};

class Pkg : public Paco::BasePkg
{
	public:

	Pkg(Glib::ustring const&);
	virtual ~Pkg();

	float sizePercent() const				{ return mSizePercent; }
	float filesPercent() const				{ return mFilesPercent; }
	Glib::RefPtr<Gdk::Pixbuf> icon() const	{ return mpIcon; }
	Glib::ustring const& summary() const	{ return mSummary; }
	PkgWindow const* window() const			{ return mpWindow; }
	PkgWindow* window()						{ return mpWindow; }
	bool changed() const					{ return mChanged; }

	void changed(bool set)					{ mChanged = set; }

	bool listFilesInst() const	{ return mFileType & INSTALLED_FILES; }
	bool listFilesMiss() const	{ return mFileType & MISSING_FILES; }
	void switchListFilesInst()	{ mFileType ^= INSTALLED_FILES; }
	void switchListFilesMiss()	{ mFileType ^= MISSING_FILES; }

	void readLog();
	void presentWindow(int);
	void deleteWindow();
	bool update(bool = true);

	private:

	float						mSizePercent;
	float						mFilesPercent;
	Glib::RefPtr<Gdk::Pixbuf>	mpIcon;
	Glib::ustring				mSummary;
	PkgWindow*					mpWindow;
	int 						mFileType;
	bool						mChanged;

	void getIcon(Glib::ustring const& path);

};

}	// namespace Gpaco


#endif  // GPACO_PKG_H