libyui
3.0.10
|
00001 /* 00002 Copyright (C) 2000-2012 Novell, Inc 00003 This library is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU Lesser General Public License as 00005 published by the Free Software Foundation; either version 2.1 of the 00006 License, or (at your option) version 3.0 of the License. This library 00007 is distributed in the hope that it will be useful, but WITHOUT ANY 00008 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00010 License for more details. You should have received a copy of the GNU 00011 Lesser General Public License along with this library; if not, write 00012 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00013 Floor, Boston, MA 02110-1301 USA 00014 */ 00015 00016 00017 /*-/ 00018 00019 File: YPackageSelector.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 #ifndef YPackageSelector_h 00026 #define YPackageSelector_h 00027 00028 #include "YWidget.h" 00029 00030 #define YPkg_TestMode 1 << 0 // Test mode for debugging 00031 #define YPkg_OnlineUpdateMode 1 << 1 // Online update mode: Show patches 00032 #define YPkg_UpdateMode 1 << 2 // Start with "Update problems" filter view 00033 #define YPkg_SearchMode 1 << 3 // Start with "Search" filter view 00034 #define YPkg_SummaryMode 1 << 4 // Start with "Summary" filter view 00035 #define YPkg_RepoMode 1 << 5 // Start with "Repositories" filter view 00036 #define YPkg_RepoMgr 1 << 6 // Add "Manage Repositories" to menu 00037 #define YPkg_ConfirmUnsupported 1 << 7 // Confirm unsupported packages 00038 00039 00040 class YPackageSelector : public YWidget 00041 { 00042 protected: 00043 /** 00044 * Constructor. 00045 * 00046 * 'modeFlags' are flags determining which modes to use, ORed together: 00047 * YPkg_OnlineUpdateMode | YPkg_TestMode 00048 **/ 00049 YPackageSelector( YWidget * parent, long modeFlags = 0 ); 00050 00051 public: 00052 /** 00053 * Returns a descriptive name of this widget class for logging, 00054 * debugging etc. 00055 **/ 00056 virtual const char * widgetClass() const { return "YPackageSelector"; } 00057 00058 /** 00059 * Check for the various modes. 00060 **/ 00061 bool testMode() const { return _modeFlags & YPkg_TestMode; } 00062 bool onlineUpdateMode() const { return _modeFlags & YPkg_OnlineUpdateMode; } 00063 bool updateMode() const { return _modeFlags & YPkg_UpdateMode; } 00064 bool searchMode() const { return _modeFlags & YPkg_SearchMode; } 00065 bool summaryMode() const { return _modeFlags & YPkg_SummaryMode; } 00066 bool repoMode() const { return _modeFlags & YPkg_RepoMode; } 00067 bool repoMgrEnabled() const { return _modeFlags & YPkg_RepoMgr; } 00068 bool confirmUnsupported() const { return _modeFlags & YPkg_ConfirmUnsupported; } 00069 00070 protected: 00071 long _modeFlags; 00072 }; 00073 00074 00075 #endif // YPackageSelector_h