summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/big-screen') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/obigscreen_p.h9
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp13
-rw-r--r--libopie2/opieui/big-screen/osplitter.h15
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp9
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.h7
5 files changed, 31 insertions, 22 deletions
diff --git a/libopie2/opieui/big-screen/obigscreen_p.h b/libopie2/opieui/big-screen/obigscreen_p.h
index db8fc83..a85a56c 100644
--- a/libopie2/opieui/big-screen/obigscreen_p.h
+++ b/libopie2/opieui/big-screen/obigscreen_p.h
@@ -1,28 +1,31 @@
#ifndef OPIE_BIG_SCREEN_PRIVATE
#define OPIE_BIG_SCREEN_PRIVATE
/* QT */
#include <qstring.h>
class QWidget;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
+namespace Private{
struct OSplitterContainer
{
bool operator==( const OSplitterContainer& o) const
{
if (widget != o.widget ) return false;
if (icon != o.icon ) return false;
if (name != o.name ) return false;
return true;
}
QWidget* widget;
QString icon;
QString name;
};
-};
+}
+}
+}
#endif
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp
index 89f3793..bcfd3a6 100644
--- a/libopie2/opieui/big-screen/osplitter.cpp
+++ b/libopie2/opieui/big-screen/osplitter.cpp
@@ -26,25 +26,26 @@
*/
#include "osplitter.h"
/* OPIE */
#include <opie2/otabwidget.h>
/* QT */
#include <qvaluelist.h>
#include <qvbox.h>
-using namespace Opie;
+using namespace Opie::Ui;
+using namespace Opie::Ui::Private;
/**
*
* This is the constructor of OSplitter
* You might want to call setSizeChange to tell
* OSplitter to change its layout when a specefic
* mark was crossed. OSplitter sets a default value.
*
* You cann add widget with addWidget to the OSplitter.
* OSplitter supports also grouping of Splitters where they
* can share one OTabBar in small screen mode. This can be used
* for email clients like vies but see the example.
@@ -159,25 +160,25 @@ void OSplitter::setSizeChange( int width_height )
*/
void OSplitter::addWidget( OSplitter* split )
{
m_splitter.append( split );
/*
* set tab widget
*/
if (m_tabWidget )
setTabWidget( m_parentTab );
else
{
- Opie::OSplitterContainer con;
+ OSplitterContainer con;
con.widget =split;
addToBox( con );
}
}
/*
* If in a tab it should be removed
* and if in a hbox the reparent kills it too
*/
/**
* This removes the splitter again. You currently need to call this
* before you delete or otherwise you can get mem corruption
@@ -204,25 +205,25 @@ void OSplitter::removeWidget( OSplitter* split)
* @param icon The icon of the possible Tab
* @param label The label of the possible Tab
*/
void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label )
{
#ifdef DEBUG
if (!wid )
{
qWarning("Widget is not valid!");
return;
}
#endif
- Opie::OSplitterContainer cont;
+ OSplitterContainer cont;
cont.widget = wid;
cont.icon =icon;
cont.name = label;
m_container.append( cont );
/*
*
*/
if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) )
setTabWidget( m_parentTab );
else
@@ -387,39 +388,39 @@ void OSplitter::resizeEvent( QResizeEvent* res )
qWarning("Changng to vbox %s", name() );
changeVBox();
mode = false;
}
emit sizeChanged(mode, m_orient );
}
/*
* Adds a container to a tab either the parent tab
* or our own
*/
-void OSplitter::addToTab( const Opie::OSplitterContainer& con )
+void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con )
{
QWidget *wid = con.widget;
// not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) );
if (m_parentTab )
m_parentTab->addTab( wid, con.icon, con.name );
else
m_tabWidget->addTab( wid, con.icon, con.name );
}
/*
* adds a container to the box
*/
-void OSplitter::addToBox( const Opie::OSplitterContainer& con )
+void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con )
{
QWidget* wid = con.widget;
wid->reparent(m_hbox, 0, QPoint(0, 0) );
}
/*
* Removes a widget from the tab
*/
void OSplitter::removeFromTab( QWidget* wid )
{
if (m_parentTab )
@@ -536,25 +537,25 @@ void OSplitter::commonChangeBox()
for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it )
{
/* only if parent tab.. m_tabWidgets gets deleted and would do that as well */
if (m_parentTab )
removeFromTab( (*it).widget );
qWarning("Adding to box %s", (*it).name.latin1() );
addToBox( (*it) );
}
for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() )
{
/* tell them the world had changed */
split->setTabWidget( 0 );
- Opie::OSplitterContainer con;
+ OSplitterContainer con;
con.widget = split;
// con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget)
// : static_cast<QWidget*>(split->m_hbox);
addToBox( con );
}
if (m_parentTab )
m_parentTab->addTab(m_hbox, iconName(), label() );
else
{
diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h
index 2daae7f..7b5ea53 100644
--- a/libopie2/opieui/big-screen/osplitter.h
+++ b/libopie2/opieui/big-screen/osplitter.h
@@ -14,75 +14,75 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-
+
*/
#ifndef OSPLITTER_H
#define OSPLITTER_H
#include "obigscreen_p.h"
/* QT */
#include <qframe.h>
#include <qlist.h>
#include <qstring.h>
#include <qvaluelist.h>
class QHBox;
//template class QValueList<Opie::OSplitterContainer>;
/*
* TODO
* -check API docu
* -one more example
* -allow inserting at a position
*/
-namespace Opie
-{
+namespace Opie{
+namespace Ui {
class OTabWidget;
/**
*
* If you've widgets that could be placed side by side but you think
* on small resolutions is not enough place but it would really make sense
* on bigger resolutions this class will help you.
* You can add as many widgets you want to it. Set a poliy on which width/height it
* should switch the layout.
* You can either say to place widgets vertical or horizontal.
* This class uses QHBox, QVBox and QTAbWidget internally.
* OSplitter takes ownership of the widgets
*
* @since 1.2
*
* @short a small dynamically changing its layout to store two or more widgets side by side
* @version 0.1
* @author zecke
*/
class OSplitter : public QFrame
{
Q_OBJECT
public:
- typedef QValueList<Opie::OSplitterContainer> ContainerList;
+ typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList;
OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0,
const char* name = 0, WFlags fl = 0 );
~OSplitter();
void setLabel( const QString& name );
void setIconName( const QString& name );
QString label()const;
QString iconName()const;
void setSizeChange( int width_height );
void addWidget( OSplitter* splitter );
@@ -115,36 +115,37 @@ signals:
public:
// QSize sizeHint()const;
// QSize minimumSizeHint()const;
protected:
void resizeEvent( QResizeEvent* );
private:
/* true if OTabMode */
bool layoutMode()const;
// void reparentAll();
void setTabWidget( OTabWidget*);
- void addToTab( const Opie::OSplitterContainer& );
- void addToBox( const Opie::OSplitterContainer& );
+ void addToTab( const Opie::Ui::Private::OSplitterContainer& );
+ void addToBox( const Opie::Ui::Private::OSplitterContainer& );
void removeFromTab( QWidget* );
void changeTab();
void changeHBox();
void changeVBox();
void commonChangeBox();
QHBox *m_hbox;
OTabWidget *m_tabWidget;
OTabWidget *m_parentTab;
Orientation m_orient;
int m_size_policy;
ContainerList m_container;
QList<OSplitter> m_splitter;
QString m_icon, m_name;
struct Private;
Private *d;
};
-};
+}
+}
#endif
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index 57e97e3..a0a6355 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
@@ -23,29 +23,29 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "owidgetstack.h"
/* QT */
#include <qapplication.h>
#include <qwidgetstack.h>
-namespace {
+namespace Opie {
+namespace Ui {
const int mode_size = 330;
-}
-using namespace Opie;
+
/**
* This is the standard widget. For simple usage see the example. Normally this widget
* is the central widget of a QMainWindow.
* Use removeWidget before you delete a widget yourself. OWidgetStack does not
* yet recognize removal of children.
*
* @param parent The parent widget. It maybe 0 but then you need to take care of deletion.
* Or you use QPEApplication::showMainWidget().
* @param name Name will be passed on to QObject
* @param fl Additional window flags passed to QFrame. see @Qt::WFlags
*/
@@ -424,12 +424,15 @@ void OWidgetStack::switchTop() {
m_mWidget->reparent(this, 0, frameRect().topLeft() );
m_mWidget->setGeometry( frameRect() );
m_mWidget->show();
}else
/* ### FIXME we need to place the widget better */
it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) );
}
}
delete m_stack;
m_stack = 0;
}
+
+}
+} \ No newline at end of file
diff --git a/libopie2/opieui/big-screen/owidgetstack.h b/libopie2/opieui/big-screen/owidgetstack.h
index 53818c8..d2f9a9f 100644
--- a/libopie2/opieui/big-screen/owidgetstack.h
+++ b/libopie2/opieui/big-screen/owidgetstack.h
@@ -26,26 +26,26 @@
*/
#ifndef OWIDGETSTACK_H
#define OWIDGETSTACK_H
/* QT*/
#include <qframe.h>
#include <qmap.h>
class QWidgetStack;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
/**
*
* OWidgetStack is the answer to the problem of using Opie at different screen
* sizes and to have a different behaviour. Most applications use a QWidgetStack
* to supply a view on click. And by clicking the (X) you go back but this
* behaviour feels strange on bigger screens. It's ok on smaller one because
* one can't determine the difference.
* This stack reads the default out of the size of the desktop widget but
* can be forced to have either the one or the other behaviour.
* The first widget added is considered the 'main' widget and its
* sizeHint will be taking if in BigScreen mode.
* In small screen mode this widget behaves exactly like a QWidgetStack and in BigScreen
@@ -118,15 +118,16 @@ private:
QMap<int, QWidget*> m_list;
QWidgetStack *m_stack;
QWidget *m_mWidget;
QWidget *m_last;
enum Mode m_mode;
bool m_forced : 1;
struct Private;
Private *d;
};
-};
+}
+}
#endif