libyui-qt  2.43.5
/usr/src/RPM/BUILD/libyui-qt-2.43.5/src/YQCheckBox.h
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:       YQCheckBox.h
00020 
00021   Author:     Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 
00026 #ifndef YQCheckBox_h
00027 #define YQCheckBox_h
00028 
00029 #include <QCheckBox>
00030 #include <yui/YCheckBox.h>
00031 
00032 class YQCheckBox : public QCheckBox, public YCheckBox
00033 {
00034     Q_OBJECT
00035 
00036 public:
00037 
00038     /**
00039      * Constructor.
00040      **/
00041     YQCheckBox( YWidget *       parent,
00042                 const std::string &     label,
00043                 bool            checked );
00044 
00045     /**
00046      * Destructor.
00047      **/
00048     virtual ~YQCheckBox();
00049 
00050     /**
00051      * Get the current value:
00052      *
00053      * YCheckBox_on             CheckBox is checked
00054      * YCheckBox_off            CheckBox is unchecked
00055      *
00056      * YCheckBox_dont_care      tri-state: CheckBox is greyed out,
00057      *                          neither checked nor unchecked
00058      *
00059      * Reimplemented from YCheckBox.
00060      **/
00061     virtual YCheckBoxState value();
00062 
00063     /**
00064      * Set the CheckBox value (on/off/don't care).
00065      *
00066      * Reimplemented from YCheckBox.
00067      **/
00068     virtual void setValue( YCheckBoxState state );
00069 
00070     /**
00071      * Change the label (the text) on the RadioButton.
00072      *
00073      * Reimplemented from YRadioButton.
00074      **/
00075     virtual void setLabel( const std::string & label );
00076 
00077     /**
00078      * Use a bold font.
00079      *
00080      * Reimplemented from YRadioButton.
00081      **/
00082     virtual void setUseBoldFont( bool bold = true );
00083 
00084     /**
00085      * Set enabled / disabled state.
00086      *
00087      * Reimplemented from YWidget.
00088      **/
00089     virtual void setEnabled( bool enabled );
00090 
00091     /**
00092      * Preferred width of the widget.
00093      *
00094      * Reimplemented from YWidget.
00095      **/
00096     virtual int preferredWidth();
00097 
00098     /**
00099      * Preferred height of the widget.
00100      *
00101      * Reimplemented from YWidget.
00102      **/
00103     virtual int preferredHeight();
00104 
00105     /**
00106      * Set the new size of the widget.
00107      *
00108      * Reimplemented from YWidget.
00109      **/
00110     virtual void setSize( int newWidth, int newHeight );
00111 
00112     /**
00113      * Accept the keyboard focus.
00114      *
00115      * Reimplemented from YWidget.
00116      **/
00117     virtual bool setKeyboardFocus();
00118 
00119 
00120 private slots:
00121 
00122     /**
00123      * Triggered when the on/off status is changed
00124      **/
00125     void stateChanged ( int newState );
00126 
00127 };
00128 
00129 #endif // YQCheckBox_h
 All Classes Functions Variables