summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen/osplitter.h
Unidiff
Diffstat (limited to 'libopie2/opieui/big-screen/osplitter.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/osplitter.h150
1 files changed, 150 insertions, 0 deletions
diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h
new file mode 100644
index 0000000..2daae7f
--- a/dev/null
+++ b/libopie2/opieui/big-screen/osplitter.h
@@ -0,0 +1,150 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2003 hOlgAr <zecke@handhelds.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef OSPLITTER_H
30#define OSPLITTER_H
31
32#include "obigscreen_p.h"
33
34/* QT */
35#include <qframe.h>
36#include <qlist.h>
37#include <qstring.h>
38#include <qvaluelist.h>
39
40class QHBox;
41
42//template class QValueList<Opie::OSplitterContainer>;
43
44/*
45 * TODO
46 * -check API docu
47 * -one more example
48 * -allow inserting at a position
49 */
50
51namespace Opie
52{
53class OTabWidget;
54
55/**
56 *
57 * If you've widgets that could be placed side by side but you think
58 * on small resolutions is not enough place but it would really make sense
59 * on bigger resolutions this class will help you.
60 * You can add as many widgets you want to it. Set a poliy on which width/height it
61 * should switch the layout.
62 * You can either say to place widgets vertical or horizontal.
63 * This class uses QHBox, QVBox and QTAbWidget internally.
64 * OSplitter takes ownership of the widgets
65 *
66 * @since 1.2
67 *
68 * @short a small dynamically changing its layout to store two or more widgets side by side
69 * @version 0.1
70 * @author zecke
71 */
72class OSplitter : public QFrame
73{
74 Q_OBJECT
75public:
76 typedef QValueList<Opie::OSplitterContainer> ContainerList;
77 OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0,
78 const char* name = 0, WFlags fl = 0 );
79 ~OSplitter();
80
81 void setLabel( const QString& name );
82 void setIconName( const QString& name );
83 QString label()const;
84 QString iconName()const;
85
86 void setSizeChange( int width_height );
87
88 void addWidget( OSplitter* splitter );
89 void addWidget( QWidget* wid, const QString& icon, const QString& label );
90 void removeWidget( QWidget* );
91 void removeWidget( OSplitter* );
92
93 void setCurrentWidget( QWidget* );
94 void setCurrentWidget( const QString& label );
95 void setCurrentWidget( int );
96 QWidget* currentWidget()const;
97
98
99signals:
100 /**
101 * Emitted if in tab and comes directly from the tab widget
102 *
103 */
104 void currentChanged( QWidget* );
105
106 /**
107 * emitted whenever a border is crossed
108 * true if in small screen mode
109 * false if in bigscreen
110 * this signal is emitted after the layout switch
111 * @param b The layout mode
112 * @param ori The orientation
113 */
114 void sizeChanged( bool b, Orientation ori);
115public:
116 // QSize sizeHint()const;
117 // QSize minimumSizeHint()const;
118
119protected:
120 void resizeEvent( QResizeEvent* );
121
122private:
123 /* true if OTabMode */
124 bool layoutMode()const;
125 // void reparentAll();
126 void setTabWidget( OTabWidget*);
127 void addToTab( const Opie::OSplitterContainer& );
128 void addToBox( const Opie::OSplitterContainer& );
129 void removeFromTab( QWidget* );
130 void changeTab();
131 void changeHBox();
132 void changeVBox();
133 void commonChangeBox();
134 QHBox *m_hbox;
135 OTabWidget *m_tabWidget;
136 OTabWidget *m_parentTab;
137 Orientation m_orient;
138 int m_size_policy;
139
140 ContainerList m_container;
141 QList<OSplitter> m_splitter;
142
143 QString m_icon, m_name;
144
145 struct Private;
146 Private *d;
147};
148};
149
150#endif