libyui-ncurses-pkg  2.50.8
NCPkgMenuFilter.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: NCPkgMenuFilter.cc
37 
38  Author: Gabriele Mohr <gs@suse.de>
39 
40 /-*/
41 #ifndef NCPkgMenuFilter_h
42 #define NCPkgMenuFilter_h
43 
44 #include <string>
45 
46 #include <YReplacePoint.h>
47 #include <YWidget.h>
48 #include "NCurses.h"
49 #include "NCi18n.h"
50 #include "NCMenuButton.h"
51 #include "NCPkgPatchSearch.h"
52 
53 class NCPackageSelector;
54 
55 #include "NCZypp.h"
56 
57 class NCPkgMenuFilter : public NCMenuButton
58 {
59 public:
60 
61  enum PatchFilter
62  {
63  F_Needed,
64  F_Unneeded,
65  F_All,
66  F_Recommended,
67  F_Security,
68  F_Optional,
69  F_Unknown
70  };
71 
72  NCPkgMenuFilter & operator=( const NCPkgMenuFilter & );
73  NCPkgMenuFilter ( const NCPkgMenuFilter & );
74 
75 private:
76  NCPackageSelector *pkg;
77 
78  NCPkgPatchSearch *searchPopup;
79 
80  YItemCollection items;
81 
82  YMenuItem *needed;
83  YMenuItem *unneeded;
84  YMenuItem *allPatches;
85  YMenuItem *recommended;
86  YMenuItem *security;
87  YMenuItem *optional;
88  YMenuItem *search;
89 
90 
91 public:
92 
93  NCPkgMenuFilter (YWidget *parent, std::string label, NCPackageSelector *pkger);
94  virtual ~NCPkgMenuFilter();
95 
96  void createLayout();
97 
98  bool handleEvent (const NCursesEvent & event);
99 
100 };
101 
102 #endif