Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionCombi.h
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* Resolver_problems.cc
3  *
4  * Copyright (C) 2000-2002 Ximian, Inc.
5  * Copyright (C) 2005 SUSE Linux Products GmbH
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21
22 #ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
23 #define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
24
25 #include <string>
26 #include "zypp/ProblemSolution.h"
27 #include "zypp/solver/detail/Types.h"
28 #include "zypp/solver/detail/SolverQueueItem.h"
29
30 /////////////////////////////////////////////////////////////////////////
31 namespace zypp
32 { ///////////////////////////////////////////////////////////////////////
33   ///////////////////////////////////////////////////////////////////////
34   namespace solver
35   { /////////////////////////////////////////////////////////////////////
36     /////////////////////////////////////////////////////////////////////
37     namespace detail
38     { ///////////////////////////////////////////////////////////////////
39
40         /**
41          * Class representing one possible solution to one problem found during resolving
42          * This problem solution is a combination of different actions.
43          * e.G. install, delete, keep different resolvables.
44          *
45          **/
46         class ProblemSolutionCombi : public ProblemSolution
47         {
48         protected:
49             int actNumber; // number of actions
50         public:
51
52             /**
53              * Constructor.
54              **/
55             ProblemSolutionCombi( ResolverProblem_Ptr parent );
56             /**
57              * Add a single action of an item
58              */
59             void addSingleAction( PoolItem item, const TransactionKind action);
60
61             /**
62              * Add a single action of a capability
63              */
64             void addSingleAction( Capability capability, const TransactionKind action);
65
66             /**
67              * Add a single action of a SolverQueueItem
68              */
69             void addSingleAction( SolverQueueItem_Ptr item, const TransactionKind action);
70
71             /**
72              * returns the number of actions
73              */
74             int actionCount() { return actNumber;}
75
76             /**
77              * Set description text (append)
78              */
79             void addDescription( const std::string description);
80
81             /**
82              * Set description text (prepend)
83              */
84             void addFrontDescription( const std::string & description );
85         };
86
87       ///////////////////////////////////////////////////////////////////
88     };// namespace detail
89     /////////////////////////////////////////////////////////////////////
90     /////////////////////////////////////////////////////////////////////
91   };// namespace solver
92   ///////////////////////////////////////////////////////////////////////
93   ///////////////////////////////////////////////////////////////////////
94 };// namespace zypp
95 /////////////////////////////////////////////////////////////////////////
96
97 #endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAINSTALL_H
98