libyui-ncurses-pkg
NCPkgFilterRepo.h
1 /****************************************************************************
2 |
3 | Copyright (c) [2002-2011] Novell, Inc.
4 | All Rights Reserved.
5 |
6 | This program is free software; you can redistribute it and/or
7 | modify it under the terms of version 2 of the GNU General Public License as
8 | published by the Free Software Foundation.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, contact Novell, Inc.
17 |
18 | To contact Novell about this file by physical or electronic mail,
19 | you may find current contact information at www.novell.com
20 |
21 |***************************************************************************/
22 
23 
24 /*---------------------------------------------------------------------\
25 | |
26 | __ __ ____ _____ ____ |
27 | \ \ / /_ _/ ___|_ _|___ \ |
28 | \ V / _` \___ \ | | __) | |
29 | | | (_| |___) || | / __/ |
30 | |_|\__,_|____/ |_| |_____| |
31 | |
32 | core system |
33 | (C) SuSE GmbH |
34 \----------------------------------------------------------------------/
35 
36  File: NCPkgFilterRepo.h
37 
38  Author: Bubli <kmachalkova@suse.cz>
39 
40 /-*/
41 
42 #ifndef NCPkgFilterRepo_h
43 #define NCPkgFilterRepo_h
44 
45 #include <iosfwd>
46 #include <string>
47 #include <vector>
48 #include <algorithm>
49 
50 #include <yui/ncurses/NCPadWidget.h>
51 #include <yui/ncurses/NCPopup.h>
52 #include <yui/ncurses/NCPushButton.h>
53 #include <yui/ncurses/NCTable.h>
54 #include <yui/ncurses/NCTablePad.h>
55 
56 #include "NCZypp.h"
57 
58 
59 class NCTable;
60 class NCPushButton;
61 class NCPackageSelector;
62 
63 class NCPkgRepoTag : public YTableCell
64 {
65 
66 private:
67 
68  ZyppRepo repo;
69 
70 public:
78  NCPkgRepoTag ( ZyppRepo repo);
79 
80  // Nikdy, ale opravdu nikdy nenechavej v odvozene tride virtualni
81  // destruktor, kdyz ani v puvodni neni, Bublino!
82  ~NCPkgRepoTag() {};
83 
84  /*
85  * Get repository reference from the line tag
86  * @return ZyppRepo
87  */
88 
89  ZyppRepo getRepo() const { return repo; }
90 
91 };
92 
93 class NCPkgRepoTable : public NCTable
94 {
95 private:
96 
97  NCPkgRepoTable & operator=( const NCPkgRepoTable & );
98  NCPkgRepoTable ( const NCPkgRepoTable & );
99 
100  NCPackageSelector *packager;
101 public:
102 
110  NCPkgRepoTable ( YWidget *parent, YTableHeader *tableHeader, NCPackageSelector *pkg);
111 
112  virtual ~NCPkgRepoTable() {};
113 
119  virtual void addLine( ZyppRepo r, const std::vector<std::string> & cols );
120 
121  /*
122  * Fill header of repositories table (name + URL)
123  */
124  void fillHeader();
125 
132  NCPkgRepoTag * getTag ( const int & index );
133 
139  ZyppRepo getRepo( int index );
140 
141  std::string showDescription (ZyppRepo r);
142 
143  virtual NCursesEvent wHandleInput ( wint_t ch );
144 
152  ZyppProduct findProductForRepo (ZyppRepo repo);
153 
159  bool fillRepoList();
160 
161  bool showRepoPackages();
162 
163 };
164 #endif
ZyppProduct findProductForRepo(ZyppRepo repo)
Definition: NCPkgFilterRepo.cc:291
Definition: NCPkgFilterRepo.h:63
ZyppRepo getRepo(int index)
Definition: NCPkgFilterRepo.cc:178
NCPkgRepoTag * getTag(const int &index)
Definition: NCPkgFilterRepo.cc:152
Definition: NCPkgFilterRepo.h:93
NCPkgRepoTag(ZyppRepo repo)
Definition: NCPkgFilterRepo.cc:70
bool fillRepoList()
Definition: NCPkgFilterRepo.cc:220
Definition: NCPackageSelector.h:109
virtual void addLine(ZyppRepo r, const std::vector< std::string > &cols)
Definition: NCPkgFilterRepo.cc:123