libyui-ncurses-pkg
NCPkgStatusStrategy.h
1 /****************************************************************************
2 |
3 | Copyright (c) [2002-2011] Novell, Inc.
4 | All Rights Reserved.
5 |
6 | This program is free software; you can redistribute it and/or
7 | modify it under the terms of version 2 of the GNU General Public License as
8 | published by the Free Software Foundation.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, contact Novell, Inc.
17 |
18 | To contact Novell about this file by physical or electronic mail,
19 | you may find current contact information at www.novell.com
20 |
21 |***************************************************************************/
22 
23 
24 /*---------------------------------------------------------------------\
25 | |
26 | __ __ ____ _____ ____ |
27 | \ \ / /_ _/ ___|_ _|___ \ |
28 | \ V / _` \___ \ | | __) | |
29 | | | (_| |___) || | / __/ |
30 | |_|\__,_|____/ |_| |_____| |
31 | |
32 | core system |
33 | (C) SuSE GmbH |
34 \----------------------------------------------------------------------/
35 
36  File: NCPkgStatusStrategy.h
37 
38  Author: Gabriele Strattner <gs@suse.de>
39 
40 
41 /-*/
42 #ifndef NCPkgStatusStrategy_h
43 #define NCPkgStatusStrategy_h
44 
45 #include "NCZypp.h"
46 #include <zypp/ui/Selectable.h>
47 
48 
49 //------------------------------------------------------------
50 // Abstract base class for strategies to get status for packages or patches
51 //------------------------------------------------------------
53 {
54 
55 public:
56 
58 
59  virtual ~NCPkgStatusStrategy() = 0;
60 
67  virtual ZyppStatus getPackageStatus ( ZyppSel slbPtr, ZyppObj objPtr );
68 
76  virtual bool setObjectStatus ( ZyppStatus newstatus,
77  ZyppSel slbPtr,
78  ZyppObj objPtr
79  );
88  virtual bool keyToStatus( const int & key,
89  ZyppSel slbPtr,
90  ZyppObj objPtr,
91  ZyppStatus & newStat );
92 
96  virtual bool cycleStatus( ZyppSel slbPtr,
97  ZyppObj objPtr,
98  ZyppStatus & newStat_ret );
104 
105 };
106 
107 
108 //------------------------------------------------------------
109 // Class for strategies to handle status of packages
110 //------------------------------------------------------------
112 {
113 public:
114 
116 
117  virtual ~PackageStatStrategy() {}
118 
119 };
120 
121 //------------------------------------------------------------
122 // Class for strategies to handle dependencies
123 //------------------------------------------------------------
125 {
126 public:
127 
129 
130  virtual ~DependencyStatStrategy() {}
131 
132 };
133 
134 //------------------------------------------------------------
135 // Class for strategies of update
136 //------------------------------------------------------------
138 {
139 public:
140 
142 
143  virtual ~UpdateStatStrategy() {}
144 
145 };
146 
147 //------------------------------------------------------------
148 // Class for strategies of selections
149 //------------------------------------------------------------
151 {
152 public:
153 
155 
156  virtual ~SelectionStatStrategy() {}
157 
165  virtual bool setObjectStatus( ZyppStatus newstatus,
166  ZyppSel slbPtr,
167  ZyppObj objPtr );
168 
169 };
170 
171 //------------------------------------------------------------
172 // Class for strategies to handle status of packages belonging to a patch
173 //------------------------------------------------------------
175 {
176 public:
177 
179 
180  virtual ~PatchPkgStatStrategy() {}
181 
186  virtual bool setObjectStatus( ZyppStatus newstatus,
187  ZyppSel slbPtr,
188  ZyppObj objPtr );
189 
190 };
191 
192 
193 
194 //------------------------------------------------------------
195 // Class for strategies to handle status of patches
196 //------------------------------------------------------------
198 {
199 public:
200 
202 
203  virtual ~PatchStatStrategy() {}
204 
213  virtual bool keyToStatus( const int & key,
214  ZyppSel slbPtr,
215  ZyppObj objPtr,
216  ZyppStatus & newStat );
217 
221  virtual bool cycleStatus( ZyppSel slbPtr,
222  ZyppObj objPtr,
223  ZyppStatus & newStat_ret );
224 
231  virtual bool setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr );
232 };
233 
234 
235 
236 //------------------------------------------------------------
237 // Class for strategies to handle status of available packages
238 //------------------------------------------------------------
240 {
241 public:
242 
244 
245  virtual ~AvailableStatStrategy() {}
246 
255  virtual bool setObjectStatus( ZyppStatus newstatus,
256  ZyppSel slbPtr, ZyppObj objPtr );
257 
258 };
259 
260 //----------------------------------------------------------------
261 // Class for strategies to handle status of multi version packages
262 //----------------------------------------------------------------
264 {
265 public:
266 
268 
269  virtual ~MultiVersionStatStrategy() {}
270 
277  virtual ZyppStatus getPackageStatus ( ZyppSel slbPtr, ZyppObj objPtr );
278 
287  virtual bool setObjectStatus( ZyppStatus newstatus,
288  ZyppSel slbPtr, ZyppObj objPtr );
289 
290 
299  virtual bool anyMultiVersionToInstall( ZyppSel slbPtr, bool multiversion ) const;
300 
307  virtual bool mixedMultiVersionPopup( bool multiversion ) const;
308 
309 };
310 
311 
312 #endif
Definition: NCPkgStatusStrategy.h:124
Definition: NCPkgStatusStrategy.h:137
virtual bool keyToStatus(const int &key, ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat)
Definition: NCPkgStatusStrategy.cc:131
Definition: NCPkgStatusStrategy.h:111
virtual bool anyMultiVersionToInstall(ZyppSel slbPtr, bool multiversion) const
Definition: NCPkgStatusStrategy.cc:769
Definition: NCPkgStatusStrategy.h:263
Definition: NCPkgStatusStrategy.h:239
virtual bool keyToStatus(const int &key, ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat)
Definition: NCPkgStatusStrategy.cc:376
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:106
Definition: NCPkgStatusStrategy.h:52
virtual ZyppStatus getPackageStatus(ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:701
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:867
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:614
virtual bool cycleStatus(ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat_ret)
Definition: NCPkgStatusStrategy.cc:245
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:520
Definition: NCPkgStatusStrategy.h:174
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:561
virtual ZyppStatus getPackageStatus(ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:85
Definition: NCPkgStatusStrategy.h:150
virtual bool mixedMultiVersionPopup(bool multiversion) const
Definition: NCPkgStatusStrategy.cc:812
virtual bool setObjectStatus(ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr)
Definition: NCPkgStatusStrategy.cc:722
Definition: NCPkgStatusStrategy.h:197
virtual bool cycleStatus(ZyppSel slbPtr, ZyppObj objPtr, ZyppStatus &newStat_ret)
Definition: NCPkgStatusStrategy.cc:462
void solveResolvableCollections()
Definition: NCPkgStatusStrategy.cc:334