libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YPackageSelector.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YPackageSelector.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YPackageSelector_h
26 #define YPackageSelector_h
27 
28 #include "YWidget.h"
29 
30 #define YPkg_TestMode 1 << 0 // Test mode for debugging
31 #define YPkg_OnlineUpdateMode 1 << 1 // Online update mode: Show patches
32 #define YPkg_UpdateMode 1 << 2 // Start with "Update problems" filter view
33 #define YPkg_SearchMode 1 << 3 // Start with "Search" filter view
34 #define YPkg_SummaryMode 1 << 4 // Start with "Summary" filter view
35 #define YPkg_RepoMode 1 << 5 // Start with "Repositories" filter view
36 #define YPkg_RepoMgr 1 << 6 // Add "Manage Repositories" to menu
37 #define YPkg_ConfirmUnsupported 1 << 7 // Confirm unsupported packages
38 
39 
40 class YPackageSelector : public YWidget
41 {
42 protected:
43  /**
44  * Constructor.
45  *
46  * 'modeFlags' are flags determining which modes to use, ORed together:
47  * YPkg_OnlineUpdateMode | YPkg_TestMode
48  **/
49  YPackageSelector( YWidget * parent, long modeFlags = 0 );
50 
51 public:
52  /**
53  * Returns a descriptive name of this widget class for logging,
54  * debugging etc.
55  **/
56  virtual const char * widgetClass() const { return "YPackageSelector"; }
57 
58  /**
59  * Check for the various modes.
60  **/
61  bool testMode() const { return _modeFlags & YPkg_TestMode; }
62  bool onlineUpdateMode() const { return _modeFlags & YPkg_OnlineUpdateMode; }
63  bool updateMode() const { return _modeFlags & YPkg_UpdateMode; }
64  bool searchMode() const { return _modeFlags & YPkg_SearchMode; }
65  bool summaryMode() const { return _modeFlags & YPkg_SummaryMode; }
66  bool repoMode() const { return _modeFlags & YPkg_RepoMode; }
67  bool repoMgrEnabled() const { return _modeFlags & YPkg_RepoMgr; }
68  bool confirmUnsupported() const { return _modeFlags & YPkg_ConfirmUnsupported; }
69 
70 protected:
71  long _modeFlags;
72 };
73 
74 
75 #endif // YPackageSelector_h
YWidget * parent() const
Definition: YWidget.cc:269
YPackageSelector(YWidget *parent, long modeFlags=0)
bool testMode() const
virtual const char * widgetClass() const