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