3
@author Peter Rockai <me@mornfall.net>
6
#include <apt-pkg/packagemanager.h>
7
#include <apt-pkg/acquire.h>
9
#include <apt-front/utils/shared.h>
10
#include <apt-front/progresscallback.h>
11
#include <apt-front/cache/cache.h>
13
#ifndef APT_FRONT_PACKAGEMANAGER_H
14
#define APT_FRONT_PACKAGEMANAGER_H
19
@brief Sync cache changes to system, update cache (apt-get update).
21
This class encapsulates all actions libapt-front could be doing and that
22
will have an impact on the state of the system. It can update the cache
23
or commit the changes done in cache to the system (downloading required
24
archives in the process). The ::update interface should work with all
25
available cache components (including debtags), so all you need to do
26
is call manager.update(). You can construct and throw away
27
PackageManager objects at will.
31
Manager( cache::Cache *c = 0 );
34
@brief Commit changes done in the associated cache to system.
36
You can only call this when Cache is in consistent state, exception
37
will be thrown otherwise. commit will use the associated
38
ProgressCallback object to report download and install progress.
45
@brief Update the cache ala apt-get update.
47
This will do a normal cache update, possibly clearing the changed
48
cache states. It will use the associated ProgressCallback object
49
to report download and parsing progress.
51
Returns true if the operation was successfull (false if not)
55
/// set a ProgressCallback to be used to report progress in update and commit
56
void setProgressCallback( SharedPtr<ProgressCallback> progress);
58
void setUpdateInterval( unsigned interval ) {
59
m_updateInterval = interval;
65
cache::Cache *m_cache;
66
SharedPtr<ProgressCallback> m_progress;
67
unsigned m_updateInterval;
68
pkgPackageManager *m_pm;
69
pkgAcquire *m_fetcher;