libyui-ncurses-pkg
 
Loading...
Searching...
No Matches
NCPkgPopupDeps.h
1/*
2 Copyright (c) 2002-2011 Novell, Inc.
3 Copyright (c) 2021 SUSE LLC
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) version 3.0 of the License. This library
9 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details. You should have received a copy of the GNU
13 Lesser General Public License along with this library; if not, write
14 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
15 Floor, Boston, MA 02110-1301 USA
16
17
18 File: NCPkgPopupDeps.h
19
20 Authors: Gabriele Strattner <gs@suse.de>
21 Bubli <kmachalkova@suse.cz>
22
23*/
24
25
26#ifndef NCPkgPopupDeps_h
27#define NCPkgPopupDeps_h
28
29#include <iosfwd>
30#include <string>
31#include <vector>
32
33#include <zypp/Resolver.h>
34
35#include <yui/ncurses/NCPopup.h>
36#include <yui/ncurses/NCLabel.h>
37
38#include "NCZypp.h"
39
40
41class NCPushButton;
42class NCSelectionBox;
44class NCRichText;
46
47
48namespace PkgDep
49{
50 class ErrorResult;
51 class ErrorResultList;
52 class ResultList;
53};
54
55
56class NCPkgPopupDeps : public NCPopup
57{
58 NCPkgPopupDeps & operator=( const NCPkgPopupDeps & );
59 NCPkgPopupDeps ( const NCPkgPopupDeps & );
60
61public:
62 enum NCPkgSolverAction
63 {
64 S_Solve,
65 S_Verify,
66 S_Unknown
67 };
68
69private:
70
71 typedef std::vector<std::pair<
72 zypp::ResolverProblem_Ptr,
73 zypp::ProblemSolution_Ptr> > ProblemSolutionCorrespondence;
74 // indexed by widget position,
75 // keeps the user selected solution (or 0) for each problem
76 ProblemSolutionCorrespondence problems;
77
78 NCPushButton * cancelButton;
79 NCPushButton * solveButton;
80
81 NCSolutionSelectionBox * solutionw; // resolver problem solutions
82
83 NCLabel * head; // the headline
84
85 NCLabel *details; // problem details
86 NCRichText *solDetails; // solution details
87
88 NCPackageSelector * packager; // connection to the package selector
89
90 void createLayout();
91
92protected:
93
94 NCSelectionBox * problemw; // resolver problems
95
96 virtual bool postAgain( NCPkgSolverAction action );
97 using NCPopup::postAgain; // unhide overriden base method
98
99 virtual NCursesEvent wHandleInput( wint_t ch );
100
101public:
102
103 NCPkgPopupDeps( const wpos at, NCPackageSelector * pkger );
104 virtual ~NCPkgPopupDeps();
105
106 virtual int preferredWidth();
107 virtual int preferredHeight();
108
109 NCursesEvent showDependencyPopup( NCPkgSolverAction action );
110
111 bool showDependencies( NCPkgSolverAction action, bool * ok );
112
113 bool solve( NCSelectionBox * problemw, NCPkgSolverAction action );
114
115 bool showSolutions( int index );
116 // for the currently selected problem, choose this solution
117 void setSolution (int index);
118 // show details
119 void showSolutionDetails( std::string details );
120};
121
123
124
125#endif // NCPkgPopupDeps_h
Definition NCPackageSelector.h:105
Definition NCPkgPopupDeps.cc:74