picking up branches/tmp/sh/qt4-port/, merging it with trunk
[duncan/yast2-qt4.git] / src / YQTimeField.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:         YQTimeField.h
14
15   Author:       Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQTimeField_h
21 #define YQTimeField_h
22
23 #include <QFrame>
24 #include "YTimeField.h"
25
26 class YQWidgetCaption;
27 class QTimeEdit;
28
29
30 class YQTimeField : public QFrame, public YTimeField
31 {
32     Q_OBJECT
33
34 public:
35     /**
36      * Constructor.
37      **/
38     YQTimeField( YWidget *      parent,
39                  const string & label );
40
41     /**
42      * Destructor.
43      **/
44     virtual ~YQTimeField();
45
46     /**
47      * Get the current value (the text entered by the user or set from the
48      * outside) of this input field.
49      *
50      * Implemented from YSimpleInputField.
51      **/
52     virtual string value();
53
54     /**
55      * Set the current value (the text entered by the user or set from the
56      * outside) of this input field.
57      *
58      * Implemented from YSimpleInputField.
59      **/
60     virtual void setValue( const string & newValue );
61
62     /**
63      * Set the label (the caption above the input field).
64      *
65      * Reimplemented from YSimpleInputField.
66      **/
67     virtual void setLabel( const string & label );
68
69     /**
70      * Set enabled/disabled state.
71      *
72      * Reimplemented from YWidget.
73      **/
74     virtual void setEnabled( bool enabled );
75
76     /**
77      * Preferred width of the widget.
78      *
79      * Reimplemented from YWidget.
80      **/
81     virtual int preferredWidth();
82
83     /**
84      * Preferred height of the widget.
85      *
86      * Reimplemented from YWidget.
87      **/
88     virtual int preferredHeight();
89
90     /**
91      * Set the new size of the widget.
92      *
93      * Reimplemented from YWidget.
94      **/
95     virtual void setSize( int newWidth, int newHeight );
96
97     /**
98      * Accept the keyboard focus.
99      *
100      * Reimplemented from YWidget.
101      **/
102     virtual bool setKeyboardFocus();
103
104
105 protected:
106
107     YQWidgetCaption *   _caption;
108     QTimeEdit *         _qt_timeEdit;
109 };
110
111
112 #endif // YQTimeField_h