libyui-qt
2.43.5
|
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: YQCheckBoxFrame.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 00026 #ifndef YQCheckBoxFrame_h 00027 #define YQCheckBoxFrame_h 00028 00029 #include <qgroupbox.h> 00030 #include <yui/YCheckBoxFrame.h> 00031 00032 00033 class QWidget; 00034 class QCheckBox; 00035 00036 class YQCheckBoxFrame : public QGroupBox, public YCheckBoxFrame 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 00042 /** 00043 * Constructor. 00044 **/ 00045 YQCheckBoxFrame( YWidget * parent, 00046 const std::string & label, 00047 bool checked ); 00048 00049 /** 00050 * Change the label text on the CheckBoxFrame. 00051 * 00052 * Reimplemented from YCheckBoxFrame. 00053 **/ 00054 virtual void setLabel( const std::string & label ); 00055 00056 /** 00057 * Check or uncheck the CheckBoxFrame's check box. 00058 * 00059 * Reimplemented from YCheckBoxFrame. 00060 **/ 00061 virtual void setValue( bool isChecked ); 00062 00063 /** 00064 * Get the status of the CheckBoxFrame's check box. 00065 * 00066 * Reimplemented from YCheckBoxFrame. 00067 **/ 00068 virtual bool value(); 00069 00070 /** 00071 * Set enabled / disabled state. 00072 * 00073 * Reimplemented from YWidget. 00074 **/ 00075 virtual void setEnabled( bool enabled ); 00076 00077 /** 00078 * Preferred width of the widget. 00079 * 00080 * Reimplemented from YWidget. 00081 **/ 00082 virtual int preferredWidth(); 00083 00084 /** 00085 * Preferred height of the widget. 00086 * 00087 * Reimplemented from YWidget. 00088 **/ 00089 virtual int preferredHeight(); 00090 00091 /** 00092 * Set the new size of the widget. 00093 * 00094 * Reimplemented from YWidget. 00095 **/ 00096 virtual void setSize( int newWidth, int newHeight ); 00097 00098 /** 00099 * Accept the keyboard focus. 00100 * 00101 * Reimplemented from YWidget. 00102 **/ 00103 virtual bool setKeyboardFocus(); 00104 00105 00106 private slots: 00107 00108 /** 00109 * Triggered when the on/off status is changed 00110 **/ 00111 void stateChanged( bool newState ); 00112 00113 00114 protected: 00115 00116 /** 00117 * Reimplemented from QGroupBox to prevent QGroupBox from disabling 00118 * children according to the check box status as the children are inserted. 00119 **/ 00120 virtual void childEvent( QChildEvent * ); 00121 00122 virtual bool event(QEvent *e); 00123 }; 00124 00125 00126 #endif // YQCheckBoxFrame_h