libyui-qt
YQMainWinDock.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: YQMainWinDock.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQMainWinDock_h
27 #define YQMainWinDock_h
28 
29 #include <deque>
30 #include <qwidget.h>
31 
32 class QWidgetStack;
33 class YQDialog;
34 
35 
52 class YQMainWinDock : public QWidget
53 {
54  friend class YQWizard;
55 
56  Q_OBJECT
57 
58 public:
65  static YQMainWinDock * mainWinDock();
66 
74  void add( YQDialog * dialog );
75 
87  void remove( YQDialog * dialog = 0 );
88 
93  YQDialog * topmostDialog() const;
94 
99  bool couldDock();
100 
106  virtual void show();
107 
114  virtual void closeEvent( QCloseEvent * event );
115 
116 
117 protected:
124  YQMainWinDock();
125 
129  virtual ~YQMainWinDock();
130 
136  virtual void paintEvent( QPaintEvent * event );
137 
143  virtual void resizeEvent( QResizeEvent * event );
144 
148  void resizeVisibleChild();
149 
153  void setSideBarWidth( int width );
154 
159  void activateCurrentDialog( bool active );
160 
161 
162 protected slots:
163 
167  void showCurrentDialog();
168 
169 
170 private:
171 
172  typedef std::deque<YQDialog *> YQWidgetStack;
173 
178  YQWidgetStack::iterator findInStack( YQDialog * dialog );
179 
180 
181  YQWidgetStack _widgetStack;
182  int _sideBarWidth;
183 };
184 
185 
186 #endif // YQMainWinDock_h
void showCurrentDialog()
Definition: YQMainWinDock.cc:198
YQMainWinDock()
Definition: YQMainWinDock.cc:53
virtual ~YQMainWinDock()
Definition: YQMainWinDock.cc:71
Definition: YQWizard.h:64
void setSideBarWidth(int width)
Definition: YQMainWinDock.cc:320
void activateCurrentDialog(bool active)
Definition: YQMainWinDock.cc:161
virtual void resizeEvent(QResizeEvent *event)
Definition: YQMainWinDock.cc:78
void add(YQDialog *dialog)
Definition: YQMainWinDock.cc:138
Definition: YQMainWinDock.h:52
void resizeVisibleChild()
Definition: YQMainWinDock.cc:89
bool couldDock()
Definition: YQMainWinDock.cc:284
static YQMainWinDock * mainWinDock()
Definition: YQMainWinDock.cc:42
virtual void paintEvent(QPaintEvent *event)
Definition: YQMainWinDock.cc:313
YQDialog * topmostDialog() const
Definition: YQMainWinDock.cc:274
Definition: YQDialog.h:42
virtual void show()
Definition: YQMainWinDock.cc:124
virtual void closeEvent(QCloseEvent *event)
Definition: YQMainWinDock.cc:300