libyui-qt  2.49.2
YQDumbTab.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQDumbTab.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQDumbTab_h
27 #define YQDumbTab_h
28 
29 #include <qwidget.h>
30 #include <yui/YDumbTab.h>
31 
32 class QTabBar;
33 class QPaintEvent;
34 
35 
36 class YQDumbTab : public QWidget, public YDumbTab
37 {
38  Q_OBJECT
39 
40 public:
41 
42  /**
43  * Constructor.
44  **/
45  YQDumbTab( YWidget * parent );
46 
47  /**
48  * Destructor.
49  **/
50  virtual ~YQDumbTab();
51 
52  /**
53  * Add an item (a tab page).
54  *
55  * Reimplemented from YDumbTab.
56  **/
57  virtual void addItem( YItem * item );
58 
59  /**
60  * Select or deselect an item.
61  *
62  * Reimplemented from YSelectionWidget.
63  **/
64  virtual void selectItem( YItem * item, bool selected = true );
65 
66  /**
67  * Deselect all items.
68  *
69  * Reimplemented from YSelectionWidget.
70  **/
71  virtual void deselectAllItems();
72 
73  /**
74  * Delete all items (all tab pages).
75  *
76  * Reimplemented from YSelectionWidget.
77  **/
78  virtual void deleteAllItems();
79 
80  /**
81  * Notification that some shortcut was changed.
82  *
83  * Reimplemented from YDumbTab.
84  **/
85  virtual void shortcutChanged();
86 
87  /**
88  * Set enabled/disabled state.
89  *
90  * Reimplemented from YWidget.
91  **/
92  virtual void setEnabled( bool enabled );
93 
94  /**
95  * Preferred width of the widget.
96  *
97  * Reimplemented from YWidget.
98  **/
99  virtual int preferredWidth();
100 
101  /**
102  * Preferred height of the widget.
103  *
104  * Reimplemented from YWidget.
105  **/
106  virtual int preferredHeight();
107 
108  /**
109  * Set the new size of the widget.
110  *
111  * Reimplemented from YWidget.
112  **/
113  virtual void setSize( int newWidth, int newHeight );
114 
115 public slots:
116 
117  /**
118  * Send an event that the tab with the specified index is selected.
119  **/
120  void slotSelected( int index );
121 
122 protected:
123 
124  QTabBar * _tabBar;
125 };
126 
127 #endif // YQDumbTab_h
virtual void addItem(YItem *item)
Add an item (a tab page).
Definition: YQDumbTab.cc:74
virtual void deleteAllItems()
Delete all items (all tab pages).
Definition: YQDumbTab.cc:103
YQDumbTab(YWidget *parent)
Constructor.
Definition: YQDumbTab.cc:45
void slotSelected(int index)
Send an event that the tab with the specified index is selected.
Definition: YQDumbTab.cc:124
virtual int preferredHeight()
Preferred height of the widget.
Definition: YQDumbTab.cc:170
virtual ~YQDumbTab()
Destructor.
Definition: YQDumbTab.cc:67
virtual void shortcutChanged()
Notification that some shortcut was changed.
Definition: YQDumbTab.cc:136
virtual void setEnabled(bool enabled)
Set enabled/disabled state.
Definition: YQDumbTab.cc:152
virtual int preferredWidth()
Preferred width of the widget.
Definition: YQDumbTab.cc:160
virtual void selectItem(YItem *item, bool selected=true)
Select or deselect an item.
Definition: YQDumbTab.cc:88
virtual void deselectAllItems()
Deselect all items.
Definition: YQDumbTab.cc:117
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
Definition: YQDumbTab.cc:180