summaryrefslogtreecommitdiff
path: root/src/reason_fragment.h
blob: 975485f4cb39c56a5782248b20544aa1bc50105c (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
// reason_fragment.h
//
//  Copyright 2004 Daniel Burrows
//

#ifndef REASON_FRAGMENT_H
#define REASON_FRAGMENT_H

#include <apt-pkg/pkgcache.h>

#include <generic/apt/infer_reason.h>

/** \brief Code to convert a list of reasons to text fragments.
 * 
 *  \file reason_fragment.h
 */

namespace cwidget
{
  class fragment;
}

/** Generate a cwidget::fragment containing a (multi-line) description of why
 *  the package is in its present state.
 *
 *  If pkg.end() is \b true, returns nopackage().
 *
 *  \param pkg the package to examine
 *  \param breakage this parameter will be set to \b true if there
 *                 is "interesting" breakage involving the package,
 *                 false otherwise.  "interesting" breakage indicates that
 *                 either the package itself is broken, or it breaks
 *                 one of its reverse dependencies.
 *  \return the new text fragment
 */
cwidget::fragment *reason_fragment(const pkgCache::PkgIterator &pkg,
				   bool &breakage);

/** Generate a cwidget::fragment containing a (multi-line) description of why
 *  the package is in its present state.
 *
 *  If pkg.end() is \b true, returns nopackage().
 *
 *  \param pkg the package to examine
 *  \return the new text fragment
 */
cwidget::fragment *reason_fragment(const pkgCache::PkgIterator &pkg);

/** \return a string explaining that no package is selected. */
cwidget::fragment *nopackage();

#endif