libyui-ncurses-pkg
 
Loading...
Searching...
No Matches
NCPkgFilterService.h
1/*
2 Copyright (c) 2002-2011 Novell, Inc.
3 Copyright (c) 2018-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#ifndef NCPkgFilterService_h
20#define NCPkgFilterService_h
21
22#include <iosfwd>
23#include <string>
24#include <vector>
25#include <algorithm>
26
27#include <zypp/RepoManager.h>
28
29#include <yui/ncurses/NCPadWidget.h>
30#include <yui/ncurses/NCPopup.h>
31#include <yui/ncurses/NCPushButton.h>
32#include <yui/ncurses/NCTable.h>
33#include <yui/ncurses/NCTablePad.h>
34
35#include "NCZypp.h"
36
37
38class NCTable;
39class NCPushButton;
41
42// represent a service by its name
43typedef std::string ZyppService;
44
45class NCPkgServiceTag : public YTableCell
46{
47
48private:
49
50 ZyppService service;
51
52public:
59
60 NCPkgServiceTag( ZyppService service );
61
63
64 /*
65 * Get service reference from the line tag
66 * @return ZyppService
67 */
68
69 ZyppService getService() const { return service; }
70
71};
72
73class NCPkgServiceTable : public NCTable
74{
75private:
76
77 NCPkgServiceTable & operator=( const NCPkgServiceTable & );
78 NCPkgServiceTable ( const NCPkgServiceTable & );
79
80 NCPackageSelector *packager;
81 zypp::shared_ptr<zypp::RepoManager> repo_manager;
82
83public:
84
92
93 NCPkgServiceTable ( YWidget *parent, YTableHeader *tableHeader, NCPackageSelector *pkg);
94
95 virtual ~NCPkgServiceTable() {};
96
100 static bool any_service();
101
107 virtual void addLine( ZyppService r, const std::vector<std::string> & cols );
108
109 /*
110 * Fill header of services table (name + URL)
111 */
112 void fillHeader();
113
120 NCPkgServiceTag * getTag ( int index );
121
127 ZyppService getService( int index );
128
132 std::string getDescription (ZyppService r);
133
134 virtual NCursesEvent wHandleInput ( wint_t ch );
135
141 bool fillServiceList();
142
147 void showServicePackages();
148
149};
150#endif
Definition NCPackageSelector.h:105
NCPkgServiceTag * getTag(int index)
Definition NCPkgFilterService.cc:141
void showServicePackages()
Definition NCPkgFilterService.cc:226
std::string getDescription(ZyppService r)
Definition NCPkgFilterService.cc:182
bool fillServiceList()
Definition NCPkgFilterService.cc:201
static bool any_service()
Definition NCPkgFilterService.cc:74
ZyppService getService(int index)
Definition NCPkgFilterService.cc:167
virtual void addLine(ZyppService r, const std::vector< std::string > &cols)
Definition NCPkgFilterService.cc:114
Definition NCPkgFilterService.h:46
NCPkgServiceTag(ZyppService service)
Definition NCPkgFilterService.cc:49