xref: /haiku/headers/os/package/solver/SolverProblemSolution.h (revision 9f81ca838ce7b92b5689e57d3f86765db4705a7b)
1*5e01af31SIngo Weinhold /*
2*5e01af31SIngo Weinhold  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3*5e01af31SIngo Weinhold  * Distributed under the terms of the MIT License.
4*5e01af31SIngo Weinhold  */
5*5e01af31SIngo Weinhold #ifndef _PACKAGE__SOLVER_PROBLEM_SOLUTION_H_
6*5e01af31SIngo Weinhold #define _PACKAGE__SOLVER_PROBLEM_SOLUTION_H_
7*5e01af31SIngo Weinhold 
8*5e01af31SIngo Weinhold 
9*5e01af31SIngo Weinhold #include <ObjectList.h>
10*5e01af31SIngo Weinhold #include <String.h>
11*5e01af31SIngo Weinhold 
12*5e01af31SIngo Weinhold 
13*5e01af31SIngo Weinhold namespace BPackageKit {
14*5e01af31SIngo Weinhold 
15*5e01af31SIngo Weinhold 
16*5e01af31SIngo Weinhold class BSolverPackage;
17*5e01af31SIngo Weinhold 
18*5e01af31SIngo Weinhold 
19*5e01af31SIngo Weinhold class BSolverProblemSolutionElement {
20*5e01af31SIngo Weinhold public:
21*5e01af31SIngo Weinhold 			enum BType {
22*5e01af31SIngo Weinhold 				B_UNSPECIFIED,
23*5e01af31SIngo Weinhold 				B_DONT_KEEP,
24*5e01af31SIngo Weinhold 				B_DONT_INSTALL,
25*5e01af31SIngo Weinhold 				B_DONT_INSTALL_MOST_RECENT,
26*5e01af31SIngo Weinhold 				B_DONT_FORBID_INSTALLATION,
27*5e01af31SIngo Weinhold 				B_DONT_DEINSTALL,
28*5e01af31SIngo Weinhold 				B_DONT_DEINSTALL_ALL,
29*5e01af31SIngo Weinhold 				B_DONT_LOCK,
30*5e01af31SIngo Weinhold 				B_KEEP_INFERIOR_ARCHITECTURE,
31*5e01af31SIngo Weinhold 				B_KEEP_EXCLUDED,
32*5e01af31SIngo Weinhold 				B_KEEP_OLD,
33*5e01af31SIngo Weinhold 				B_INSTALL_INFERIOR_ARCHITECTURE,
34*5e01af31SIngo Weinhold 				B_INSTALL_EXCLUDED,
35*5e01af31SIngo Weinhold 				B_INSTALL_OLD,
36*5e01af31SIngo Weinhold 				B_ALLOW_DOWNGRADE,
37*5e01af31SIngo Weinhold 				B_ALLOW_NAME_CHANGE,
38*5e01af31SIngo Weinhold 				B_ALLOW_ARCHITECTURE_CHANGE,
39*5e01af31SIngo Weinhold 				B_ALLOW_VENDOR_CHANGE,
40*5e01af31SIngo Weinhold 				B_ALLOW_REPLACEMENT,
41*5e01af31SIngo Weinhold 				B_ALLOW_DEINSTALLATION
42*5e01af31SIngo Weinhold 			};
43*5e01af31SIngo Weinhold 
44*5e01af31SIngo Weinhold public:
45*5e01af31SIngo Weinhold 								BSolverProblemSolutionElement(BType type,
46*5e01af31SIngo Weinhold 									BSolverPackage* sourcePackage,
47*5e01af31SIngo Weinhold 									BSolverPackage* targetPackage,
48*5e01af31SIngo Weinhold 									const BString& selection);
49*5e01af31SIngo Weinhold 								~BSolverProblemSolutionElement();
50*5e01af31SIngo Weinhold 
51*5e01af31SIngo Weinhold 			BType				Type() const;
52*5e01af31SIngo Weinhold 			BSolverPackage*		SourcePackage() const;
53*5e01af31SIngo Weinhold 			BSolverPackage*		TargetPackage() const;
54*5e01af31SIngo Weinhold 			const BString&		Selection() const;
55*5e01af31SIngo Weinhold 
56*5e01af31SIngo Weinhold 			BString				ToString() const;
57*5e01af31SIngo Weinhold 
58*5e01af31SIngo Weinhold private:
59*5e01af31SIngo Weinhold 			BType				fType;
60*5e01af31SIngo Weinhold 			BSolverPackage*		fSourcePackage;
61*5e01af31SIngo Weinhold 			BSolverPackage*		fTargetPackage;
62*5e01af31SIngo Weinhold 			BString				fSelection;
63*5e01af31SIngo Weinhold };
64*5e01af31SIngo Weinhold 
65*5e01af31SIngo Weinhold 
66*5e01af31SIngo Weinhold class BSolverProblemSolution {
67*5e01af31SIngo Weinhold public:
68*5e01af31SIngo Weinhold 			typedef BSolverProblemSolutionElement Element;
69*5e01af31SIngo Weinhold 
70*5e01af31SIngo Weinhold public:
71*5e01af31SIngo Weinhold 								BSolverProblemSolution();
72*5e01af31SIngo Weinhold 								~BSolverProblemSolution();
73*5e01af31SIngo Weinhold 
74*5e01af31SIngo Weinhold 			int32				CountElements() const;
75*5e01af31SIngo Weinhold 			const Element*		ElementAt(int32 index) const;
76*5e01af31SIngo Weinhold 
77*5e01af31SIngo Weinhold 			bool				AppendElement(const Element& element);
78*5e01af31SIngo Weinhold 
79*5e01af31SIngo Weinhold private:
80*5e01af31SIngo Weinhold 			typedef BObjectList<Element> ElementList;
81*5e01af31SIngo Weinhold 
82*5e01af31SIngo Weinhold private:
83*5e01af31SIngo Weinhold 			ElementList			fElements;
84*5e01af31SIngo Weinhold };
85*5e01af31SIngo Weinhold 
86*5e01af31SIngo Weinhold 
87*5e01af31SIngo Weinhold }	// namespace BPackageKit
88*5e01af31SIngo Weinhold 
89*5e01af31SIngo Weinhold 
90*5e01af31SIngo Weinhold #endif // _PACKAGE__SOLVER_PROBLEM_SOLUTION_H_
91