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"
30 * @short Package version selector: Display a list of available versions from
31 * all the different installation sources and let the user change the candidate
32 * version for installation / update.
34 class YQPkgVersionsView : public QY2ListView
43 * 'userCanSwitchVersions' specifies whether or not the user is allowed to
44 * switch between package versions - e.g. in patch mode, he can't.
46 YQPkgVersionsView( QWidget * parent, bool userCanSwitchVersions );
51 virtual ~YQPkgVersionsView();
54 * Returns the minimum size required for this widget.
55 * Inherited from QWidget.
57 virtual QSize minimumSizeHint() const;
62 int versionCol() const { return _versionCol; }
63 int archCol() const { return _archCol; }
64 int productCol() const { return _productCol; }
65 int urlCol() const { return _urlCol; }
66 int repoCol() const { return _repoCol; }
67 int nameCol() const { return _nameCol; }
68 int summaryCol() const { return _summaryCol; }
69 int statusCol() const { return _statusCol; }
75 * Show details for the specified package.
76 * Delayed ( optimized ) display if this is embedded into a QTabWidget
77 * parent: In this case, wait until this page becomes visible.
79 void showDetailsIfVisible( ZyppSel selectable );
81 // slot clear() inherited from QListView
85 * Show data for the last package.
87 void reload( QWidget * newCurrent );
93 * Emitted when the user changes the
95 void candidateChanged( ZyppObj newCandidate );
101 * Check for changed candidates
103 void checkForChangedCandidate();
109 * Show details for the specified package.
111 void showDetails( ZyppSel selectable );
116 QTabWidget * _parentTab;
131 class YQPkgVersion: public QY2CheckListItem
136 * Constructor. Creates a YQPkgVersion item that corresponds to the package
137 * manager object that 'pkg' refers to.
139 YQPkgVersion( YQPkgVersionsView * pkgVersionList,
140 QY2CheckListItem * parent,
143 bool enabled = true );
148 virtual ~YQPkgVersion();
151 * Returns the original ZYPP object
153 ZyppObj zyppObj() const { return _zyppObj; }
156 * Returns the original ZYPP selectable
158 ZyppSel selectable() const { return _selectable; }
161 * Comparison function used for sorting the list.
167 * Reimplemented from QListViewItem
169 virtual int compare( QTreeWidgetItem * other,
171 bool ascending ) const;
174 * Returns a tool tip text for a specific column of this item.
175 * 'column' is -1 if the mouse pointer is in the tree indentation area.
177 * Reimplemented from QY2CheckListItem.
179 virtual QString toolTip( int column );
184 int versionCol() const { return _pkgVersionList->versionCol(); }
185 int productCol() const { return _pkgVersionList->productCol(); }
186 int urlCol() const { return _pkgVersionList->urlCol(); }
187 int repoCol() const { return _pkgVersionList->repoCol(); }
188 int statusCol() const { return _pkgVersionList->statusCol(); }
189 int archCol() const { return _pkgVersionList->archCol(); }
196 YQPkgVersionsView * _pkgVersionList;
202 #endif // ifndef YQPkgVersionsView_h