src/inputfield.h
changeset 0 04114bce8fd0
equal deleted inserted replaced
-1:000000000000 0:04114bce8fd0
       
     1 #ifndef INPUTFIELD_H
       
     2 #define INPUTFIELD_H
       
     3 
       
     4 #include <qhbox.h>
       
     5 
       
     6 class QString;
       
     7 class QLabel;
       
     8 class QLineEdit;
       
     9 
       
    10 /*!
       
    11  * A class for making input fields of type "Label: Textbox"
       
    12 */
       
    13 class InputField : public QHBox
       
    14 {
       
    15 	Q_OBJECT
       
    16 
       
    17 private:
       
    18 	QLabel *labelbox;
       
    19 	QLineEdit *textbox;
       
    20 	
       
    21 	void initWidget();
       
    22 
       
    23 public slots:
       
    24 	/*!
       
    25 	 * Sets the contents of the textbox
       
    26 	 */
       
    27 	void setText(QString &str);
       
    28 	/*!
       
    29 	 * Sets the label of the input field
       
    30 	 */
       
    31 	void setLabel(QString &str);
       
    32 
       
    33 public:
       
    34 	/*!
       
    35 	 * Constructs an InputField with no label or textbox content
       
    36 	 */
       
    37 	InputField(QWidget *parent=0, const char *name=0);
       
    38 	/*!
       
    39 	 * Constructs an InputField with label \param mylabel and
       
    40 	 * void textbox
       
    41 	 * \param mylabel Label of the InputField
       
    42 	 */
       
    43 	InputField(const QString &mylabel, QWidget *parent=0,
       
    44 			const char *name=0);
       
    45 	/*!
       
    46 	 * Constructs an InputField with label \param mylabel and
       
    47 	 * a textbox with content
       
    48 	 * \param mylabel Label of the InputField
       
    49 	 * \param mytext  Initial content of the textbox
       
    50 	 */
       
    51 	InputField(const QString &mylabel, const QString &mytext,
       
    52 			QWidget *parent=0, const char *name=0);
       
    53 
       
    54 	/*!
       
    55 	 * Returns the contents of the textbox
       
    56 	 */
       
    57 	QString text() const;
       
    58 	/*!
       
    59 	 * Returns the label of the input field
       
    60 	 */
       
    61 	QString label() const;
       
    62 
       
    63 	/*!
       
    64 	 * Returns the QLabel
       
    65 	 */
       
    66 	QLabel* qLabel();
       
    67 	/*!
       
    68 	 * Returns the QLineEdit
       
    69 	 */
       
    70 	QLineEdit* qLineEdit();
       
    71 };
       
    72 
       
    73 #endif // INPUTFIELD_H