Diffstat (limited to 'libopie/big-screen/osplitter.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/big-screen/osplitter.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libopie/big-screen/osplitter.h b/libopie/big-screen/osplitter.h index 05849af..bc4f80b 100644 --- a/libopie/big-screen/osplitter.h +++ b/libopie/big-screen/osplitter.h | |||
@@ -22,80 +22,82 @@ | |||
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef OPIE_SPLITTER_H | 29 | #ifndef OPIE_SPLITTER_H |
30 | #define OPIE_SPLITTER_H | 30 | #define OPIE_SPLITTER_H |
31 | 31 | ||
32 | #include <qstring.h> | 32 | #include <qstring.h> |
33 | 33 | ||
34 | #include <qwidget.h> | 34 | #include <qframe.h> |
35 | #include <qvaluelist.h> | 35 | #include <qvaluelist.h> |
36 | 36 | ||
37 | #include "obigscreen_p.h" | ||
37 | 38 | ||
38 | /* forward declarations */ | 39 | /* forward declarations */ |
39 | class OTabWidget; | 40 | class OTabWidget; |
40 | class QHBox; | 41 | class QHBox; |
41 | struct OSplitterContainer; | 42 | //template class QValueList<Opie::OSplitterContainer>; |
42 | template class QValueList<OSplitterContainer>; | ||
43 | 43 | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * | 46 | * |
47 | * If you've widgets that could be placed side by side but you think | 47 | * If you've widgets that could be placed side by side but you think |
48 | * on small resolutions is not enough place but it would really make sense | 48 | * on small resolutions is not enough place but it would really make sense |
49 | * on bigger resolutions this class will help you. | 49 | * on bigger resolutions this class will help you. |
50 | * You can add as many widgets you want to it. Set a poliy on which width/height it | 50 | * You can add as many widgets you want to it. Set a poliy on which width/height it |
51 | * should switch the layout. | 51 | * should switch the layout. |
52 | * You can either say to place widgets vertical or horizontal. | 52 | * You can either say to place widgets vertical or horizontal. |
53 | * This class uses QHBox, QVBox and QTAbWidget internally. | 53 | * This class uses QHBox, QVBox and QTAbWidget internally. |
54 | * OSplitter takes ownership of the widgets | 54 | * OSplitter takes ownership of the widgets |
55 | * | 55 | * |
56 | * @since 1.2 | 56 | * @since 1.2 |
57 | * | 57 | * |
58 | * @short a small dynamically changing its layout to store two or more widgets side by side | 58 | * @short a small dynamically changing its layout to store two or more widgets side by side |
59 | * @version 0.1 | 59 | * @version 0.1 |
60 | * @author zecke | 60 | * @author zecke |
61 | */ | 61 | */ |
62 | class OSplitter : public QWidget{ | 62 | class OSplitter : public QFrame{ |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | typedef QValueList<OSplitterContainer> ContainerList; | 65 | typedef QValueList<Opie::OSplitterContainer> ContainerList; |
66 | OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, | 66 | OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, |
67 | const char* name = 0, WFlags fl = 0 ); | 67 | const char* name = 0, WFlags fl = 0 ); |
68 | ~OSplitter(); | 68 | ~OSplitter(); |
69 | 69 | ||
70 | void setSizeChange( int width_height ); | 70 | void setSizeChange( int width_height ); |
71 | 71 | ||
72 | void addWidget( QWidget* wid, const QString& icon, const QString& label ); | 72 | void addWidget( QWidget* wid, const QString& icon, const QString& label ); |
73 | void removeWidget( QWidget* ); | 73 | void removeWidget( QWidget* ); |
74 | 74 | ||
75 | void setCurrentWidget( QWidget* ); | 75 | void setCurrentWidget( QWidget* ); |
76 | void setCurrentWidget( const QString& label ); | 76 | void setCurrentWidget( const QString& label ); |
77 | QWidget* currentWidget(); | 77 | QWidget* currentWidget(); |
78 | 78 | ||
79 | QSize sizeHint()const; | 79 | // QSize sizeHint()const; |
80 | 80 | ||
81 | protected: | 81 | protected: |
82 | void resizeEvent( QResizeEvent* ); | 82 | void resizeEvent( QResizeEvent* ); |
83 | 83 | ||
84 | private: | 84 | private: |
85 | void relayout(); | 85 | void addToTab( const Opie::OSplitterContainer& ); |
86 | void addToTab( const OSplitterContainer& ); | 86 | void addToBox( const Opie::OSplitterContainer& ); |
87 | void addToBox( const OSplitterContainer& ); | ||
88 | void removeFromTab( QWidget* ); | 87 | void removeFromTab( QWidget* ); |
89 | void removeFromBox( QWidget* ); | 88 | void changeTab(); |
89 | void changeHBox(); | ||
90 | void changeVBox(); | ||
91 | void commonChangeBox(); | ||
90 | QHBox *m_hbox; | 92 | QHBox *m_hbox; |
91 | OTabWidget *m_tabWidget; | 93 | OTabWidget *m_tabWidget; |
92 | Orientation m_orient; | 94 | Orientation m_orient; |
93 | int m_size_policy; | 95 | int m_size_policy; |
94 | 96 | ||
95 | ContainerList m_container; | 97 | ContainerList m_container; |
96 | 98 | ||
97 | struct Private; | 99 | struct Private; |
98 | Private *d; | 100 | Private *d; |
99 | }; | 101 | }; |
100 | 102 | ||
101 | 103 | ||