1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPkgVersionsView.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQPkgVersionsView_h
21 #define YQPkgVersionsView_h
23 #include "QY2ListView.h"
25 #include <Q3ListViewItem>
31 * @short Package version selector: Display a list of available versions from
32 * all the different installation sources and let the user change the candidate
33 * version for installation / update.
35 class YQPkgVersionsView : public QY2ListView
44 * 'userCanSwitchVersions' specifies whether or not the user is allowed to
45 * switch between package versions - e.g. in patch mode, he can't.
47 YQPkgVersionsView( QWidget * parent, bool userCanSwitchVersions );
52 virtual ~YQPkgVersionsView();
55 * Returns the minimum size required for this widget.
56 * Inherited from QWidget.
58 virtual QSize minimumSizeHint() const;
63 int versionCol() const { return _versionCol; }
64 int archCol() const { return _archCol; }
65 int productCol() const { return _productCol; }
66 int urlCol() const { return _urlCol; }
67 int repoCol() const { return _repoCol; }
68 int nameCol() const { return _nameCol; }
69 int summaryCol() const { return _summaryCol; }
70 int statusCol() const { return _statusCol; }
76 * Show details for the specified package.
77 * Delayed ( optimized ) display if this is embedded into a QTabWidget
78 * parent: In this case, wait until this page becomes visible.
80 void showDetailsIfVisible( ZyppSel selectable );
82 // slot clear() inherited from QListView
86 * Show data for the last package.
88 void reload( QWidget * newCurrent );
94 * Emitted when the user changes the
96 void candidateChanged( ZyppObj newCandidate );
102 * Check for changed candidates
104 void checkForChangedCandidate();
110 * Show details for the specified package.
112 void showDetails( ZyppSel selectable );
117 QTabWidget * _parentTab;
132 class YQPkgVersion: public QY2CheckListItem
137 * Constructor. Creates a YQPkgVersion item that corresponds to the package
138 * manager object that 'pkg' refers to.
140 YQPkgVersion( YQPkgVersionsView * pkgVersionList,
141 QY2CheckListItem * parent,
144 bool enabled = true );
149 virtual ~YQPkgVersion();
152 * Returns the original ZYPP object
154 ZyppObj zyppObj() const { return _zyppObj; }
157 * Returns the original ZYPP selectable
159 ZyppSel selectable() const { return _selectable; }
162 * Comparison function used for sorting the list.
168 * Reimplemented from QListViewItem
170 virtual int compare( QTreeWidgetItem * other,
172 bool ascending ) const;
175 * Returns a tool tip text for a specific column of this item.
176 * 'column' is -1 if the mouse pointer is in the tree indentation area.
178 * Reimplemented from QY2CheckListItem.
180 virtual QString toolTip( int column );
185 int versionCol() const { return _pkgVersionList->versionCol(); }
186 int productCol() const { return _pkgVersionList->productCol(); }
187 int urlCol() const { return _pkgVersionList->urlCol(); }
188 int repoCol() const { return _pkgVersionList->repoCol(); }
189 int statusCol() const { return _pkgVersionList->statusCol(); }
190 int archCol() const { return _pkgVersionList->archCol(); }
197 YQPkgVersionsView * _pkgVersionList;
203 #endif // ifndef YQPkgVersionsView_h