00001 /* 00002 =. This file is part of the OPIE Project 00003 .=l. Copyright (c) 2003 hOlgAr <zecke@handhelds.org> 00004 .>+-= 00005 _;:, .> :=|. This library is free software; you can 00006 .> <`_, > . <= redistribute it and/or modify it under 00007 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00008 .="- .-=="i, .._ License as published by the Free Software 00009 - . .-<_> .<> Foundation; either version 2 of the License, 00010 ._= =} : or (at your option) any later version. 00011 .%`+i> _;_. 00012 .i_,=:_. -<s. This library is distributed in the hope that 00013 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00014 : .. .:, . . . without even the implied warranty of 00015 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00016 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00017 ..}^=.= = ; Library General Public License for more 00018 ++= -. .` .: details. 00019 : = ...= . :.=- 00020 -. .:....=;==+<; You should have received a copy of the GNU 00021 -_. . . )=. = Library General Public License along with 00022 -- :-=` this library; see the file COPYING.LIB. 00023 If not, write to the Free Software Foundation, 00024 Inc., 59 Temple Place - Suite 330, 00025 Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 #ifndef OWIDGETSTACK_H 00030 #define OWIDGETSTACK_H 00031 00032 /* QT*/ 00033 #include <qframe.h> 00034 #include <qmap.h> 00035 00036 class QWidgetStack; 00037 00038 namespace Opie { 00039 namespace Ui { 00059 class OWidgetStack : public QFrame { 00060 Q_OBJECT 00061 public: 00062 enum Mode { SmallScreen, BigScreen, NoForce }; 00063 OWidgetStack( QWidget* parent, const char* name = 0, WFlags fl = 0 ); 00064 ~OWidgetStack(); 00065 00066 enum Mode mode()const; 00067 void forceMode( enum Mode ); 00068 00069 void addWidget( QWidget* , int ); 00070 void removeWidget( QWidget* ); 00071 00072 // QSizeHint sizeHint()const; 00073 // QSizeHint minimumSizeHint()const; 00074 00075 QWidget *widget( int )const; 00076 int id( QWidget* )const; 00077 00078 00079 00080 QWidget* visibleWidget() const; 00081 00082 bool eventFilter( QObject*, QEvent* ); 00083 signals: 00095 void modeChanged( enum Mode mode); 00096 00101 void aboutToShow( QWidget* ); 00102 void aboutToShow( int ); 00103 00104 public slots: 00105 void raiseWidget( int ); 00106 void raiseWidget( QWidget* ); 00107 void hideWidget( int ); 00108 void hideWidget( QWidget* ); 00109 void setMainWindow( QWidget* ); 00110 void setMainWindow( int ); 00111 00112 protected: 00113 void resizeEvent( QResizeEvent* ); 00114 00115 private: 00116 void switchStack(); 00117 void switchTop(); 00118 QMap<int, QWidget*> m_list; 00119 QWidgetStack *m_stack; 00120 QWidget *m_mWidget; 00121 QWidget *m_last; 00122 00123 enum Mode m_mode; 00124 bool m_forced : 1; 00125 00126 struct Private; 00127 Private *d; 00128 }; 00129 00130 } 00131 } 00132 00133 #endif
1.4.2