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 OSPLITTER_H 00030 #define OSPLITTER_H 00031 00032 #include "obigscreen_p.h" 00033 00034 /* QT */ 00035 #include <qframe.h> 00036 #include <qlist.h> 00037 #include <qstring.h> 00038 #include <qvaluelist.h> 00039 00040 class QHBox; 00041 00042 //template class QValueList<Opie::OSplitterContainer>; 00043 00044 /* 00045 * TODO 00046 * -check API docu 00047 * -one more example 00048 * -allow inserting at a position 00049 */ 00050 00051 namespace Opie{ 00052 namespace Ui { 00053 class OTabWidget; 00054 00072 class OSplitter : public QFrame 00073 { 00074 Q_OBJECT 00075 public: 00076 typedef QValueList<Opie::Ui::Internal::OSplitterContainer> ContainerList; 00077 OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, 00078 const char* name = 0, WFlags fl = 0 ); 00079 ~OSplitter(); 00080 00081 void setLabel( const QString& name ); 00082 void setIconName( const QString& name ); 00083 QString label()const; 00084 QString iconName()const; 00085 00086 void setSizeChange( int width_height ); 00087 00088 void addWidget( OSplitter* splitter ); 00089 void addWidget( QWidget* wid, const QString& icon, const QString& label ); 00090 void removeWidget( QWidget* ); 00091 void removeWidget( OSplitter* ); 00092 00093 void setCurrentWidget( QWidget* ); 00094 void setCurrentWidget( const QString& label ); 00095 void setCurrentWidget( int ); 00096 QWidget* currentWidget()const; 00097 00098 00099 signals: 00104 void currentChanged( QWidget* ); 00105 00114 void sizeChanged( bool b, Orientation ori); 00115 public: 00116 // QSize sizeHint()const; 00117 // QSize minimumSizeHint()const; 00118 00119 protected: 00120 void resizeEvent( QResizeEvent* ); 00121 00122 private: 00123 /* true if OTabMode */ 00124 bool layoutMode()const; 00125 // void reparentAll(); 00126 void setTabWidget( OTabWidget*); 00127 void addToTab( const Opie::Ui::Internal::OSplitterContainer& ); 00128 void addToBox( const Opie::Ui::Internal::OSplitterContainer& ); 00129 void removeFromTab( QWidget* ); 00130 void changeTab(); 00131 void changeHBox(); 00132 void changeVBox(); 00133 void commonChangeBox(); 00134 QHBox *m_hbox; 00135 OTabWidget *m_tabWidget; 00136 OTabWidget *m_parentTab; 00137 Orientation m_orient; 00138 int m_size_policy; 00139 00140 ContainerList m_container; 00141 QList<OSplitter> m_splitter; 00142 00143 QString m_icon, m_name; 00144 00145 struct Private; 00146 Private *d; 00147 }; 00148 } 00149 } 00150 00151 #endif
1.4.2