1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPackageSelectorBase.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQPackageSelectorBase_h
21 #define YQPackageSelectorBase_h
24 #include "YPackageSelector.h"
28 class QY2ComboTabWidget;
31 class YQPkgConflictDialog;
32 class YQPkgDiskUsageList;
36 * Abstract base class for package selectors.
38 class YQPackageSelectorBase : public QWidget, public YPackageSelector
47 * Will initialize package and selection managers and create conflict
50 YQPackageSelectorBase( YWidget * parent, long modeFlags = 0 );
55 virtual ~YQPackageSelectorBase();
60 * Set enabled/disabled state.
62 * Reimplemented from YWidget.
64 virtual void setEnabling( bool enabled );
67 * Preferred width of the widget.
69 * Reimplemented from YWidget.
71 virtual int preferredWidth();
74 * Preferred height of the widget.
76 * Reimplemented from YWidget.
78 virtual int preferredHeight();
81 * Set the new size of the widget.
83 * Reimplemented from YWidget.
85 virtual void setSize( int newWidth, int newHeight );
88 * Accept the keyboard focus.
90 * Reimplemented from YWidget.
92 virtual bool setKeyboardFocus();
95 * Event filter to handle WM_CLOSE like "Cancel"
97 * Reimplemented from QObject.
99 virtual bool eventFilter( QObject * obj, QEvent * event );
105 * Resolve dependencies (unconditionally) for all resolvables.
107 * Returns QDialog::Accepted or QDialog::Rejected.
109 int resolveDependencies();
112 * Verifies dependencies of the currently installed system.
114 * Returns QDialog::Accepted or QDialog::Rejected.
119 * Check for disk overflow and post a warning dialog if necessary.
120 * The user can choose to override this warning.
122 * Returns QDialog::Accepted if no warning is necessary or if the user
123 * wishes to override the warning, QDialog::Rejected otherwise.
125 int checkDiskUsage();
128 * Display a list of automatically selected packages
129 * (excluding packages contained in any selections that are to be installed)
131 void showAutoPkgList();
134 * Close processing and abandon changes
139 * Close processing and accept changes
144 * Inform user about a feature that is not implemented yet.
145 * This should NEVER show up in the final version.
147 void notImplemented();
153 * Emitted when package resolving is started.
154 * This can be used for some kind of "busy display".
156 void resolvingStarted();
159 * Emitted when package resolving is finished.
161 void resolvingFinished();
167 * Reset all previously ignored dependency problems.
169 void resetIgnoredDependencyProblems();
175 * Show all license agreements the user has not confirmed yet
176 * (for all packages that will be installed, and in YOU mode also for
179 * Returns 'true' if all licenses were confirmed, 'false' if one or more
180 * licenses were not confirmed (in which case some packages might be set to
181 * S_TABOO, which might require another resolver run).
183 bool showPendingLicenseAgreements();
186 * Show all license agreements in a resolvable range. To be used with
187 * zyppPkgBegin() and zyppPkgEnd() or with zyppPatchesBegin() and
190 bool showPendingLicenseAgreements( ZyppPoolIterator begin,
191 ZyppPoolIterator end );
194 * Event handler for keyboard input - for debugging and testing.
196 * Reimplemented from QWidget.
198 virtual void keyPressEvent( QKeyEvent * ev );
203 bool _showChangesDialog;
204 YQPkgConflictDialog * _pkgConflictDialog;
205 YQPkgDiskUsageList * _diskUsageList;
206 QAction * _actionResetIgnoredDependencyProblems;
211 #endif // YQPackageSelectorBase_h