libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgServiceList.h
1/*
2 Copyright (c) 2018-2021 SUSE LLC
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) version 3.0 of the License. This library
8 is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11 License for more details. You should have received a copy of the GNU
12 Lesser General Public License along with this library; if not, write
13 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
14 Floor, Boston, MA 02110-1301 USA
15*/
16
17
18#ifndef YQPkgServiceList_h
19#define YQPkgServiceList_h
20
21#include <string>
22#include <zypp/Product.h>
23#include <yui/qt/QY2ListView.h>
24#include "YQZypp.h"
25
26
28namespace zypp {
29 class RepoManager;
30}
31
32// just a service name
33typedef std::string ZyppService;
34
35
39class YQPkgServiceList : public QY2ListView
40{
41 Q_OBJECT
42
43public:
44
48 YQPkgServiceList( QWidget * parent );
49
53 virtual ~YQPkgServiceList();
54
55
56public slots:
57
65 void filter();
66
70 void filterIfVisible();
71
75 void addService( ZyppService service, const zypp::RepoManager &mgr );
76
77
78public:
79
80 // Column numbers
81 int nameCol() const { return _nameCol; }
82
87
88
89signals:
90
96
101 void filterMatch( ZyppSel selectable,
102 ZyppPkg pkg );
103
108 void filterNearMatch( ZyppSel selectable,
109 ZyppPkg pkg );
110
115
116
117protected slots:
118
122 void fillList();
123
124
125private:
126
127 //
128 // Data members
129 //
130
131 int _nameCol;
132};
133
134
135
136class YQPkgServiceListItem: public QY2ListViewItem
137{
138public:
139
143 YQPkgServiceListItem( YQPkgServiceList *parentList, ZyppService service, const zypp::RepoManager &mgr );
144
148 virtual ~YQPkgServiceListItem();
149
153 ZyppService zyppService() const { return _zyppService; }
154
158 std::string zyppServiceName() const { return _zyppServiceName; }
159
163 const YQPkgServiceList * serviceList() const { return _serviceList; }
164
169 static ZyppProduct singleProduct( ZyppService service );
170
171
172 // Columns
173
174 int nameCol() const { return _serviceList->nameCol(); }
175
176 virtual bool operator< ( const QTreeWidgetItem & other ) const;
177protected:
178
179 // Data members
180
181 YQPkgServiceList * _serviceList;
182 // the zypp service
183 ZyppService _zyppService;
184 std::string _zyppServiceName;
185};
186
187
188#endif // ifndef YQPkgServiceList_h
Definition YQPkgServiceList.h:137
virtual ~YQPkgServiceListItem()
Definition YQPkgServiceList.cc:225
static ZyppProduct singleProduct(ZyppService service)
Definition YQPkgServiceList.cc:231
YQPkgServiceListItem(YQPkgServiceList *parentList, ZyppService service, const zypp::RepoManager &mgr)
Definition YQPkgServiceList.cc:183
std::string zyppServiceName() const
Definition YQPkgServiceList.h:158
const YQPkgServiceList * serviceList() const
Definition YQPkgServiceList.h:163
ZyppService zyppService() const
Definition YQPkgServiceList.h:153
A widget to display a list of libzypp services.
Definition YQPkgServiceList.h:40
YQPkgServiceList(QWidget *parent)
Definition YQPkgServiceList.cc:54
void fillList()
Definition YQPkgServiceList.cc:87
void filterIfVisible()
Definition YQPkgServiceList.cc:115
void addService(ZyppService service, const zypp::RepoManager &mgr)
Definition YQPkgServiceList.cc:170
YQPkgServiceListItem * selection() const
Definition YQPkgServiceList.cc:177
virtual ~YQPkgServiceList()
Definition YQPkgServiceList.cc:81
void filterNearMatch(ZyppSel selectable, ZyppPkg pkg)
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
void filter()
Definition YQPkgServiceList.cc:122