libyui-ncurses-pkg
Loading...
Searching...
No Matches
NCPkgStatusStrategy.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: NCPkgStatusStrategy.h
19 Author: Gabriele Strattner <gs@suse.de>
20
21*/
22
23
24#ifndef NCPkgStatusStrategy_h
25#define NCPkgStatusStrategy_h
26
27#include "NCZypp.h"
28#include <zypp/ui/Selectable.h>
29
30
31//------------------------------------------------------------
32// Abstract base class for strategies to get status for packages or patches
33//------------------------------------------------------------
35{
36
37public:
38
40
41 virtual ~NCPkgStatusStrategy() = 0;
42
49 virtual ZyppStatus getPackageStatus ( ZyppSel slbPtr, ZyppObj objPtr );
50
58 virtual bool setObjectStatus ( ZyppStatus newstatus,
59 ZyppSel slbPtr,
60 ZyppObj objPtr
61 );
70 virtual bool keyToStatus( const int & key,
71 ZyppSel slbPtr,
72 ZyppObj objPtr,
73 ZyppStatus & newStat );
74
78 virtual bool cycleStatus( ZyppSel slbPtr,
79 ZyppObj objPtr,
80 ZyppStatus & newStat_ret );
86
87};
88
89
90//------------------------------------------------------------
91// Class for strategies to handle status of packages
92//------------------------------------------------------------
94{
95public:
96
98
99 virtual ~PackageStatStrategy() {}
100
101};
102
103//------------------------------------------------------------
104// Class for strategies to handle dependencies
105//------------------------------------------------------------
107{
108public:
109
111
112 virtual ~DependencyStatStrategy() {}
113
114};
115
116//------------------------------------------------------------
117// Class for strategies of update
118//------------------------------------------------------------
120{
121public:
122
124
125 virtual ~UpdateStatStrategy() {}
126
127};
128
129//------------------------------------------------------------
130// Class for strategies of selections
131//------------------------------------------------------------
133{
134public:
135
137
138 virtual ~SelectionStatStrategy() {}
139
147 virtual bool setObjectStatus( ZyppStatus newstatus,
148 ZyppSel slbPtr,
149 ZyppObj objPtr );
150
151};
152
153//------------------------------------------------------------
154// Class for strategies to handle status of packages belonging to a patch
155//------------------------------------------------------------
157{
158public:
159
161
162 virtual ~PatchPkgStatStrategy() {}
163
168 virtual bool setObjectStatus( ZyppStatus newstatus,
169 ZyppSel slbPtr,
170 ZyppObj objPtr );
171
172};
173
174
175
176//------------------------------------------------------------
177// Class for strategies to handle status of patches
178//------------------------------------------------------------
180{
181public:
182
184
185 virtual ~PatchStatStrategy() {}
186
195 virtual bool keyToStatus( const int & key,
196 ZyppSel slbPtr,
197 ZyppObj objPtr,
198 ZyppStatus & newStat );
199
203 virtual bool cycleStatus( ZyppSel slbPtr,
204 ZyppObj objPtr,
205 ZyppStatus & newStat_ret );
206
213 virtual bool setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr );
214};
215
216
217
218//------------------------------------------------------------
219// Class for strategies to handle status of available packages
220//------------------------------------------------------------
222{
223public:
224
226
227 virtual ~AvailableStatStrategy() {}
228
237 virtual bool setObjectStatus( ZyppStatus newstatus,
238 ZyppSel slbPtr, ZyppObj objPtr );
239
240};
241
242//----------------------------------------------------------------
243// Class for strategies to handle status of multi version packages
244//----------------------------------------------------------------
246{
247public:
248
250
251 virtual ~MultiVersionStatStrategy() {}
252
259 virtual ZyppStatus getPackageStatus ( ZyppSel slbPtr, ZyppObj objPtr );
260
269 virtual bool setObjectStatus( ZyppStatus newstatus,
270 ZyppSel slbPtr, ZyppObj objPtr );
271
272
281 virtual bool anyMultiVersionToInstall( ZyppSel slbPtr, bool multiversion ) const;
282
289 virtual bool mixedMultiVersionPopup( bool multiversion ) const;
290
291};
292
293
294#endif
Definition NCPkgStatusStrategy.h:222
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:596
Definition NCPkgStatusStrategy.h:107
Definition NCPkgStatusStrategy.h:246
virtual ZyppStatus getPackageStatus(ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:683
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:704
virtual bool anyMultiVersionToInstall(ZyppSel slbPtr, bool multiversion) const
Definition NCPkgStatusStrategy.cc:751
virtual bool mixedMultiVersionPopup(bool multiversion) const
Definition NCPkgStatusStrategy.cc:794
Definition NCPkgStatusStrategy.h:35
void solveResolvableCollections()
Definition NCPkgStatusStrategy.cc:316
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:88
virtual bool keyToStatus(const int &key, ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat)
Definition NCPkgStatusStrategy.cc:113
virtual bool cycleStatus(ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat_ret)
Definition NCPkgStatusStrategy.cc:227
virtual ZyppStatus getPackageStatus(ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:67
Definition NCPkgStatusStrategy.h:94
Definition NCPkgStatusStrategy.h:157
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:849
Definition NCPkgStatusStrategy.h:180
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:502
virtual bool cycleStatus(ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat_ret)
Definition NCPkgStatusStrategy.cc:444
virtual bool keyToStatus(const int &key, ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat)
Definition NCPkgStatusStrategy.cc:358
Definition NCPkgStatusStrategy.h:133
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition NCPkgStatusStrategy.cc:543
Definition NCPkgStatusStrategy.h:120