]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/pkg/YQPackageSelectorBase.h
#ifdefed out everything not compiling so it can be ported
[duncan/yast2-qt4.git] / src / pkg / YQPackageSelectorBase.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQPackageSelectorBase.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQPackageSelectorBase_h
21 #define YQPackageSelectorBase_h
22
23 #include <q3vbox.h>
24 //Added by qt3to4:
25 #include <qevent.h>
26 #include "YPackageSelector.h"
27 #include "YQZypp.h"
28
29
30 class QY2ComboTabWidget;
31 class Q3Action;
32
33 class YQPkgConflictDialog;
34 class YQPkgDiskUsageList;
35
36
37 /**
38  * Abstract base class for package selectors.
39  **/
40 class YQPackageSelectorBase : public Q3VBox, public YPackageSelector
41 {
42     Q_OBJECT
43
44 protected:
45
46     /**
47      * Constructor
48      *
49      * Will initialize package and selection managers and create conflict
50      * dialogs.
51      **/
52     YQPackageSelectorBase( YWidget * parent, long modeFlags = 0 );
53
54     /**
55      * Destructor
56      **/
57     virtual ~YQPackageSelectorBase();
58
59
60 public:
61     /**
62      * Set enabled/disabled state.
63      *
64      * Reimplemented from YWidget.
65      **/
66     virtual void setEnabling( bool enabled );
67
68     /**
69      * Preferred width of the widget.
70      *
71      * Reimplemented from YWidget.
72      **/
73     virtual int preferredWidth();
74
75     /**
76      * Preferred height of the widget.
77      *
78      * Reimplemented from YWidget.
79      **/
80     virtual int preferredHeight();
81
82     /**
83      * Set the new size of the widget.
84      *
85      * Reimplemented from YWidget.
86      **/
87     virtual void setSize( int newWidth, int newHeight );
88
89     /**
90      * Accept the keyboard focus.
91      *
92      * Reimplemented from YWidget.
93      **/
94     virtual bool setKeyboardFocus();
95
96
97 public slots:
98
99     /**
100      * Resolve dependencies (unconditionally) for all resolvables.
101      *
102      * Returns QDialog::Accepted or QDialog::Rejected.
103      **/
104     int resolveDependencies();
105
106     /**
107      * Verifies dependencies of the currently installed system.
108      *
109      * Returns QDialog::Accepted or QDialog::Rejected.
110      **/
111     int verifySystem();
112
113     /**
114      * Check for disk overflow and post a warning dialog if necessary.
115      * The user can choose to override this warning.
116      *
117      * Returns QDialog::Accepted if no warning is necessary or if the user
118      * wishes to override the warning, QDialog::Rejected otherwise.
119      **/
120     int checkDiskUsage();
121
122     /**
123      * Display a list of automatically selected packages
124      * (excluding packages contained in any selections that are to be installed)
125      **/
126     void showAutoPkgList();
127
128     /**
129      * Close processing and abandon changes
130      **/
131     void reject();
132
133     /**
134      * Close processing and accept changes
135      **/
136     void accept();
137
138     /**
139      * Inform user about a feature that is not implemented yet.
140      * This should NEVER show up in the final version.
141      **/
142     void notImplemented();
143
144
145 signals:
146
147     /**
148      * Emitted when package resolving is started.
149      * This can be used for some kind of "busy display".
150      **/
151     void resolvingStarted();
152
153     /**
154      * Emitted when package resolving is finished.
155      **/
156     void resolvingFinished();
157
158
159 protected slots:
160
161     /**
162      * Reset all previously ignored dependency problems.
163      **/
164     void resetIgnoredDependencyProblems();
165
166
167 protected:
168
169     /**
170      * Show all license agreements the user has not confirmed yet
171      * (for all packages that will be installed, and in YOU mode also for
172      * patches).
173      *
174      * Returns 'true' if all licenses were confirmed, 'false' if one or more
175      * licenses were not confirmed (in which case some packages might be set to
176      * S_TABOO, which might require another resolver run).
177      **/
178     bool showPendingLicenseAgreements();
179
180     /**
181      * Show all license agreements in a resolvable range. To be used with
182      * zyppPkgBegin() and zyppPkgEnd() or with zyppPatchesBegin() and
183      * zyppPatchesEnd().
184      **/
185     bool showPendingLicenseAgreements( ZyppPoolIterator begin,
186                                        ZyppPoolIterator end );
187
188     /**
189      * Event handler for keyboard input - for debugging and testing.
190      *
191      * Reimplemented from QWidget.
192      **/
193     virtual void keyPressEvent( QKeyEvent * ev );
194
195
196     // Data members
197
198     bool                        _showChangesDialog;
199     YQPkgConflictDialog *       _pkgConflictDialog;
200     YQPkgDiskUsageList *        _diskUsageList;
201     Q3Action *                  _actionResetIgnoredDependencyProblems;
202 };
203
204
205
206 #endif // YQPackageSelectorBase_h