libyui  3.10.0
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 #define YPkg_OnlineSearch 1 << 8 // Add "Search Online" to menu
39 
40 /**
41  * A simple wrapper for an insanely complex UI for installing software.
42  **/
43 class YPackageSelector : public YWidget
44 {
45 protected:
46  /**
47  * Constructor.
48  *
49  * 'modeFlags' are flags determining which modes to use, ORed together:
50  * YPkg_OnlineUpdateMode | YPkg_TestMode
51  **/
52  YPackageSelector( YWidget * parent, long modeFlags = 0 );
53 
54 public:
55  /**
56  * Returns a descriptive name of this widget class for logging,
57  * debugging etc.
58  **/
59  virtual const char * widgetClass() const { return "YPackageSelector"; }
60 
61  /**
62  * Check for the various modes.
63  **/
64  bool testMode() const { return _modeFlags & YPkg_TestMode; }
65  bool onlineUpdateMode() const { return _modeFlags & YPkg_OnlineUpdateMode; }
66  bool updateMode() const { return _modeFlags & YPkg_UpdateMode; }
67  bool searchMode() const { return _modeFlags & YPkg_SearchMode; }
68  bool summaryMode() const { return _modeFlags & YPkg_SummaryMode; }
69  bool repoMode() const { return _modeFlags & YPkg_RepoMode; }
70  bool repoMgrEnabled() const { return _modeFlags & YPkg_RepoMgr; }
71  bool confirmUnsupported() const { return _modeFlags & YPkg_ConfirmUnsupported; }
72  bool onlineSearchEnabled() const { return _modeFlags & YPkg_OnlineSearch; }
73 
74 protected:
75  long _modeFlags;
76 };
77 
78 
79 #endif // YPackageSelector_h
A simple wrapper for an insanely complex UI for installing software.
bool testMode() const
Check for the various modes.
YPackageSelector(YWidget *parent, long modeFlags=0)
Constructor.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
Abstract base class of all UI widgets.
Definition: YWidget.h:55
YWidget * parent() const
Return this widget's parent or 0 if it doesn't have a parent.
Definition: YWidget.cc:271