libyui-ncurses-pkg  2.44.4
 All Classes Functions
NCPkgFilterRPMGroups.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: NCPkgFilterRPMGroups.h
37 
38  Author: Gabriele Strattner <gs@suse.de>
39 
40 /-*/
41 #ifndef NCPkgFilterRPMGroups_h
42 #define NCPkgFilterRPMGroups_h
43 
44 #include <iosfwd>
45 
46 #include <vector>
47 #include <string>
48 
49 #include "NCPopup.h"
50 #include "NCTree.h"
51 #include "NCLabel.h"
52 #include "NCRichText.h"
53 #include "NCZypp.h"
54 
55 #include <YRpmGroupsTree.h>
56 
57 class NCTree;
58 class NCPackageSelector;
59 class NCRpmGroupItem;
60 
61 ///////////////////////////////////////////////////////////////////
62 //
63 // CLASS NAME : NCPkgFilterRPMGroups
64 //
65 // DESCRIPTION :
66 //
67 class NCPkgFilterRPMGroups : public NCTree {
68 
69  NCPkgFilterRPMGroups & operator=( const NCPkgFilterRPMGroups & );
71 
72 private:
73 
74  NCTree * filterTree; // the YTree
75 
76  NCPackageSelector * packager; // connection to the PackageSelector
77 
78  YRpmGroupsTree * _rpmGroupsTree; // rpm groups of the found packages
79 
80  // internal use (copies tree items)
81  void cloneTree( YStringTreeItem * parentOrig, NCRpmGroupItem * parentClone );
82 
83 protected:
84 
85  void setCurrentItem( int index );
86 
87  virtual NCursesEvent wHandleInput( wint_t ch );
88 
89 public:
90 
91  NCPkgFilterRPMGroups( YWidget *parent, std::string label, NCPackageSelector * packager );
92  virtual ~NCPkgFilterRPMGroups();
93 
94  bool handleEvent();
95 
96  YStringTreeItem * getDefaultRpmGroup();
97 
98  bool checkPackage( ZyppObj opkg, ZyppSel slb, YStringTreeItem *rpmGroup);
99 
100  bool showRPMGroupPackages ( const std::string & label, YStringTreeItem *rpmGroup );
101 
102  void addItem( YTreeItem * newItem );
103 
104 };
105 
106 ///////////////////////////////////////////////////////////////////
107 
108 
109 #endif // NCPkgFilterRPMGroups_h