libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgRepoList.h
1/*
2 Copyright (c) 2000 - 2010 Novell, Inc.
3 Copyright (c) 2021 SUSE LLC
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) version 3.0 of the License. This library
9 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details. You should have received a copy of the GNU
13 Lesser General Public License along with this library; if not, write
14 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
15 Floor, Boston, MA 02110-1301 USA
16*/
17
18
19/*
20 File: YQPkgRepoList.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgRepoList_h
26#define YQPkgRepoList_h
27
28#include <zypp/Repository.h>
29#include <zypp/Product.h>
30#include <yui/qt/QY2ListView.h>
31
32#include "YQZypp.h"
33
34
36
37typedef zypp::Repository ZyppRepo;
38
39
43class YQPkgRepoList : public QY2ListView
44{
45 Q_OBJECT
46
47public:
48
52 YQPkgRepoList( QWidget * parent );
53
57 virtual ~YQPkgRepoList();
58
62 static int countEnabledRepositories();
63
64
65public slots:
66
74 void filter();
75
79 void filterIfVisible();
80
84 void addRepo( ZyppRepo repo );
85
86
87public:
88
89 // Column numbers
90
91 int nameCol() const { return _nameCol; }
92 int urlCol() const { return _urlCol; }
93
94
99
100
101signals:
102
108
113 void filterMatch( ZyppSel selectable,
114 ZyppPkg pkg );
115
120 void filterNearMatch( ZyppSel selectable,
121 ZyppPkg pkg );
122
127
128
129protected slots:
130
134 void fillList();
135
136
137private:
138
139 //
140 // Data members
141 //
142
143 int _nameCol;
144 int _urlCol;
145
146};
147
148
149
150class YQPkgRepoListItem: public QY2ListViewItem
151{
152public:
153
157 YQPkgRepoListItem( YQPkgRepoList *parentList, ZyppRepo repo );
158
162 virtual ~YQPkgRepoListItem();
163
167 ZyppRepo zyppRepo() const { return _zyppRepo; }
168
172 const YQPkgRepoList * repoList() const { return _repoList; }
173
178 static ZyppProduct singleProduct( ZyppRepo repo );
179
180
181 // Columns
182
183 int nameCol() const { return _repoList->nameCol(); }
184 int urlCol() const { return _repoList->urlCol(); }
185
186 virtual bool operator< ( const QTreeWidgetItem & other ) const;
187protected:
188
189 // Data members
190
191 YQPkgRepoList * _repoList;
192 ZyppRepo _zyppRepo;
193};
194
195
196#endif // ifndef YQPkgRepoList_h
Definition YQPkgRepoList.h:151
ZyppRepo zyppRepo() const
Definition YQPkgRepoList.h:167
const YQPkgRepoList * repoList() const
Definition YQPkgRepoList.h:172
static ZyppProduct singleProduct(ZyppRepo repo)
Definition YQPkgRepoList.cc:269
virtual ~YQPkgRepoListItem()
Definition YQPkgRepoList.cc:262
YQPkgRepoListItem(YQPkgRepoList *parentList, ZyppRepo repo)
Definition YQPkgRepoList.cc:193
Display a list of libzypp repositories.
Definition YQPkgRepoList.h:44
void filterIfVisible()
Definition YQPkgRepoList.cc:119
void filter()
Definition YQPkgRepoList.cc:127
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
void filterStart()
void filterFinished()
void filterNearMatch(ZyppSel selectable, ZyppPkg pkg)
void addRepo(ZyppRepo repo)
Definition YQPkgRepoList.cc:175
YQPkgRepoListItem * selection() const
Definition YQPkgRepoList.cc:182
virtual ~YQPkgRepoList()
Definition YQPkgRepoList.cc:88
YQPkgRepoList(QWidget *parent)
Definition YQPkgRepoList.cc:54
static int countEnabledRepositories()
Definition YQPkgRepoList.cc:112
void fillList()
Definition YQPkgRepoList.cc:95