156 files changed, 1001 insertions, 337 deletions
diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp index a3f8e10..6712870 100644 --- a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp +++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp @@ -1,8 +1,10 @@ #include <opie2/oapplication.h> #include <opie2/oconfig.h> #include <qpe/config.h> +using namespace Opie::Core; + int main( int argc, char** argv ) { OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" ); diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp index e8bf04f..0b8e1fe 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp @@ -16,8 +16,10 @@ #include <opie2/oapplication.h> #include <opie2/oglobal.h> #include <opie2/oglobalsettings.h> +using namespace Opie::Core; + class DemoApp : public OApplication { Q_OBJECT public: diff --git a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp index 2f5220b..56f1a0b 100644 --- a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp +++ b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp @@ -1,6 +1,8 @@ #include <opie2/oglobalsettings.h> -#include <iostream.h> +#include <iostream> + +using namespace Opie::Core; int main( int argc, char** argv ) { printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() ); diff --git a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp index 0abf53e..2193565 100644 --- a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp +++ b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp @@ -1,6 +1,8 @@ #include <opie2/oprocess.h> -#include <iostream.h> +#include <iostream> + +using namespace Opie::Core; int main( int argc, char** argv ) { printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) ); diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp index 8790cdd..e1a4d5d 100644 --- a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp @@ -1,11 +1,13 @@ #include <qdir.h> #include <qpe/qpeapplication.h> -#include "../osqlmanager.h" -#include "../osqlquery.h" -#include "../osqldriver.h" -#include "../osqlresult.h" +#include <opie2/osqlmanager.h> +#include <opie2/osqlquery.h> +#include <opie2/osqldriver.h> +#include <opie2/osqlresult.h> + +using namespace Opie::DB; int main( int argc, char* argv[] ) { QPEApplication app( argc, argv ); diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.pro b/libopie2/examples/opiedb/sqltest/spaltenweise.pro index f54fada..3cab802 100644 --- a/libopie2/examples/opiedb/sqltest/spaltenweise.pro +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.pro @@ -3,9 +3,9 @@ CONFIG = qt warn_on release HEADERS = SOURCES = spaltenweise.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiesql +LIBS += -lqpe -lopiedb2 TARGET = spaltenweise diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp index e538c9f..2d11ac5 100644 --- a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp @@ -1,11 +1,13 @@ #include <qdir.h> #include <qpe/qpeapplication.h> -#include "../osqlmanager.h" -#include "../osqlquery.h" -#include "../osqldriver.h" -#include "../osqlresult.h" +#include <opie2/osqlmanager.h> +#include <opie2/osqlquery.h> +#include <opie2/osqldriver.h> +#include <opie2/osqlresult.h> + +using namespace Opie::DB; int main( int argc, char* argv[] ) { QPEApplication app( argc, argv ); diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.pro b/libopie2/examples/opiedb/sqltest/zeilenweise.pro index e5cfcc7..6952921 100644 --- a/libopie2/examples/opiedb/sqltest/zeilenweise.pro +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.pro @@ -3,9 +3,9 @@ CONFIG = qt warn_on release HEADERS = SOURCES = zeilenweise.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiesql +LIBS += -lqpe -lopiedb2 TARGET = zeilenweise diff --git a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp index 79bf327..8d421fd 100644 --- a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp +++ b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp @@ -1,6 +1,8 @@ #include <opie2/osoundsystem.h> +using namespace Opie::MM; + int main( int argc, char** argv ) { qDebug( "OPIE Sound System Demo" ); diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp index eb2e8e8..f1966c1 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp @@ -8,8 +8,10 @@ #include <cstdio> #include <cstdlib> #include <cstring> + +using namespace Opie::Net; //======================== Station help class =============================== class Station { diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 4763316..4f8af60 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -3,8 +3,10 @@ #include <opie2/omanufacturerdb.h> #include <unistd.h> +using namespace Opie::Net; + int main( int argc, char** argv ) { qDebug( "OPIE Network Demo" ); diff --git a/libopie2/examples/opieui/olistviewdemo/main.cpp b/libopie2/examples/opieui/olistviewdemo/main.cpp index a93f361..cd49c28 100644 --- a/libopie2/examples/opieui/olistviewdemo/main.cpp +++ b/libopie2/examples/opieui/olistviewdemo/main.cpp @@ -15,8 +15,11 @@ #include "olistviewdemo.h" #include <opie2/oapplication.h> +using namespace Opie::Ui; +using namespace Opie::Core; + int main( int argc, char **argv ) { OApplication a( argc, argv, "OListViewDemo" ); OListViewDemo e; diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp index 5ba7b69..7834b3b 100644 --- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp +++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp @@ -36,8 +36,10 @@ #include <qstring.h> #include <qpixmap.h> #include <qlistview.h> +using namespace Opie::Ui; + OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) :QVBox( parent, name, f ) { lv = new ONamedListView( this ); diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h index 8a5986a..0b5c498 100644 --- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h +++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h @@ -43,9 +43,9 @@ class OListViewDemo: public QVBox OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); virtual ~OListViewDemo(); private: - ONamedListView* lv; + Opie::Ui::ONamedListView* lv; }; #endif diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp b/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp index 7ba0f0d..4a1468d 100644 --- a/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp +++ b/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp @@ -2,16 +2,17 @@ /* OPIE */ #include <opie2/osplitter.h> +#include <opie2/ofileselector.h> #include <qpe/qpeapplication.h> #include <opie2/oapplicationfactory.h> /* QT*/ #include <qdir.h> #include <qlayout.h> -using namespace Opie; +using namespace Opie::Ui; OPIE_EXPORT_APP( OApplicationFactory<OSplitterExample> ) OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f ) diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_example.h b/libopie2/examples/opieui/osplitter_example/osplitter_example.h index 176ad62..0cf28aa 100644 --- a/libopie2/examples/opieui/osplitter_example/osplitter_example.h +++ b/libopie2/examples/opieui/osplitter_example/osplitter_example.h @@ -5,9 +5,8 @@ #ifndef OSPlitter_EXAMPLE_H #define OSPlitter_EXAMPLE_H #include <qvbox.h> -#include <opie2/ofileselector.h> class OSplitterExample : public QWidget { Q_OBJECT public: diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp index 789496c..6443dc0 100644 --- a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp +++ b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp @@ -8,8 +8,10 @@ #include <opie2/oapplicationfactory.h> #include "osplitter_mail.h" +using namespace Opie::Ui; + OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) class Folder { int dummy; @@ -24,15 +26,15 @@ ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) QHBoxLayout *lay = new QHBoxLayout(this); m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); lay->addWidget( m_splitter ); - connect(m_splitter, SIGNAL(sizeChange(bool,const QSize&) ), - this, SLOT(slotSizeChange(bool,const QSize&) ) ); + connect(m_splitter, SIGNAL(sizeChanged(bool,Orientation) ), + this, SLOT(slotSizeChange(bool,Orientation) ) ); m_overview = new QListView( m_splitter ); m_overview->header()->setClickEnabled( FALSE ); m_overview->addColumn( tr("Folder") ); - m_overview->setMaximumWidth( 200 ); +// m_overview->setMaximumWidth( 200 ); m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); m_splitter->setSizeChange( 300 ); /* OSplitter starts with the small mode */ diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_mail.h b/libopie2/examples/opieui/osplitter_example/osplitter_mail.h index 1447a92..67961fb 100644 --- a/libopie2/examples/opieui/osplitter_example/osplitter_mail.h +++ b/libopie2/examples/opieui/osplitter_example/osplitter_mail.h @@ -15,14 +15,12 @@ #include <qlistview.h> #include <opie2/osplitter.h> -using Opie::OSplitter; class Folder; class QLabel; -class OSplitter; class ListViews : public QWidget { Q_OBJECT public: static QString appName() { return QString::fromLatin1("osplitter-mail"); } @@ -38,10 +36,10 @@ private: QLabel *m_message, *m_attach; QList<QListView> m_folders; // used in tab mode QList<Folder> m_lstFolders; bool m_mode : 1; // bitfield - OSplitter *m_splitter; - OSplitter *splitti; + Opie::Ui::OSplitter *m_splitter; + Opie::Ui::OSplitter *splitti; QListView *folder1; #if 0 //private slots: // void slotFolderChanged( QListViewItem* ); diff --git a/libopie2/examples/opieui/oversatileviewdemo/main.cpp b/libopie2/examples/opieui/oversatileviewdemo/main.cpp index d8c01a4..bcda14c 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/main.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/main.cpp @@ -16,8 +16,11 @@ #include "opieuidemo.h" #include <opie2/oapplication.h> +using namespace Opie::Core; +using namespace Opie::Ui; + int main( int argc, char **argv ) { OApplication a( argc, argv, "Opie UI Demo" ); qDebug( "." ); diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp index 0d8bc9f..754a744 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp @@ -24,19 +24,14 @@ #include <qstringlist.h> // Qtopia -#ifdef QWS #include <qpe/qpeapplication.h> #include <qpe/global.h> -#endif // Opie -#ifdef QWS #include <opie2/odevice.h> -using namespace Opie; -#endif #include <opie2/ocompletionbox.h> #include <opie2/olineedit.h> #include <opie2/ocombobox.h> @@ -50,8 +45,11 @@ using namespace Opie; // Local #include "opieuidemo.h" +using namespace Opie::Core; +using namespace Opie::Ui; + enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h index 0519ae6..382885f 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h +++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h @@ -17,9 +17,13 @@ #define OPIEUIDEMO_H #include <qmainwindow.h> +namespace Opie { +namespace Ui { class OVersatileView; +} +} class QTabWidget; class QVBox; class OpieUIDemo : public QMainWindow { @@ -46,9 +50,9 @@ protected: private: QTabWidget* main; - OVersatileView* vv; + Opie::Ui::OVersatileView* vv; }; diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp index 9db4e62..b6d59aa 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp @@ -37,8 +37,10 @@ #include <qstring.h> #include <qpixmap.h> #include <qlistview.h> +using namespace Opie::Ui; + OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) :QVBox( parent, name, f ) { vv = new OVersatileView( this ); diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h index 79318d0..35e2c3c 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h +++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h @@ -33,10 +33,14 @@ #define OVERSATILEVIEWDEMO_H #include <qvbox.h> +namespace Opie { +namespace Ui { class OVersatileView; class OVersatileViewItem; +} +} class OVersatileViewDemo: public QVBox { Q_OBJECT @@ -46,28 +50,28 @@ class OVersatileViewDemo: public QVBox virtual ~OVersatileViewDemo(); public slots: void selectionChanged(); - void selectionChanged( OVersatileViewItem * ); - void currentChanged( OVersatileViewItem * ); - void clicked( OVersatileViewItem * ); - void pressed( OVersatileViewItem * ); + void selectionChanged( Opie::Ui::OVersatileViewItem * ); + void currentChanged( Opie::Ui::OVersatileViewItem * ); + void clicked( Opie::Ui::OVersatileViewItem * ); + void pressed( OPie::Ui::OVersatileViewItem * ); - void doubleClicked( OVersatileViewItem *item ); - void returnPressed( OVersatileViewItem *item ); + void doubleClicked( Opie::Ui::OVersatileViewItem *item ); + void returnPressed( Opie::Ui::OVersatileViewItem *item ); - void onItem( OVersatileViewItem *item ); + void onItem( Opie::Ui::OVersatileViewItem *item ); void onViewport(); - void expanded( OVersatileViewItem *item ); - void collapsed( OVersatileViewItem *item ); + void expanded( Opie::Ui::OVersatileViewItem *item ); + void collapsed( Opie::Ui::OVersatileViewItem *item ); void moved(); - void contextMenuRequested( OVersatileViewItem *item, const QPoint&, int col ); + void contextMenuRequested( Opie::Ui::OVersatileViewItem *item, const QPoint&, int col ); private: - OVersatileView* vv; + Opie::Ui::OVersatileView* vv; }; #endif diff --git a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp index b1c5e70..50cc11b 100644 --- a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp +++ b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp @@ -18,9 +18,9 @@ #include <qlabel.h> #include <qpushbutton.h> #include <qsignalmapper.h> -using namespace Opie; +using namespace Opie::Ui; OPIE_EXPORT_APP( OApplicationFactory<StackExample> ) StackExample::StackExample( QWidget* parent, const char* name, WFlags fl ) diff --git a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h index aea85cb..c9b70cb 100644 --- a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h +++ b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h @@ -7,9 +7,8 @@ #include <qmainwindow.h> #include <opie2/owidgetstack.h> -using namespace Opie; class StackExample : public QMainWindow { Q_OBJECT public: @@ -19,9 +18,9 @@ public: protected: void closeEvent( QCloseEvent* e ); private: - OWidgetStack* m_stack; + Opie::Ui::OWidgetStack* m_stack; QWidget* m_main; }; diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 27b0e53..f3e2cfb 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -59,9 +59,9 @@ _;:, .> :=|. This program is free software; you can #endif const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; -using namespace Opie; +using namespace Opie::Core; ODevice *ODevice::inst() { static ODevice *dev = 0; @@ -80,13 +80,13 @@ ODevice *ODevice::inst() line = s.readLine(); if ( line.startsWith( "Hardware" ) ) { qDebug( "ODevice() - found '%s'", (const char*) line ); - if ( line.contains( "sharp", false ) ) dev = new Zaurus(); - else if ( line.contains( "ipaq", false ) ) dev = new iPAQ(); - else if ( line.contains( "simpad", false ) ) dev = new SIMpad(); - else if ( line.contains( "jornada", false ) ) dev = new Jornada(); - else if ( line.contains( "ramses", false ) ) dev = new Ramses(); + if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); + else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); + else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); + else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); + else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); else qWarning( "ODevice() - unknown hardware - using default." ); break; } } @@ -186,9 +186,9 @@ bool ODevice::suspend() return false; bool res = false; ODevice::sendSuspendmsg(); - + struct timeval tvs, tvn; ::gettimeofday ( &tvs, 0 ); ::sync(); // flush fs caches @@ -623,6 +623,9 @@ void ODevice::virtual_hook(int, void* ){ } void ODevice::sendSuspendmsg() { + if ( isQWS() ) + return; + QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); } diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index bccb449..5ee9cca 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -39,10 +39,11 @@ _;:, .> :=|. This program is free software; you can #include <qobject.h> #include <qstring.h> #include <qstrlist.h> -namespace Opie -{ +namespace Opie{ +namespace Core{ + class ODeviceData; /** * The available devices */ @@ -249,9 +250,9 @@ public: * Returns the available buttons on this device. The number and location * of buttons will vary depending on the device. Button numbers will be assigned * by the device manufacturer and will be from most preferred button to least preffered * button. Note that this list only contains "user mappable" buttons. - * + * * @todo Make method const and take care of calling initButtons or make that const too * */ const QValueList<ODeviceButton> &buttons(); @@ -313,8 +314,9 @@ class ODeviceData { QStrList *m_cpu_frequencies; }; } +} static inline bool isQWS() { return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; @@ -327,6 +329,7 @@ static QCString makeChannel ( const char *str ) else return str; } + #endif diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 8ecea1b..177fd4c 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -52,8 +52,12 @@ #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif + +using namespace Opie::Core; +using namespace Opie::Core::Private; + /* KERNEL */ #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) #define OD_IO(type,number) OD_IOC(0,type,number,0) diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h index f512344..4f4af46 100644 --- a/libopie2/opiecore/device/odevice_ipaq.h +++ b/libopie2/opiecore/device/odevice_ipaq.h @@ -34,9 +34,11 @@ /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class iPAQ : public ODevice, public QWSServer::KeyboardFilter { @@ -80,5 +82,9 @@ struct i_button { char *fheldservice; char *fheldaction; }; +} +} +} + #endif diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 37bd6e9..b79b0b5 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp @@ -76,9 +76,9 @@ typedef struct { #define LED_ON OD_IOW( 'f', 5, LED_IN ) #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) -using namespace Opie; +using namespace Opie::Core::Private; void Jornada::init() { d->m_vendorstr = "HP"; diff --git a/libopie2/opiecore/device/odevice_jornada.h b/libopie2/opiecore/device/odevice_jornada.h index 59be8da..c37d75e 100644 --- a/libopie2/opiecore/device/odevice_jornada.h +++ b/libopie2/opiecore/device/odevice_jornada.h @@ -31,10 +31,11 @@ #define ODEVICE_JORNADA #include <opie2/odevice.h> -using namespace Opie; - +namespace Opie { +namespace Core { +namespace Private { class Jornada : public ODevice { protected: @@ -44,7 +45,9 @@ class Jornada : public ODevice virtual bool setSoftSuspend ( bool soft ); virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution() const; }; - +} +} +} #endif diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp index 5bcf6a9..77de8c5 100644 --- a/libopie2/opiecore/device/odevice_ramses.cpp +++ b/libopie2/opiecore/device/odevice_ramses.cpp @@ -52,8 +52,11 @@ #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif +using namespace Opie::Core; +using namespace Opie::Core::Private; + struct r_button ramses_buttons [] = { { Model_Ramses_MNCI, Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), "devicebuttons/z_menu", diff --git a/libopie2/opiecore/device/odevice_ramses.h b/libopie2/opiecore/device/odevice_ramses.h index 1b660ab..e673b1a 100644 --- a/libopie2/opiecore/device/odevice_ramses.h +++ b/libopie2/opiecore/device/odevice_ramses.h @@ -33,9 +33,11 @@ #include <opie2/odevice.h> /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class Ramses : public ODevice, public QWSServer::KeyboardFilter { protected: @@ -67,6 +69,9 @@ struct r_button { char *fpressedaction; char *fheldservice; char *fheldaction; }; +} +} +} #endif diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 90aca2f..80d40a3 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp @@ -52,9 +52,10 @@ _;:, .> :=|. This program is free software; you can #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct s_button simpad_buttons [] = { { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h index 3287ee8..1848151 100644 --- a/libopie2/opiecore/device/odevice_simpad.h +++ b/libopie2/opiecore/device/odevice_simpad.h @@ -34,9 +34,11 @@ /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class SIMpad : public ODevice, public QWSServer::KeyboardFilter { protected: @@ -77,5 +79,9 @@ struct s_button { char *fheldservice; char *fheldaction; }; +} +} +} + #endif diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index d241db8..f7a4025 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp @@ -52,9 +52,10 @@ _;:, .> :=|. This program is free software; you can #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct yopy_button yopy_buttons [] = { { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), "devicebuttons/yopy_action", diff --git a/libopie2/opiecore/device/odevice_yopy.h b/libopie2/opiecore/device/odevice_yopy.h index be8f62c..7d85479 100644 --- a/libopie2/opiecore/device/odevice_yopy.h +++ b/libopie2/opiecore/device/odevice_yopy.h @@ -31,10 +31,11 @@ _;:, .> :=|. This program is free software; you can #define ODEVICE_YOPY #include <opie2/odevice.h> -using namespace Opie; - +namespace Opie { +namespace Core { +namespace Private { class Yopy : public ODevice { protected: @@ -58,5 +59,9 @@ struct yopy_button char *fheldservice; char *fheldaction; }; +} +} +} + #endif diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 8ab3cbe..0d21f26 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -52,9 +52,10 @@ _;:, .> :=|. This program is free software; you can #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct z_button z_buttons [] = { { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), "devicebuttons/z_calendar", diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index f5c5172..ffb648f 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h @@ -44,10 +44,12 @@ #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class Zaurus : public ODevice { protected: @@ -91,6 +93,8 @@ struct z_button { char *fpressedaction; char *fheldservice; char *fheldaction; }; - +} +} +} #endif diff --git a/libopie2/opiecore/device/odevicebutton.cpp b/libopie2/opiecore/device/odevicebutton.cpp index 0b593d5..a081b7f 100644 --- a/libopie2/opiecore/device/odevicebutton.cpp +++ b/libopie2/opiecore/device/odevicebutton.cpp @@ -32,18 +32,24 @@ #include <qpe/qcopenvelope_qws.h> #include <opie2/odevicebutton.h> -using namespace Opie; + +namespace Opie { +namespace Core { +namespace Private { class OQCopMessageData { public: QCString m_channel; QCString m_message; QByteArray m_data; }; +} +using namespace Opie::Core; +using namespace Opie::Core::Private; OQCopMessage::OQCopMessage() : d ( 0 ) { @@ -123,10 +129,10 @@ void OQCopMessage::setData ( const QByteArray &data ) { d->m_data = data; } -/*! \class Opie::ODeviceButton - \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. +/*! \class Opie::Core::ODeviceButton + \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device. This class represents a physical button on a Qtopia device. A device may have "user programmable" buttons. The location and number of buttons will vary from device to @@ -243,4 +249,7 @@ void ODeviceButton::setFactoryPresetHeldAction(const OQCopMessage& action) void ODeviceButton::setHeldAction(const OQCopMessage& action) { m_HeldAction = action; } + +} +} diff --git a/libopie2/opiecore/device/odevicebutton.h b/libopie2/opiecore/device/odevicebutton.h index a66b88f..4000144 100644 --- a/libopie2/opiecore/device/odevicebutton.h +++ b/libopie2/opiecore/device/odevicebutton.h @@ -22,12 +22,14 @@ #include <qpixmap.h> #include <qstring.h> -class OQCopMessageData; -namespace Opie -{ +namespace Opie{ +namespace Core{ +namespace Private { +class OQCopMessageData; +} class OQCopMessage { public: @@ -51,9 +53,9 @@ public: private: void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); - OQCopMessageData *d; + Private::OQCopMessageData *d; class Private; Private* m_data; }; @@ -103,6 +105,7 @@ class ODeviceButton Private *d; }; } +} #endif diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index d340c0e..e2f6e82 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp @@ -33,20 +33,27 @@ #include <signal.h> #include <stdio.h> +using namespace Opie::Core; + + OApplication* OApplication::_instance = 0; /************************************************************************************************** * OApplicationPrivate **************************************************************************************************/ +namespace Opie { +namespace Core { +namespace Private { class OApplicationPrivate { public: OApplicationPrivate() {}; ~OApplicationPrivate() {}; }; +} /************************************************************************************************** * OApplication **************************************************************************************************/ @@ -83,9 +90,9 @@ OConfig* OApplication::config() void OApplication::init() { - d = new OApplicationPrivate(); + d = new Private::OApplicationPrivate(); if ( !OApplication::_instance ) { OApplication::_instance = this; @@ -124,4 +131,6 @@ void OApplication::setTitle( const QString& title ) const mainWidget()->setCaption( _appname ); } } +} +} diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index cc506a2..c1e32a6 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h @@ -29,15 +29,19 @@ #ifndef OAPPLICATION_H #define OAPPLICATION_H -#define oApp OApplication::oApplication() +#define oApp Opie::Core::OApplication::oApplication() #include <qpe/qpeapplication.h> - +namespace Opie { +namespace Core { +namespace Private { class OApplicationPrivate; +} // private class + class OConfig; class OApplication : public QPEApplication @@ -97,8 +101,11 @@ class OApplication : public QPEApplication private: const QCString _appname; static OApplication* _instance; OConfig* _config; - OApplicationPrivate* d; + Private::OApplicationPrivate* d; }; +} // Core +} // Opie + #endif // OAPPLICATION_H diff --git a/libopie2/opiecore/oconfig.cpp b/libopie2/opiecore/oconfig.cpp index fb5eabb..05d8070 100644 --- a/libopie2/opiecore/oconfig.cpp +++ b/libopie2/opiecore/oconfig.cpp @@ -37,8 +37,10 @@ /* OPIE */ #include <opie2/oconfig.h> +using namespace Opie::Core; + OConfig::OConfig( const QString &name, Domain domain ) :Config( name, domain ) { qDebug( "OConfig::OConfig()" ); diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h index becf70d..29c1f86 100644 --- a/libopie2/opiecore/oconfig.h +++ b/libopie2/opiecore/oconfig.h @@ -39,8 +39,11 @@ class QColor; class QFont; +namespace Opie { +namespace Core { + /** * A Configuration class based on the Qtopia @ref Config class * featuring additional handling of color and font entries */ @@ -61,8 +64,9 @@ class OConfig : public Config virtual ~OConfig(); /** * @returns the name of the current group. * The current group is used for searching keys and accessing entries. + * @todo make const */ const QString& group() { return git.key(); }; /** * @returns a @ref QColor entry or a @a default value if the key is not found. @@ -71,8 +75,12 @@ class OConfig : public Config /** * @returns a @ref QFont value or a @a default value if the key is not found. */ QFont readFontEntry( const QString& key, const QFont* pDefault ) const; + +private: + class Private; + Private *d; }; /** * @brief Helper class for easier use of OConfig groups. @@ -135,7 +143,12 @@ class OConfigGroupSaver QString _oldgroup; OConfigGroupSaver( const OConfigGroupSaver& ); OConfigGroupSaver& operator=( const OConfigGroupSaver& ); + + class Private; + Private *d; }; +} +} #endif // OCONFIG_H diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index a40ef53..cac985b 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp @@ -64,9 +64,10 @@ #ifndef OPIE_NO_BACKTRACE #include <execinfo.h> #endif - +namespace Opie { +namespace Core { /*====================================================================================== * debug levels *======================================================================================*/ @@ -613,8 +614,12 @@ void odClearDebugConfig() oDebug_data->config = 0; */ } + #ifdef OPIE_NO_DEBUG #define odDebug ondDebug #define odBacktrace ondBacktrace #endif + +} +}
\ No newline at end of file diff --git a/libopie2/opiecore/odebug.h b/libopie2/opiecore/odebug.h index 85941fd..a5c9ded 100644 --- a/libopie2/opiecore/odebug.h +++ b/libopie2/opiecore/odebug.h @@ -46,8 +46,11 @@ class QRegion; class QStringList; class QColor; class QBrush; +namespace Opie { +namespace Core { + class odbgstream; class ondbgstream; #ifdef __GNUC__ @@ -393,8 +396,12 @@ class ondbgstream { ondbgstream& operator<<( const QRegion & ) { return *this; } ondbgstream& operator<<( const QStringList & ) { return *this; } ondbgstream& operator<<( const QColor & ) { return *this; } ondbgstream& operator<<( const QBrush & ) { return *this; } + +private: + class Private; + Private *d; }; /*====================================================================================== * related functions @@ -471,4 +478,6 @@ void odClearDebugConfig(); #endif #endif +} +} diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp index 1aa206e..ea02058 100644 --- a/libopie2/opiecore/oglobal.cpp +++ b/libopie2/opiecore/oglobal.cpp @@ -37,8 +37,10 @@ #include <unistd.h> #include <sys/types.h> +using namespace Opie::Core; + static const char Base64EncMap[64] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, @@ -311,9 +313,9 @@ QByteArray OGlobal::decodeBase64( const QByteArray& in) { } bool OGlobal::isAppLnkFileName( const QString& str ) { - if (str.length()==0||str.at(str.length()-1)==QDir::separator()) return false; + if (str.isEmpty()||str.at(str.length()-1)==QDir::separator()) return false; return str.startsWith(MimeType::appsFolderName()+QDir::separator()); } /* ToDo: @@ -322,9 +324,9 @@ bool OGlobal::isAppLnkFileName( const QString& str ) * mounted media name. */ bool OGlobal::isDocumentFileName( const QString& file ) { - if (file.length()==0||file.at(file.length()-1)==QDir::separator()) return false; + if (file.isEmpty()||file.at(file.length()-1)==QDir::separator()) return false; if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true; StorageInfo si; QList< FileSystem > fl = si.fileSystems(); FileSystem*fs; diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index aeee75e..e6a6c46 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h @@ -51,8 +51,13 @@ class QFile; class QString; class DateFormat; + + + +namespace Opie { +namespace Core { /** *\brief OGlobal contains a list of generic functions * * The class OGlobal contains small utility functions @@ -145,7 +150,10 @@ public: private: static OConfig* _config; static OConfig* _qpe_config; + class Private; + Private *d; }; - +} +} #endif // OGLOBAL_H diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp index 192e55b..f34c531 100644 --- a/libopie2/opiecore/oglobalsettings.cpp +++ b/libopie2/opiecore/oglobalsettings.cpp @@ -43,8 +43,11 @@ /* UNIX */ #include <stdlib.h> + +using namespace Opie::Core; + QString* OGlobalSettings::s_desktopPath = 0; QString* OGlobalSettings::s_autostartPath = 0; QString* OGlobalSettings::s_trashPath = 0; QString* OGlobalSettings::s_documentPath = 0; diff --git a/libopie2/opiecore/oglobalsettings.h b/libopie2/opiecore/oglobalsettings.h index e3ac148..8eea709 100644 --- a/libopie2/opiecore/oglobalsettings.h +++ b/libopie2/opiecore/oglobalsettings.h @@ -35,8 +35,11 @@ #include <qstring.h> #include <qcolor.h> #include <qfont.h> +/** + * \todo make real const values + */ #define OPIE_DEFAULT_SINGLECLICK true #define OPIE_DEFAULT_INSERTTEAROFFHANDLES true #define OPIE_DEFAULT_AUTOSELECTDELAY -1 #define OPIE_DEFAULT_CHANGECURSOR true @@ -48,8 +51,11 @@ //FIXME: before public usage... lack of time to do it at once - so it will //FIXME: happen step-by-step. ML. // we should not habe too much configure options!!!!!! -zecke +namespace Opie { +namespace Core { + /** * Access the OPIE global configuration settings. * */ @@ -367,7 +373,13 @@ private: static QColor * OpieAlternate; static QColor * OpieHighlight; friend class OApplication; +private: + class Private; + Private *d; }; +} +} + #endif diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro index 523d6a7..ff3c036 100644 --- a/libopie2/opiecore/opiecore.pro +++ b/libopie2/opiecore/opiecore.pro @@ -8,26 +8,24 @@ HEADERS = oapplication.h \ oglobalsettings.h \ oprocess.h \ oprocctrl.h \ osmartpointer.h \ - ostorageinfo.h \ - xmltree.h + ostorageinfo.h SOURCES = oapplication.cpp \ oconfig.cpp \ odebug.cpp \ oglobal.cpp \ oglobalsettings.cpp \ oprocess.cpp \ oprocctrl.cpp \ - ostorageinfo.cpp \ - xmltree.cc + ostorageinfo.cpp include ( device/device.pro ) INTERFACES = TARGET = opiecore2 -VERSION = 1.8.5 +VERSION = 1.9.0 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include !contains( platform, x11 ) { diff --git a/libopie2/opiecore/oprocctrl.cpp b/libopie2/opiecore/oprocctrl.cpp index 0403526..46708ba 100644 --- a/libopie2/opiecore/oprocctrl.cpp +++ b/libopie2/opiecore/oprocctrl.cpp @@ -40,8 +40,10 @@ #include <qsocketnotifier.h> #include "oprocctrl.h" +using namespace Opie::Core::Private; + OProcessController *OProcessController::theOProcessController = 0; struct sigaction OProcessController::oldChildHandlerData; bool OProcessController::handlerSet = false; diff --git a/libopie2/opiecore/oprocctrl.h b/libopie2/opiecore/oprocctrl.h index 44b8a48..4922ba2 100644 --- a/libopie2/opiecore/oprocctrl.h +++ b/libopie2/opiecore/oprocctrl.h @@ -33,11 +33,16 @@ #include <qtimer.h> #include "oprocess.h" -class OProcessControllerPrivate; class QSocketNotifier; + +namespace Opie { +namespace Core { +namespace Private { +class OProcessControllerPrivate; + /** * @short Used internally by @ref OProcess * @internal * @author Christian Czezakte <e9025461@student.tuwien.ac.at> @@ -114,8 +119,11 @@ private: OProcessControllerPrivate *d; }; +} +} +} #endif diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp index 6349c83..dfde74a 100644 --- a/libopie2/opiecore/oprocess.cpp +++ b/libopie2/opiecore/oprocess.cpp @@ -60,8 +60,13 @@ _;:, .> :=|. This program is free software; you can #ifdef HAVE_INITGROUPS #include <grp.h> #endif +using namespace Opie::Core::Private; + +namespace Opie { +namespace Core { +namespace Private { class OProcessPrivate { public: OProcessPrivate() : useShell( false ) @@ -71,9 +76,9 @@ public: QMap<QString, QString> env; QString wd; QCString shell; }; - +} OProcess::OProcess( QObject *parent, const char *name ) : QObject( parent, name ) { @@ -940,4 +945,7 @@ int OProcess::processPID( const QString& process ) //qDebug( "process '%s' not found", (const char*) process ); return 0; } } + +} +} diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h index 1a2472d..eb56b03 100644 --- a/libopie2/opiecore/oprocess.h +++ b/libopie2/opiecore/oprocess.h @@ -42,9 +42,15 @@ _;:, .> :=|. This program is free software; you can #include <signal.h> #include <unistd.h> class QSocketNotifier; + +namespace Opie { +namespace Core { +namespace Private { +class OProcessController; class OProcessPrivate; +} /** * Child process invocation, monitoring and control. * @@ -396,8 +402,9 @@ public: bool closeStderr(); /** * Lets you see what your arguments are for debugging. + * \todo make const */ const QValueList<QCString> &args() { @@ -715,9 +722,9 @@ protected: /** * @ref OProcessController is a friend of OProcess because it has to have * access to various data members. */ - friend class OProcessController; + friend class Private::OProcessController; private: /** * Searches for a valid shell. @@ -744,9 +751,11 @@ private: OProcess& operator= ( const OProcess& ); private: void init ( ); - OProcessPrivate *d; + Private::OProcessPrivate *d; }; +} +} #endif diff --git a/libopie2/opiecore/osmartpointer.h b/libopie2/opiecore/osmartpointer.h index 9000e71..8f9da7f 100644 --- a/libopie2/opiecore/osmartpointer.h +++ b/libopie2/opiecore/osmartpointer.h @@ -39,8 +39,9 @@ _;:, .> :=|. This program is free software; you can * */ namespace Opie { +namespace Core { //! simple reference counter class class ORefCount { protected: @@ -139,7 +140,8 @@ public: bool operator! () { return (ptr == NULL); } }; } +} #endif diff --git a/libopie2/opiecore/ostorageinfo.cpp b/libopie2/opiecore/ostorageinfo.cpp index aa8d2fc..8fcf5fc 100644 --- a/libopie2/opiecore/ostorageinfo.cpp +++ b/libopie2/opiecore/ostorageinfo.cpp @@ -28,8 +28,10 @@ */ #include <opie2/ostorageinfo.h> +using namespace Opie::Core; + OStorageInfo::OStorageInfo( QObject *parent ) : StorageInfo( parent ) { } diff --git a/libopie2/opiecore/ostorageinfo.h b/libopie2/opiecore/ostorageinfo.h index 740fa85..4e1097f 100644 --- a/libopie2/opiecore/ostorageinfo.h +++ b/libopie2/opiecore/ostorageinfo.h @@ -31,8 +31,11 @@ #define OSTORAGE_H #include <qpe/storage.h> +namespace Opie { +namespace Core { + class OStorageInfo : public StorageInfo { Q_OBJECT @@ -55,8 +58,13 @@ class OStorageInfo : public StorageInfo * @returns the mount path of the MMC (MultiMedia) card * **/ QString mmcPath() const; +private: + class Private; + Private *d; }; +} +} #endif // OSTORAGE_H diff --git a/libopie2/opiedb/TODO b/libopie2/opiedb/TODO index ca04ac6..8b86187 100644 --- a/libopie2/opiedb/TODO +++ b/libopie2/opiedb/TODO @@ -2,8 +2,9 @@ - ROWID - How to declare INTEGER PRIMARY KEY - Abstract from implementation of some dbs - provides( Type::What ) + - emit signals directly on arriving of data * OSQLDriver DriverVersion - DatabaseVersion * Better OSQLQueries - more than OSQLRawQuery
\ No newline at end of file diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro index c773d6c..147435a 100644 --- a/libopie2/opiedb/opiedb.pro +++ b/libopie2/opiedb/opiedb.pro @@ -20,9 +20,9 @@ SOURCES = osqlbackend.cpp \ osqlbackendmanager.cpp \ osqlitedriver.cpp INTERFACES = TARGET = opiedb2 -VERSION = 1.8.2 +VERSION = 1.9.0 INCLUDEPATH = $(OPIEDIR)/include DEPENDPATH = $(OPIEDIR)/include LIBS += -lopiecore2 -lqpe -lsqlite diff --git a/libopie2/opiedb/osqlbackend.cpp b/libopie2/opiedb/osqlbackend.cpp index d6c39a9..6e5159f 100644 --- a/libopie2/opiedb/osqlbackend.cpp +++ b/libopie2/opiedb/osqlbackend.cpp @@ -1,7 +1,9 @@ #include "osqlbackend.h" +using namespace Opie::DB; + OSQLBackEnd::OSQLBackEnd( const QString& name, const QString& vendor, const QString& license, diff --git a/libopie2/opiedb/osqlbackend.h b/libopie2/opiedb/osqlbackend.h index ad879a4..28451b6 100644 --- a/libopie2/opiedb/osqlbackend.h +++ b/libopie2/opiedb/osqlbackend.h @@ -5,8 +5,11 @@ #include <qcstring.h> #include <qstring.h> #include <qvaluelist.h> + +namespace Opie { +namespace DB { /** * OSQLBackEnd represents an available backend * to the Opie Database Service * It's used to easily extend OSQL services by @@ -69,7 +72,12 @@ private: QString m_license; QCString m_lib; bool m_default :1; int m_pref; + class Private; + Private *d; }; +} +} + #endif diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp index 95ed77b..fc18e07 100644 --- a/libopie2/opiedb/osqlbackendmanager.cpp +++ b/libopie2/opiedb/osqlbackendmanager.cpp @@ -2,8 +2,12 @@ #include <qmap.h> #include "osqlbackendmanager.h" +/** + * \todo FIXME CONFIG!!! + */ + namespace { class Config { typedef QMap<QString, QString> List; public: @@ -43,8 +47,12 @@ namespace { QString Config::value( const QString& key ) { return m_list[key]; } }; + + +using namespace Opie::DB; + OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) :m_path( path ) { } diff --git a/libopie2/opiedb/osqlbackendmanager.h b/libopie2/opiedb/osqlbackendmanager.h index bc357a9..00e81fc 100644 --- a/libopie2/opiedb/osqlbackendmanager.h +++ b/libopie2/opiedb/osqlbackendmanager.h @@ -4,8 +4,11 @@ #include <qstringlist.h> #include "osqlbackend.h" +namespace Opie { +namespace DB { + class OSQLBackEndManager { public: OSQLBackEndManager(const QStringList& path ); ~OSQLBackEndManager(); @@ -16,5 +19,8 @@ private: class OSQLBackEndManagerPrivate; OSQLBackEndManagerPrivate* d; QStringList m_path; }; +} +} + #endif diff --git a/libopie2/opiedb/osqldriver.cpp b/libopie2/opiedb/osqldriver.cpp index 258c116..a6dae77 100644 --- a/libopie2/opiedb/osqldriver.cpp +++ b/libopie2/opiedb/osqldriver.cpp @@ -1,8 +1,10 @@ #include <qpe/qlibrary.h> #include "osqldriver.h" +using namespace Opie::DB; + OSQLDriver::OSQLDriver( QLibrary* lib ) : QObject(), m_lib(lib) { } OSQLDriver::~OSQLDriver() { diff --git a/libopie2/opiedb/osqldriver.h b/libopie2/opiedb/osqldriver.h index 68d8ee6..492b8dd 100644 --- a/libopie2/opiedb/osqldriver.h +++ b/libopie2/opiedb/osqldriver.h @@ -6,8 +6,12 @@ #include "osqltable.h" class QLibrary; + +namespace Opie { +namespace DB { + class OSQLResult; class OSQLQuery; class OSQLError; @@ -83,5 +87,8 @@ private: OSQLDriverPrivate *d; }; +} +} + #endif diff --git a/libopie2/opiedb/osqlerror.cpp b/libopie2/opiedb/osqlerror.cpp index 3890a50..165ba65 100644 --- a/libopie2/opiedb/osqlerror.cpp +++ b/libopie2/opiedb/osqlerror.cpp @@ -1,6 +1,8 @@ #include "osqlerror.h" +using namespace Opie::DB; + OSQLError::OSQLError( const QString& driverText, const QString& driverDatabaseText, int type, int subType ) : m_drvText( driverText ), m_drvDBText( driverDatabaseText ), diff --git a/libopie2/opiedb/osqlerror.h b/libopie2/opiedb/osqlerror.h index 35a4368..8fa973d 100644 --- a/libopie2/opiedb/osqlerror.h +++ b/libopie2/opiedb/osqlerror.h @@ -3,8 +3,11 @@ #include <qstring.h> #include <qvaluelist.h> + +namespace Opie { +namespace DB { /** * OSQLError is the base class of all errors */ class OSQLError { @@ -55,5 +58,7 @@ private: class OSQLErrorPrivate; OSQLErrorPrivate* d; }; +} +} #endif diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index 6141504..47bc250 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp @@ -39,8 +39,11 @@ // is replaced by fromLatin1() (eilers) #define __BUGGY_LOCAL8BIT_ +using namespace Opie::DB; +using namespace Opie::DB::Private; + namespace { struct Query { OSQLError::ValueList errors; OSQLResultItem::ValueList items; @@ -85,17 +88,17 @@ void OSQLiteDriver::setOptions( const QStringList& ) { * and options */ bool OSQLiteDriver::open() { char *error; - odebug << "OSQLiteDriver::open: about to open" << oendl; + qDebug("OSQLiteDriver::open: about to open"); m_sqlite = sqlite_open(m_url.local8Bit(), 0, &error ); /* failed to open */ if (m_sqlite == 0l ) { // FIXME set the last error - owarn << "OSQLiteDriver::open: " << error << oendl; + qWarning("OSQLiteDriver::open: %s", error ); free( error ); return false; } return true; @@ -125,9 +128,9 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { query.driver = this; char *err; /* SQLITE_OK 0 if return code > 0 == failure */ if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { - owarn << "OSQLiteDriver::query: Error while executing" << oendl; + qWarning("OSQLiteDriver::query: Error while executing"); free(err ); // FixMe Errors } diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h index 6984539..3e1325b 100644 --- a/libopie2/opiedb/osqlitedriver.h +++ b/libopie2/opiedb/osqlitedriver.h @@ -6,8 +6,12 @@ #include "osqldriver.h" #include "osqlerror.h" #include "osqlresult.h" +namespace Opie { +namespace DB { +namespace Private { + class OSQLiteDriver : public OSQLDriver { Q_OBJECT public: OSQLiteDriver( QLibrary *lib = 0l ); @@ -30,5 +34,9 @@ private: static int call_back( void*, int, char**, char** ); QString m_url; sqlite *m_sqlite; }; +} +} +} + #endif diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp index 766ebe1..990d258 100644 --- a/libopie2/opiedb/osqlmanager.cpp +++ b/libopie2/opiedb/osqlmanager.cpp @@ -4,8 +4,10 @@ #include "osqlmanager.h" #include "osqlbackendmanager.h" #include "osqlitedriver.h" +using namespace Opie::DB; + OSQLManager::OSQLManager() { } OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { m_list.clear(); @@ -30,9 +32,9 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { OSQLDriver* OSQLManager::load( const QString& name ) { OSQLDriver* driver = 0l; if ( name == "SQLite" ) { - driver = new OSQLiteDriver(); + driver = new Opie::DB::Private::OSQLiteDriver; } return driver; } /* @@ -41,9 +43,9 @@ OSQLDriver* OSQLManager::load( const QString& name ) { OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { OSQLDriver *driver = 0l; if ( end.library() == "builtin" && end.name() == "SQLite" ) - driver = new OSQLiteDriver(); + driver = new Opie::DB::Private::OSQLiteDriver; return driver; } /* diff --git a/libopie2/opiedb/osqlmanager.h b/libopie2/opiedb/osqlmanager.h index 5323b14..ca73c64 100644 --- a/libopie2/opiedb/osqlmanager.h +++ b/libopie2/opiedb/osqlmanager.h @@ -7,8 +7,10 @@ #include "osqlbackend.h" +namespace Opie { +namespace DB { /** * OSQLManager is responsible for loading * and unloading, querying different OSQL * services @@ -58,7 +60,11 @@ public: private: OSQLBackEnd::ValueList builtIn()const; OSQLBackEnd::ValueList m_list; QStringList m_path; + class Private; + Private *d; }; +} +} #endif diff --git a/libopie2/opiedb/osqlquery.cpp b/libopie2/opiedb/osqlquery.cpp index ecd53f2..8270c4c 100644 --- a/libopie2/opiedb/osqlquery.cpp +++ b/libopie2/opiedb/osqlquery.cpp @@ -1,7 +1,9 @@ #include "osqlquery.h" +using namespace Opie::DB; + OSQLQuery::OSQLQuery() { } OSQLQuery::~OSQLQuery() { } diff --git a/libopie2/opiedb/osqlquery.h b/libopie2/opiedb/osqlquery.h index 63c26b0..0265d2b 100644 --- a/libopie2/opiedb/osqlquery.h +++ b/libopie2/opiedb/osqlquery.h @@ -6,8 +6,11 @@ #include <qvaluelist.h> #include <qstring.h> +namespace Opie { +namespace DB { + /** I'm not happy with them class OSQLQueryOrder { public: typedef QValueList<OSQLQueryOrder> ValueList; @@ -46,8 +49,11 @@ public: OSQLQuery(); virtual ~OSQLQuery(); virtual QString query()const = 0; +private: + class Private; + Private *d; }; class OSQLRawQuery : public OSQLQuery { public: @@ -118,5 +124,7 @@ public: void setValue( const QMap<QString, QString> &fields ); QString query() const; }; */ +} +} #endif diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp index 42da356..bad7d8b 100644 --- a/libopie2/opiedb/osqlresult.cpp +++ b/libopie2/opiedb/osqlresult.cpp @@ -1,7 +1,9 @@ #include "osqlresult.h" +using namespace Opie::DB; + OSQLResultItem::OSQLResultItem( const TableString& string, const TableInt& Int) : m_string( string ), m_int( Int ) { diff --git a/libopie2/opiedb/osqlresult.h b/libopie2/opiedb/osqlresult.h index 9c9efa2..fc6f01a 100644 --- a/libopie2/opiedb/osqlresult.h +++ b/libopie2/opiedb/osqlresult.h @@ -6,8 +6,12 @@ #include <qvaluelist.h> #include "osqlerror.h" + +namespace Opie { +namespace DB { + /** * ResultItem represents one row of the resulting answer */ class OSQLResultItem { @@ -106,7 +110,11 @@ private: enum State m_state; OSQLResultItem::ValueList m_list; OSQLError::ValueList m_error; OSQLResultItem::ValueList::Iterator it; + class Private; + Private *d; }; +} +} #endif diff --git a/libopie2/opiedb/osqltable.cpp b/libopie2/opiedb/osqltable.cpp index cde40f4..117cf21 100644 --- a/libopie2/opiedb/osqltable.cpp +++ b/libopie2/opiedb/osqltable.cpp @@ -1,6 +1,8 @@ #include "osqltable.h" +using namespace Opie::DB; + OSQLTableItem::OSQLTableItem() {} OSQLTableItem::OSQLTableItem( enum Type type, const QString& field, const QVariant& var) diff --git a/libopie2/opiedb/osqltable.h b/libopie2/opiedb/osqltable.h index 87f7e74..86c30dd 100644 --- a/libopie2/opiedb/osqltable.h +++ b/libopie2/opiedb/osqltable.h @@ -4,8 +4,10 @@ #include <qstring.h> #include <qvaluelist.h> #include <qvariant.h> +namespace Opie { +namespace DB { /** * OSQLTableItem saves one column of a complete * table */ @@ -89,7 +91,12 @@ public: private: QString m_table; OSQLTableItem::ValueList m_list; + class Private; + Private *d; }; +} +} + #endif diff --git a/libopie2/opiemm/opiemm.pro b/libopie2/opiemm/opiemm.pro index d6f54ee..ce30dfb 100644 --- a/libopie2/opiemm/opiemm.pro +++ b/libopie2/opiemm/opiemm.pro @@ -4,9 +4,9 @@ DESTDIR = $(OPIEDIR)/lib HEADERS = osoundsystem.h SOURCES = osoundsystem.cpp INTERFACES = TARGET = opiemm2 -VERSION = 1.8.2 +VERSION = 1.9.0 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include !contains( platform, x11 ) { diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp index 51e088c..07f26c0 100644 --- a/libopie2/opiemm/osoundsystem.cpp +++ b/libopie2/opiemm/osoundsystem.cpp @@ -40,8 +40,10 @@ #include <sys/soundcard.h> #include <sys/stat.h> +using namespace Opie::Core; +using namespace Opie::MM; /*====================================================================================== * OSoundSystem *======================================================================================*/ diff --git a/libopie2/opiemm/osoundsystem.h b/libopie2/opiemm/osoundsystem.h index 096d397..3c3b622 100644 --- a/libopie2/opiemm/osoundsystem.h +++ b/libopie2/opiemm/osoundsystem.h @@ -35,8 +35,11 @@ #include <qobject.h> #include <qdict.h> #include <qmap.h> +namespace Opie { +namespace MM { + class OAudioInterface; class OMixerInterface; class OSoundCard; @@ -89,8 +92,10 @@ class OSoundSystem : public QObject private: static OSoundSystem* _instance; CardMap _interfaces; + class Private; + Private *d; }; /*====================================================================================== @@ -123,8 +128,11 @@ class OSoundCard : public QObject OMixerInterface* _mixer; private: void init(); + private: + class Private; + Private *d; }; /*====================================================================================== * OAudioInterface @@ -149,8 +157,11 @@ class OAudioInterface : public QObject const int _sfd; private: void init(); + private: + class Private; + Private *d; }; /*====================================================================================== @@ -209,8 +220,14 @@ class OMixerInterface : public QObject QMap<QString, int> _channels; private: void init(); + private: + class Private; + Private *d; }; +} +} + #endif // OSOUNDSYSTEM_H diff --git a/libopie2/opienet/802_11_user.h b/libopie2/opienet/802_11_user.h index 7ae27c5..1a9a7a0 100644 --- a/libopie2/opienet/802_11_user.h +++ b/libopie2/opienet/802_11_user.h @@ -454,5 +454,6 @@ struct ctrl_end_ack_t { #define IV_IV(iv) ((iv) & 0xFFFFFF) #define IV_PAD(iv) (((iv) >> 24) & 0x3F) #define IV_KEYID(iv) (((iv) >> 30) & 0x03) + #endif diff --git a/libopie2/opienet/dhcp.h b/libopie2/opienet/dhcp.h index 368e375..6ba4c53 100644 --- a/libopie2/opienet/dhcp.h +++ b/libopie2/opienet/dhcp.h @@ -41,8 +41,9 @@ #ifndef DHCP_H #define DHCP_H + #define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \ 20 + /* IP header */ \ 8) /* UDP header */ #define DHCP_SNAME_LEN 64 @@ -196,6 +197,7 @@ struct dhcp_packet { #define FQDN_DOMAINNAME 7 #define FQDN_FQDN 8 #define FQDN_SUBOPTION_COUNT 8 + #endif diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp index 7e4ab2b..f679afb 100644 --- a/libopie2/opienet/odebugmapper.cpp +++ b/libopie2/opienet/odebugmapper.cpp @@ -6,8 +6,14 @@ #include <opie2/odebug.h> #include "odebugmapper.h" +using namespace Opie::Core; + +namespace Opie { +namespace Net { +namespace Private { + DebugMapper::DebugMapper() { odebug << "DebugMapper::DebugMapper()" << oendl; @@ -211,5 +217,7 @@ const QString& DebugMapper::map( int value ) const return *result; } } - +} +} +} diff --git a/libopie2/opienet/odebugmapper.h b/libopie2/opienet/odebugmapper.h index 66b331d..f47db47 100644 --- a/libopie2/opienet/odebugmapper.h +++ b/libopie2/opienet/odebugmapper.h @@ -8,8 +8,12 @@ #include <qstring.h> #include <qintdict.h> +namespace Opie { +namespace Net { +namespace Private { + typedef QIntDict<QString> IntStringMap; class DebugMapper { @@ -19,8 +23,14 @@ class DebugMapper const QString& map( int value ) const; private: IntStringMap _map; + class Private; + Private *d; }; +} +} +} + #endif diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp index b93b752..209ec94 100644 --- a/libopie2/opienet/omanufacturerdb.cpp +++ b/libopie2/opienet/omanufacturerdb.cpp @@ -42,8 +42,12 @@ #include <qapplication.h> #include <qfile.h> #include <qtextstream.h> +using namespace Opie::Core; +namespace Opie { +namespace Net { + OManufacturerDB* OManufacturerDB::_instance = 0; OManufacturerDB* OManufacturerDB::instance() { @@ -132,4 +136,7 @@ const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); return it == manufacturersExt.end() ? lookup( macaddr ) : *it; } +} +} + diff --git a/libopie2/opienet/omanufacturerdb.h b/libopie2/opienet/omanufacturerdb.h index c2712e5..5c1940e 100644 --- a/libopie2/opienet/omanufacturerdb.h +++ b/libopie2/opienet/omanufacturerdb.h @@ -32,8 +32,11 @@ #define OMANUFACTURERDB_H #include <qmap.h> +namespace Opie { +namespace Net { + /** * @brief A Ethernet card vendor database. * * This class encapsulates the lookup of Ethernet vendor given a @@ -62,8 +65,13 @@ class OManufacturerDB private: QMap<QString, QString> manufacturers; QMap<QString, QString> manufacturersExt; static OManufacturerDB* _instance; + class Private; + Private *d; }; +} +} + #endif diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index 48cfa43..7794334 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp @@ -36,8 +36,11 @@ #include <net/if.h> #include <assert.h> #include <stdio.h> +namespace Opie { +namespace Net { + /*====================================================================================== * OMacAddress *======================================================================================*/ @@ -184,8 +187,11 @@ void OPrivateIOCTL::setParameter( int num, u_int32_t value ) u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name; arglist[num] = value; } + + +namespace Private { /*====================================================================================== * assorted functions *======================================================================================*/ @@ -229,4 +235,7 @@ QString modeToString( int mode ) case IW_MODE_MONITOR: return "monitor"; default: assert( 0 ); } } +} +} +} diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h index bddfab9..ca6815d 100644 --- a/libopie2/opienet/onetutils.h +++ b/libopie2/opienet/onetutils.h @@ -40,8 +40,12 @@ #include <sys/types.h> struct ifreq; + +namespace Opie { +namespace Net { + class OWirelessNetworkInterface; /*====================================================================================== * OMacAddress @@ -71,8 +75,10 @@ class OMacAddress private: unsigned char _bytes[6]; friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); + class Private; + Private *d; }; bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); @@ -87,8 +93,11 @@ class OHostAddress : public QHostAddress /*public: OHostAddress(); ~OHostAddress(); */ + private: + class Private; + Private *d; }; /*====================================================================================== @@ -114,17 +123,23 @@ class OPrivateIOCTL : public QObject u_int32_t _ioctl; u_int16_t _getargs; u_int16_t _setargs; + class Private; + Private *d; }; /*====================================================================================== * Miscellaneous *======================================================================================*/ +namespace Private { void dumpBytes( const unsigned char* data, int num ); QString modeToString( int ); int stringToMode( const QString& ); +} +} +} #define IW_PRIV_TYPE_MASK 0x7000 #define IW_PRIV_TYPE_NONE 0x0000 #define IW_PRIV_TYPE_BYTE 0x1000 diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index e5b091f..ab3e77f 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -56,15 +56,21 @@ #include <stdarg.h>
#ifndef NODEBUG
#include <opie2/odebugmapper.h>
+ + +using namespace Opie::Core; +using namespace Opie::Net::Private; DebugMapper* debugmapper = new DebugMapper();
#endif
/*======================================================================================
* ONetwork
*======================================================================================*/
+namespace Opie { +namespace Net { ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
{
@@ -1236,4 +1242,7 @@ void OOrinocoMonitoringInterface::setEnabled( bool b ) QString OOrinocoMonitoringInterface::name() const
{
return "orinoco";
}
+ +} +} diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 93b129f..a953296 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -55,8 +55,11 @@ #include <qmap.h> #include <qobject.h> #include <qhostaddress.h> +namespace Opie { +namespace Net { + class ONetworkInterface; class OWirelessNetworkInterface; class OChannelHopper; class OMonitoringInterface; @@ -122,8 +125,10 @@ class ONetwork : public QObject private: static ONetwork* _instance; InterfaceMap _interfaces; + class Private; + Private *d; }; /*====================================================================================== @@ -233,8 +238,11 @@ class ONetworkInterface : public QObject struct ifreq& ifr() const; virtual void init(); bool ioctl( int call ) const; bool ioctl( int call, struct ifreq& ) const; + private: + class Private; + Private *d; }; /*====================================================================================== * OChannelHopper @@ -295,8 +303,10 @@ class OChannelHopper : public QObject int _interval; int _tid; QValueList<int> _channels; QValueList<int>::Iterator _channel; + class Private; + Private *d; }; /*====================================================================================== @@ -454,8 +464,10 @@ class OWirelessNetworkInterface : public ONetworkInterface struct iw_range _range; private: OChannelHopper* _hopper; + class Private; + Private *d; }; /*====================================================================================== @@ -478,8 +490,11 @@ class OMonitoringInterface protected: OWirelessNetworkInterface* _if; bool _prismHeader; + private: + class Private; + Private *d; }; @@ -496,8 +511,11 @@ class OCiscoMonitoringInterface : public OMonitoringInterface virtual void setEnabled( bool ); virtual QString name() const; virtual void setChannel( int ); + private: + class Private; + Private *d; }; @@ -515,8 +533,11 @@ class OWlanNGMonitoringInterface : public OMonitoringInterface public: virtual void setEnabled( bool ); virtual QString name() const; virtual void setChannel( int ); + private: + class Private; + Private *d; }; @@ -533,8 +554,12 @@ class OHostAPMonitoringInterface : public OMonitoringInterface public: virtual void setEnabled( bool ); virtual QString name() const; + + private: + class Private; + Private *d; }; /*====================================================================================== @@ -552,8 +577,14 @@ class OOrinocoMonitoringInterface : public OMonitoringInterface virtual void setChannel( int ); virtual void setEnabled( bool ); virtual QString name() const; + private: + class Private; + Private *d; }; +} +} + #endif // ONETWORK_H diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index fdd519c..4081d4f 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -44,8 +44,13 @@ /* LOCAL */ #include "udp_ports.h" +using namespace Opie::Core; + +namespace Opie { +namespace Net { + /*====================================================================================== * OPacket *======================================================================================*/ @@ -1343,5 +1348,6 @@ QString OPacketCapturer::version() const { return QString().sprintf( "%d.%d", pcap_major_version( _pch ), pcap_minor_version( _pch ) ); } - +} +} diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index b873b49..dc609a3 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h @@ -63,10 +63,12 @@ extern "C" // work around a bpf/pcap conflict in recent headers typedef struct timeval timevalstruct; typedef struct pcap_pkthdr packetheaderstruct; /* FORWARDS */ -class OPacketCapturer; class QSocketNotifier; +namespace Opie { +namespace Net { +class OPacketCapturer; /*====================================================================================== * OPacket - A frame on the wire *======================================================================================*/ @@ -140,8 +142,11 @@ class OPacket : public QObject private: const packetheaderstruct _hdr; // pcap packet header const unsigned char* _data; // pcap packet data const unsigned char* _end; // end of pcap packet data + private: + class Private; + Private *d; }; QTextStream& operator<<( QTextStream& s, const OPacket& p ); @@ -162,8 +167,11 @@ class OEthernetPacket : public QObject int type() const; private: const struct ether_header* _ether; + private: + class Private; + Private *d; }; /*====================================================================================== * OPrismHeaderPacket - DLT_PRISM_HEADER frame @@ -180,8 +188,10 @@ class OPrismHeaderPacket : public QObject unsigned int signalStrength() const; private: const struct prism_hdr* _header; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanPacket - DLT_IEEE802_11 frame @@ -209,8 +219,10 @@ class OWaveLanPacket : public QObject bool usesWep() const; private: const struct ieee_802_11_header* _wlanhdr; + class Private; + Private *d; }; /*====================================================================================== @@ -238,8 +250,10 @@ class OWaveLanManagementPacket : public QObject private: const struct ieee_802_11_mgmt_header* _header; const struct ieee_802_11_mgmt_body* _body; + class Private; + Private *d; }; /*====================================================================================== @@ -257,8 +271,10 @@ class OWaveLanManagementSSID : public QObject QString ID( bool decloak = false ) const; private: const struct ssid_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementRates @@ -273,8 +289,10 @@ class OWaveLanManagementRates : public QObject virtual ~OWaveLanManagementRates(); private: const struct rates_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementCF @@ -289,8 +307,10 @@ class OWaveLanManagementCF : public QObject virtual ~OWaveLanManagementCF(); private: const struct cf_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementFH @@ -305,8 +325,10 @@ class OWaveLanManagementFH : public QObject virtual ~OWaveLanManagementFH(); private: const struct fh_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementDS @@ -323,8 +345,10 @@ class OWaveLanManagementDS : public QObject int channel() const; private: const struct ds_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementTim @@ -339,8 +363,10 @@ class OWaveLanManagementTim : public QObject virtual ~OWaveLanManagementTim(); private: const struct tim_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementIBSS @@ -355,8 +381,10 @@ class OWaveLanManagementIBSS : public QObject virtual ~OWaveLanManagementIBSS(); private: const struct ibss_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementChallenge @@ -371,8 +399,10 @@ class OWaveLanManagementChallenge : public QObject virtual ~OWaveLanManagementChallenge(); private: const struct challenge_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanDataPacket - type: data (T_DATA) @@ -387,8 +417,10 @@ class OWaveLanDataPacket : public QObject virtual ~OWaveLanDataPacket(); private: const struct ieee_802_11_data_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanControlPacket - type: control (T_CTRL) @@ -405,8 +437,10 @@ class OWaveLanControlPacket : public QObject QString controlType() const; private: const struct ieee_802_11_control_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OLLCPacket - IEEE 802.2 Link Level Control @@ -421,8 +455,10 @@ class OLLCPacket : public QObject virtual ~OLLCPacket(); private: const struct ieee_802_11_802_2_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OIPPacket @@ -448,8 +484,10 @@ class OIPPacket : public QObject int checksum() const; private: const struct iphdr* _iphdr; + class Private; + Private *d; }; /*====================================================================================== * OARPPacket @@ -472,8 +510,10 @@ class OARPPacket : public QObject QString type() const; private: const struct myarphdr* _arphdr; + class Private; + Private *d; }; /*====================================================================================== * OUDPPacket @@ -493,8 +533,10 @@ class OUDPPacket : public QObject int checksum() const; private: const struct udphdr* _udphdr; + class Private; + Private *d; }; /*====================================================================================== * ODHCPPacket @@ -521,8 +563,10 @@ class ODHCPPacket : public QObject private: const struct dhcp_packet* _dhcphdr; unsigned char _type; + class Private; + Private *d; }; /*====================================================================================== * OTCPPacket @@ -544,8 +588,10 @@ class OTCPPacket : public QObject int checksum() const; private: const struct tcphdr* _tcphdr; + class Private; + Private *d; }; /*====================================================================================== @@ -664,8 +710,12 @@ class OPacketCapturer : public QObject pcap_dumper_t* _pcd; // pcap dumper handle QSocketNotifier* _sn; // socket notifier for main loop mutable char _errbuf[PCAP_ERRBUF_SIZE]; // holds error strings from libpcap QMap<QString, int> _stats; // statistics; + class Private; // Private Forward declaration + Private *d; // if we need to add data }; +} +} #endif // OPCAP_H diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp index 8c989d8..140b924 100644 --- a/libopie2/opienet/ostation.cpp +++ b/libopie2/opienet/ostation.cpp @@ -30,8 +30,13 @@ #include <opie2/ostation.h> #include <opie2/odebug.h> + +using namespace Opie::Core; + +namespace Opie { +namespace Net { /*====================================================================================== * OStation *======================================================================================*/ @@ -61,4 +66,7 @@ void OStation::dump() qDebug( "mac: %s", (const char*) macAddress.toString() ); qDebug( "ap: %s", (const char*) apAddress.toString() ); qDebug( "ip: %s", (const char*) ipAddress.toString() ); } + +} +}
\ No newline at end of file diff --git a/libopie2/opienet/ostation.h b/libopie2/opienet/ostation.h index 1e7366d..68f1114 100644 --- a/libopie2/opienet/ostation.h +++ b/libopie2/opienet/ostation.h @@ -39,10 +39,14 @@ #include <qobject.h> #include <sys/types.h> +namespace Opie { +namespace Net { + class OStation; + typedef QList<OStation> OStationList; /*====================================================================================== * OStation @@ -65,9 +69,14 @@ class OStation QString ssid; OMacAddress apAddress; int channel; bool encrypted; + private: + class Private; + Private *d; }; +} +} #endif // OSTATION_H diff --git a/libopie2/opiepim/backend/backends.pro b/libopie2/opiepim/backend/backends.pro index 4231a00..d4867ba 100644 --- a/libopie2/opiepim/backend/backends.pro +++ b/libopie2/opiepim/backend/backends.pro @@ -9,9 +9,10 @@ SOURCES += core/backends/ocontactaccessbackend_sql.cpp \ core/backends/otodoaccesssql.cpp \ core/backends/otodoaccessvcal.cpp \ core/backends/otodoaccessxml.cpp \ core/backends/odatebookaccess.cpp \ - core/backends/odatebookaccessbackend_sql.cpp + core/backends/odatebookaccessbackend_sql.cpp \ + core/backends/private/xmltree.cc HEADERS += core/backends/obackendfactory.h \ core/backends/ocontactaccessbackend.h \ core/backends/ocontactaccessbackend_sql.h \ @@ -27,5 +28,6 @@ HEADERS += core/backends/obackendfactory.h \ core/backends/otodoaccess.h \ core/backends/otodoaccesssql.h \ core/backends/otodoaccessvcal.h \ core/backends/otodoaccessxml.h \ - core/backends/odatebookaccess.h + core/backends/odatebookaccess.h \ + core/backends/private/xmltree.h diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index f121cc2..d16d692 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp @@ -45,9 +45,9 @@ #include <opie2/osqlresult.h> #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> - +using namespace Opie::DB; // If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead // vertical like "uid, type, value". diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h index 58ae2ae..ba122ec 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h @@ -39,11 +39,15 @@ #include <qlist.h> #include <qdict.h> /* aren't in namespace Opie yet - alwin */ +namespace Opie { +namespace DB { class OSQLDriver; class OSQLResult; class OSQLResultItem; +} +} namespace Opie { /* the default xml implementation */ @@ -90,9 +94,9 @@ class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { bool remove ( int uid ); bool reload(); private: - QArray<int> extractUids( OSQLResult& res ) const; + QArray<int> extractUids( Opie::DB::OSQLResult& res ) const; QMap<int, QString> requestNonCustom( int uid ) const; QMap<QString, QString> requestCustom( int uid ) const; void update(); @@ -100,9 +104,9 @@ class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { bool m_changed; QString m_fileName; QArray<int> m_uids; - OSQLDriver* m_driver; + Opie::DB::OSQLDriver* m_driver; }; } diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 5d92b8f..f5e76d5 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp @@ -40,16 +40,17 @@ #include <qmap.h> #include <qpe/global.h> -#include <opie2/xmltree.h> +#include "private/xmltree.h" #include <opie2/ocontactaccessbackend.h> #include <opie2/ocontactaccess.h> #include <stdlib.h> #include <errno.h> using namespace Opie; +using namespace Opie::Pim::Private; namespace Opie { OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 2ee76cc..a779dc1 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp @@ -45,8 +45,10 @@ #include <opie2/opimrecurrence.h> #include <opie2/odatebookaccessbackend_sql.h> +using namespace Opie::DB; + namespace Opie { ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL( const QString& , diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h index cbfeb97..60d7f21 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h @@ -33,9 +33,13 @@ #include <opie2/osqlresult.h> #include <opie2/odatebookaccessbackend.h> +namespace Opie { +namespace DB { class OSQLDriver; +} +} namespace Opie { /** * This is the default SQL implementation for DateBoook SQL storage @@ -76,16 +80,16 @@ private: QMap<int, QString> m_fieldMap; QMap<QString, int> m_reverseFieldMap; - OSQLDriver* m_driver; + Opie::DB::OSQLDriver* m_driver; class Private; Private *d; void initFields(); void update(); - QArray<int> extractUids( OSQLResult& res ) const; + QArray<int> extractUids( Opie::DB::OSQLResult& res ) const; }; } diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 72232e5..d218090 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp @@ -40,8 +40,10 @@ #include <opie2/opimstate.h> #include <opie2/opimnotifymanager.h> #include <opie2/opimrecurrence.h> +using namespace Opie::DB; + using namespace Opie; /* * first some query * CREATE query diff --git a/libopie2/opiepim/backend/otodoaccesssql.h b/libopie2/opiepim/backend/otodoaccesssql.h index e945863..0ae2591 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.h +++ b/libopie2/opiepim/backend/otodoaccesssql.h @@ -32,11 +32,15 @@ #include <qasciidict.h> #include <opie2/otodoaccessbackend.h> +namespace Opie { +namespace DB { class OSQLDriver; class OSQLResult; class OSQLResultItem; +} +} namespace Opie { class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { @@ -70,16 +74,16 @@ public: private: void update()const; void fillDict(); inline bool date( QDate& date, const QString& )const; - inline OPimTodo todo( const OSQLResult& )const; - inline OPimTodo todo( OSQLResultItem& )const; - inline QArray<int> uids( const OSQLResult& )const; + inline OPimTodo todo( const Opie::DB::OSQLResult& )const; + inline OPimTodo todo( Opie::DB::OSQLResultItem& )const; + inline QArray<int> uids( const Opie::DB::OSQLResult& )const; OPimTodo todo( int uid )const; QBitArray sup() const; QAsciiDict<int> m_dict; - OSQLDriver* m_driver; + Opie::DB::OSQLDriver* m_driver; QArray<int> m_uids; bool m_dirty : 1; }; diff --git a/libopie2/opiecore/xmltree.cc b/libopie2/opiepim/core/backends/private/xmltree.cc index 059791b..40749ca 100644 --- a/libopie2/opiecore/xmltree.cc +++ b/libopie2/opiepim/core/backends/private/xmltree.cc @@ -16,17 +16,17 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <opie2/xmltree.h> +#include "xmltree.h" #include <qpe/stringutil.h> #include <qxml.h> #include <assert.h> -using namespace Opie; +using namespace Opie::Pim::Private; XMLElement::XMLElement() : m_parent( 0 ), m_next( 0 ), m_prev( 0 ), m_first( 0 ), m_last( 0 ) { diff --git a/libopie2/opiecore/xmltree.h b/libopie2/opiepim/core/backends/private/xmltree.h index 4b6bdfa..9817a02 100644 --- a/libopie2/opiecore/xmltree.h +++ b/libopie2/opiepim/core/backends/private/xmltree.h @@ -24,10 +24,11 @@ #include <qstring.h> #include <qmap.h> #include <qtextstream.h> -namespace Opie -{ +namespace Opie { +namespace Pim { +namespace Private{ /** * A small xml lib written by Simon Hausmann. */ @@ -113,7 +114,9 @@ private: class Private; Private* d; }; +} +} } // namespace Opie #endif 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 @@ -5,10 +5,11 @@ #include <qstring.h> class QWidget; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private{ struct OSplitterContainer { bool operator==( const OSplitterContainer& o) const @@ -22,7 +23,9 @@ struct OSplitterContainer 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 @@ -34,9 +34,10 @@ /* 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 @@ -167,9 +168,9 @@ void OSplitter::addWidget( OSplitter* split ) if (m_tabWidget ) setTabWidget( m_parentTab ); else { - Opie::OSplitterContainer con; + OSplitterContainer con; con.widget =split; addToBox( con ); } } @@ -212,9 +213,9 @@ void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& lab qWarning("Widget is not valid!"); return; } #endif - Opie::OSplitterContainer cont; + OSplitterContainer cont; cont.widget = wid; cont.icon =icon; cont.name = label; @@ -395,9 +396,9 @@ void OSplitter::resizeEvent( QResizeEvent* res ) /* * 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 ) @@ -409,9 +410,9 @@ void OSplitter::addToTab( const Opie::OSplitterContainer& con ) /* * 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) ); } @@ -544,9 +545,9 @@ void OSplitter::commonChangeBox() 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 ); 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 @@ -22,9 +22,9 @@ -- :-=` 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 @@ -47,10 +47,10 @@ class QHBox; * -one more example * -allow inserting at a position */ -namespace Opie -{ +namespace Opie{ +namespace Ui { class OTabWidget; /** * @@ -72,9 +72,9 @@ class OTabWidget; 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(); @@ -123,10 +123,10 @@ 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(); @@ -144,7 +144,8 @@ private: 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 @@ -31,13 +31,13 @@ /* 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. @@ -432,4 +432,7 @@ void OWidgetStack::switchTop() { 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 @@ -34,10 +34,10 @@ #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 @@ -126,7 +126,8 @@ private: struct Private; Private *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp index e7daead..beb4d6c 100644 --- a/libopie2/opieui/fileselector/ofiledialog.cpp +++ b/libopie2/opieui/fileselector/ofiledialog.cpp @@ -38,9 +38,9 @@ #include <qstring.h> #include <qapplication.h> #include <qlayout.h> -using namespace Opie; +using namespace Opie::Ui; namespace { /* diff --git a/libopie2/opieui/fileselector/ofiledialog.h b/libopie2/opieui/fileselector/ofiledialog.h index 01a599b..dfecf3d 100644 --- a/libopie2/opieui/fileselector/ofiledialog.h +++ b/libopie2/opieui/fileselector/ofiledialog.h @@ -34,10 +34,10 @@ /* QT */ #include <qdialog.h> -namespace Opie -{ +namespace Opie { +namespace Ui { /** * This class places a OFileSelector inside a QDialog. * It provides static method for letting a user chose @@ -103,7 +103,8 @@ private slots: void slotDirSelected(const QString & ); void slotSelectorOk(); }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 15cadd4..c4d5033 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp @@ -54,10 +54,13 @@ #include <qwidgetstack.h> #include <qregexp.h> #include <qobjectlist.h> -using namespace Opie; +using namespace Opie::Ui::Private; +namespace Opie { +namespace Ui { +namespace Private { OFileViewInterface::OFileViewInterface( OFileSelector* selector ) : m_selector( selector ) {} @@ -809,8 +812,10 @@ void OFileViewFileSystem::activate( const QString& str) { m_all = (str != QObject::tr("Files") ); } + +} /* Selector */ /** * @short new and complete c'tor * @@ -1163,4 +1168,6 @@ void OFileSelector::setNameVisible( bool b ) else m_nameBox->hide(); } +} +} diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index 7fa657b..2205963 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h @@ -51,13 +51,15 @@ class QWidgetStack; class QHBox; typedef QMap<QString, QStringList> MimeTypes; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { class OFileViewInterface; class OFileViewFileListView; +} /** * @short a dropin replacement for the FileSelector @@ -72,10 +74,10 @@ class OFileViewFileListView; */ class OFileSelector : public QWidget { Q_OBJECT - friend class Opie::OFileViewInterface; - friend class Opie::OFileViewFileListView; + friend class Private::OFileViewInterface; + friend class Private::OFileViewFileListView; public: /** * The Mode of the Fileselector @@ -184,15 +186,15 @@ private: private: QLineEdit* m_lneEdit; // the LineEdit for the Name QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType QWidgetStack* m_stack; // our widget stack which will contain the views - OFileViewInterface* currentView() const; // returns the currentView - OFileViewInterface* m_current; // here is the view saved + Private::OFileViewInterface* currentView() const; // returns the currentView + Private::OFileViewInterface* m_current; // here is the view saved bool m_shNew : 1; // should we show New? bool m_shClose : 1; // should we show Close? MimeTypes m_mimeType; // list of mimetypes - QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr + QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr QHBox* m_nameBox; // the LineEdit + Label is hold here QHBox* m_cmbBox; // this holds the two combo boxes QString m_startDir; @@ -213,7 +215,8 @@ private slots: bool eventFilter (QObject *o, QEvent *e); }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h index 818ced9..376dc98 100644 --- a/libopie2/opieui/fileselector/ofileselector_p.h +++ b/libopie2/opieui/fileselector/ofileselector_p.h @@ -55,12 +55,12 @@ typedef QMap<QString, QStringList> MimeTypes; /* the View Interface */ class QFileInfo; class QToolButton; -namespace Opie -{ - +namespace Opie{ +namespace Ui{ class OFileSelector; +namespace Private { class OFileViewInterface { public: @@ -185,7 +185,9 @@ private: private: QListView* m_view; }; -}; +} +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileview.h b/libopie2/opieui/fileselector/ofileview.h index 495401b..aaf56b1 100644 --- a/libopie2/opieui/fileselector/ofileview.h +++ b/libopie2/opieui/fileselector/ofileview.h @@ -36,10 +36,11 @@ class QFileInfo; class QDir; class DocLnk; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { /** * A OFileView is a specialised View for the * OFileSelector @@ -89,7 +90,9 @@ public: OFileView* newView(QWidget *parent, const char *name ); QString name()const; }; -}; +} +} +} #endif diff --git a/libopie2/opieui/oclickablelabel.cpp b/libopie2/opieui/oclickablelabel.cpp index 4c4e581..53cb77a 100644 --- a/libopie2/opieui/oclickablelabel.cpp +++ b/libopie2/opieui/oclickablelabel.cpp @@ -28,9 +28,9 @@ */ #include <opie2/oclickablelabel.h> -using namespace Opie; +using namespace Opie::Ui; /** * This constructs the clickable ButtonLabel * diff --git a/libopie2/opieui/oclickablelabel.h b/libopie2/opieui/oclickablelabel.h index b224d61..90859a0 100644 --- a/libopie2/opieui/oclickablelabel.h +++ b/libopie2/opieui/oclickablelabel.h @@ -32,10 +32,10 @@ /* QT */ #include <qlabel.h> -namespace Opie -{ +namespace Opie{ +namespace Ui { /** * This class is a special QLabel which can behave * as a QPushButton or QToggleButton. @@ -97,7 +97,8 @@ private: class Private; Private *d; // private d pointer }; -}; +} +} #endif diff --git a/libopie2/opieui/odialog.cpp b/libopie2/opieui/odialog.cpp index 4d269d4..27f8d20 100644 --- a/libopie2/opieui/odialog.cpp +++ b/libopie2/opieui/odialog.cpp @@ -31,8 +31,10 @@ #include <opie2/odialog.h> #warning Make Margin and Spacing device dependend and configurable! +using namespace Opie::Ui; + int ODialog::mMarginSize = 5; int ODialog::mSpacingSize = 2; ODialog::ODialog(QWidget *parent, const char *name, bool modal, WFlags f) diff --git a/libopie2/opieui/odialog.h b/libopie2/opieui/odialog.h index ceff612..57f534c 100644 --- a/libopie2/opieui/odialog.h +++ b/libopie2/opieui/odialog.h @@ -54,8 +54,11 @@ class QLayoutItem; // lets fix up Qt instead! Size does matter. -zecke // while that may be true, reducing maintainance effort for the future does also matter - // and I believe that maintaining a patch against QtE is more work than our classes -mml +namespace Opie { +namespace Ui { + class ODialog : public QDialog { Q_OBJECT @@ -87,5 +90,7 @@ class ODialog : public QDialog class ODialogPrivate; ODialogPrivate *d; }; +} +} #endif // ODIALOG_H diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index f93781f..b19c26e 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp @@ -37,12 +37,12 @@ #include <qcombobox.h> #include <qlabel.h> #include <qmultilineedit.h> -using namespace Opie; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { class OFontSelectorPrivate { public: @@ -55,13 +55,8 @@ public: FontDatabase m_fdb; }; -}; - -namespace -{ - class FontListItem : public QListBoxText { public: FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() @@ -94,9 +89,15 @@ private: QStringList m_styles; QValueList<int> m_sizes; QString m_name; }; +} +} +} + +using namespace Opie::Ui; +using namespace Opie::Ui::Private; static int findItemCB( QComboBox *box, const QString &str ) { for ( int i = 0; i < box->count(); i++ ) @@ -106,9 +107,8 @@ static int findItemCB( QComboBox *box, const QString &str ) } return -1; } -} /* static same as anon. namespace */ static int qt_version() { const char *qver = qVersion(); @@ -425,4 +425,5 @@ void OFontSelector::resizeEvent ( QResizeEvent *re ) if ( d->m_preview ) d->m_preview->setFixedHeight ( d->m_preview->height()); } + diff --git a/libopie2/opieui/ofontselector.h b/libopie2/opieui/ofontselector.h index ad51819..1d97233 100644 --- a/libopie2/opieui/ofontselector.h +++ b/libopie2/opieui/ofontselector.h @@ -34,12 +34,13 @@ #include <qwidget.h> class QListBox; -namespace Opie -{ - +namespace Opie { +namespace Ui { +namespace Private { class OFontSelectorPrivate; +} /** * This class lets you chose a Font out of a list of Fonts. * It can show a preview too. This selector will use all available @@ -94,11 +95,12 @@ private: void changeFont ( ); private: - OFontSelectorPrivate *d; + Private::OFontSelectorPrivate *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 9a58bb9..be47eb2 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp @@ -40,8 +40,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MaxRGB 255L #define DegreesToRadians(x) ((x)*M_PI/180.0) using namespace std; +using namespace Opie::Core; + +namespace Opie { +namespace Ui { inline unsigned int intensityValue(unsigned int color) { return((unsigned int)((0.299*qRed(color) + @@ -3764,5 +3768,6 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen) } - +} +} diff --git a/libopie2/opieui/oimageeffect.h b/libopie2/opieui/oimageeffect.h index fb4d22d..4f86d5b 100644 --- a/libopie2/opieui/oimageeffect.h +++ b/libopie2/opieui/oimageeffect.h @@ -38,8 +38,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. class QImage; class QSize; class QColor; +namespace Opie { +namespace Ui { /** * This class includes various @ref QImage based graphical effects. * * Everything is @@ -555,5 +557,8 @@ private: static unsigned int interpolateColor(QImage *image, double x, double y, unsigned int background); }; +} +} + #endif diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 0ee2fde..38670b4 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp @@ -35,8 +35,13 @@ #include <opie2/odebug.h> #include <opie2/olistview.h> +using namespace Opie::Core; + + +namespace Opie { +namespace Ui { /*====================================================================================== * OListView *======================================================================================*/ @@ -754,4 +759,6 @@ ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QStri else return 0; } +} +} diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 59b0973..8195a62 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h @@ -35,8 +35,11 @@ #include <qpen.h> #include <qdatastream.h> #include <qstringlist.h> + +namespace Opie { +namespace Ui { class OListViewItem; /*====================================================================================== @@ -53,8 +56,9 @@ class OListViewItem; * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class OListView: public QListView { + Q_OBJECT public: /** * Constructor. * @@ -138,10 +142,12 @@ class OListView: public QListView void expand(QListViewItem*); private: QColor m_alternateBackground; - bool m_fullWidth; + bool m_fullWidth : 1; QPen m_columnSeparator; + class Private; + Private *d; }; #ifndef QT_NO_DATASTREAM /** @@ -241,10 +247,12 @@ class OListViewItem: public QListViewItem */ virtual void expand(){}; private: - bool m_known; - bool m_odd; + bool m_known : 1; + bool m_odd : 1; + class Private; + Private *d; }; #ifndef QT_NO_DATASTREAM /** @@ -353,8 +361,11 @@ class ONamedListView: public OListView virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; + private: + class Private; + Private *d; }; /*====================================================================================== * ONamedListViewItem @@ -402,8 +413,14 @@ class ONamedListViewItem: public OListViewItem * @sa ONamedListView::find() */ virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; -}; + private: + class Private; + Private *d; + +}; +} +} #endif // OLISTVIEW_H diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 1be8db5..e895edc 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro @@ -5,13 +5,11 @@ HEADERS = oclickablelabel.h \ odialog.h \ ofontselector.h \ oimageeffect.h \ olistview.h \ - omessagebox.h \ opixmapeffect.h \ opopupmenu.h \ opixmapprovider.h \ - oresource.h \ oselector.h \ oseparator.h \ otabinfo.h \ otabbar.h \ @@ -30,9 +28,8 @@ SOURCES = oclickablelabel.cpp \ olistview.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ opixmapprovider.cpp \ - oresource.cpp \ oselector.cpp \ oseparator.cpp \ otabbar.cpp \ otabwidget.cpp \ diff --git a/libopie2/opieui/opixmapeffect.cpp b/libopie2/opieui/opixmapeffect.cpp index 05f851d..794c7b2 100644 --- a/libopie2/opieui/opixmapeffect.cpp +++ b/libopie2/opieui/opixmapeffect.cpp @@ -16,8 +16,10 @@ #include <opie2/opixmapeffect.h> #include <opie2/oimageeffect.h> + +using namespace Opie::Ui; //====================================================================== // // Gradient effects // diff --git a/libopie2/opieui/opixmapeffect.h b/libopie2/opieui/opixmapeffect.h index 283fe2d..b780f9f 100644 --- a/libopie2/opieui/opixmapeffect.h +++ b/libopie2/opieui/opixmapeffect.h @@ -14,8 +14,11 @@ #include <qsize.h> typedef QPixmap OPixmap; class QColor; + +namespace Opie { +namespace Ui { /** * This class includes various pixmap-based graphical effects. * * Everything is @@ -209,7 +212,8 @@ public: * @param col the selected color, usually from QColorGroup::highlight(). */ static OPixmap selectedPixmap( const OPixmap &pixmap, const QColor &col ); }; - +} +} #endif diff --git a/libopie2/opieui/opixmapprovider.cpp b/libopie2/opieui/opixmapprovider.cpp index 7be9e3b..7eb67a2 100644 --- a/libopie2/opieui/opixmapprovider.cpp +++ b/libopie2/opieui/opixmapprovider.cpp @@ -19,8 +19,10 @@ */ #include <opie2/opixmapprovider.h> +using namespace Opie::Ui; + OPixmapProvider::~OPixmapProvider() {} void OPixmapProvider::virtual_hook( int , void* ) { /*BASE::virtual_hook( id, data );*/ } diff --git a/libopie2/opieui/opixmapprovider.h b/libopie2/opieui/opixmapprovider.h index 5b76647..9d9bd69 100644 --- a/libopie2/opieui/opixmapprovider.h +++ b/libopie2/opieui/opixmapprovider.h @@ -22,9 +22,12 @@ #define OPIXMAPPROVIDER_H #include <qpixmap.h> +namespace Opie { +namespace Ui { /** + * \todo make usefull * A tiny abstract class with just one method: * @ref pixmapFor() * * It will be called whenever an icon is searched for @p text. @@ -47,8 +50,13 @@ public: */ virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0; protected: virtual void virtual_hook( int id, void* data ); +private: + class Private; + Private *d; }; +} +} #endif // OPIXMAPPROVIDER_H diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp index d5cc575..3ab8490 100644 --- a/libopie2/opieui/opopupmenu.cpp +++ b/libopie2/opieui/opopupmenu.cpp @@ -26,8 +26,11 @@ #include <opie2/opopupmenu.h> #include <opie2/oconfig.h> +using namespace Opie::Core; +using namespace Opie::Ui; + OPopupTitle::OPopupTitle(QWidget *parent, const char *name) : QWidget(parent, name) { setMinimumSize(16, fontMetrics().height()+8); diff --git a/libopie2/opieui/opopupmenu.h b/libopie2/opieui/opopupmenu.h index 54e4301..419a954 100644 --- a/libopie2/opieui/opopupmenu.h +++ b/libopie2/opieui/opopupmenu.h @@ -30,8 +30,10 @@ /* OPIE */ #include <opie2/opixmapeffect.h> +namespace Opie { +namespace Ui { /** * Title widget for use in @ref OPopupMenu. * * You usually don't have to create this manually since @@ -255,5 +257,8 @@ private: class OPopupMenuPrivate; OPopupMenuPrivate *d; }; +} +} + #endif diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp index 23b3ce3..5f6f10f 100644 --- a/libopie2/opieui/oselector.cpp +++ b/libopie2/opieui/oselector.cpp @@ -35,8 +35,10 @@ * 2D value selector. * The contents of the selector are drawn by derived class. */ +using namespace Opie::Ui; + OXYSelector::OXYSelector( QWidget *parent, const char *name ) : QWidget( parent, name ) { xPos = 0; @@ -72,9 +74,9 @@ void OXYSelector::setValues( int _xPos, int _yPos ) if ( xPos > maxX ) xPos = maxX; else if ( xPos < minX ) xPos = minX; - + if ( yPos > maxY ) yPos = maxY; else if ( yPos < minY ) yPos = minY; @@ -257,9 +259,9 @@ void OSelector::paintEvent( QPaintEvent * ) colorGroup(), TRUE, 2, &brush ); } QPoint pos = calcArrowPos( value() ); - drawArrow( &painter, TRUE, pos ); + drawArrow( &painter, TRUE, pos ); painter.end(); } @@ -287,12 +289,12 @@ void OSelector::valueChange() painter.begin( this ); pos = calcArrowPos( prevValue() ); - drawArrow( &painter, FALSE, pos ); + drawArrow( &painter, FALSE, pos ); pos = calcArrowPos( value() ); - drawArrow( &painter, TRUE, pos ); + drawArrow( &painter, TRUE, pos ); painter.end(); } @@ -360,10 +362,10 @@ void OSelector::drawArrow( QPainter *painter, bool show, const QPoint &pos ) array.setPoint( 2, pos.x()-5, pos.y()+5 ); } painter->drawPolygon( array ); - } - else + } + else { if ( orientation() == Vertical ) { repaint(pos.x(), pos.y()-5, 6, 11, true); @@ -399,9 +401,9 @@ OGradientSelector::~OGradientSelector() void OGradientSelector::init() { color1.setRgb( 0, 0, 0 ); color2.setRgb( 255, 255, 255 ); - + text1 = text2 = ""; } @@ -471,9 +473,9 @@ void OGradientSelector::drawContents( QPainter *painter ) painter->setPen( pen ); painter->drawText( xPos, yPos, text2 ); yPos = contentsRect().bottom() - painter->fontMetrics().descent() - 2; - xPos = contentsRect().left() + (contentsRect().width() - + xPos = contentsRect().left() + (contentsRect().width() - painter->fontMetrics().width( text1 )) / 2; pen.setColor( color1 ); painter->setPen( pen ); painter->drawText( xPos, yPos, text1 ); diff --git a/libopie2/opieui/oselector.h b/libopie2/opieui/oselector.h index f832239..fe75a46 100644 --- a/libopie2/opieui/oselector.h +++ b/libopie2/opieui/oselector.h @@ -26,8 +26,11 @@ #include <qwidget.h> #include <qrangecontrol.h> #include <qpixmap.h> + +namespace Opie { +namespace Ui { /** * OXYSelector is the base class for other widgets which * provides the ability to choose from a two-dimensional * range of values. The currently chosen value is indicated @@ -511,8 +514,10 @@ private: class OColorPrivate; OColorPrivate *d; }; +} +} #endif // __OSELECT_H__ diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index b93c225..bbc4381 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp @@ -35,8 +35,10 @@ #include <opie2/oseparator.h> /* QT */ +using namespace Opie::Core; +using namespace Opie::Ui; OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) : QFrame(parent, name, f) { diff --git a/libopie2/opieui/oseparator.h b/libopie2/opieui/oseparator.h index e59b3f4..6fc4344 100644 --- a/libopie2/opieui/oseparator.h +++ b/libopie2/opieui/oseparator.h @@ -34,8 +34,11 @@ #define OSEPARATOR_H #include <qframe.h> +namespace Opie { +namespace Ui { + /** * Standard horizontal or vertical separator. * * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> @@ -85,6 +88,8 @@ protected: private: class OSeparatorPrivate* d; }; +} +} #endif // OSEPARATOR_H diff --git a/libopie2/opieui/otabbar.cpp b/libopie2/opieui/otabbar.cpp index cd3a34b..a62e18b 100644 --- a/libopie2/opieui/otabbar.cpp +++ b/libopie2/opieui/otabbar.cpp @@ -30,9 +30,9 @@ */ #include <opie2/otabbar.h> -using namespace Opie; +using namespace Opie::Ui; OTabBar::OTabBar( QWidget *parent , const char *name ) :QTabBar( parent, name ) {} diff --git a/libopie2/opieui/otabbar.h b/libopie2/opieui/otabbar.h index 2f35c85..925ae96 100644 --- a/libopie2/opieui/otabbar.h +++ b/libopie2/opieui/otabbar.h @@ -34,10 +34,10 @@ /* QT */ #include <qtabbar.h> -namespace Opie -{ +namespace Opie { +namespace Ui { /** * @class OTabBar * @brief The OTabBar class is a derivative of QTabBar. @@ -79,7 +79,8 @@ private: class Private; Private *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/otabinfo.h b/libopie2/opieui/otabinfo.h index 4a6ce14..426c45a 100644 --- a/libopie2/opieui/otabinfo.h +++ b/libopie2/opieui/otabinfo.h @@ -37,10 +37,10 @@ #include <qstring.h> class QWidget; -namespace Opie -{ +namespace Opie{ +namespace Ui { /** * @class OTabInfo * @brief The OTabInfo class is used internally by OTabWidget to keep track @@ -134,7 +134,8 @@ private: * @brief A list of OTabInfo objects used by OTabWidget. */ typedef QList<OTabInfo> OTabInfoList; -}; +} +} #endif diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index f47c90b..a9f7da9 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -40,9 +40,9 @@ /* QT */ #include <qcombobox.h> #include <qwidgetstack.h> -using namespace Opie; +using namespace Opie::Ui; OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) : QWidget( parent, name ) { diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h index 092f22c..6a64b7d 100644 --- a/libopie2/opieui/otabwidget.h +++ b/libopie2/opieui/otabwidget.h @@ -37,17 +37,16 @@ /* QT */ #include <qwidget.h> #include <qlist.h> -using namespace Opie; class QComboBox; class QPixmap; class QTabBar; class QWidgetStack; -namespace Opie -{ +namespace Opie { +namespace Ui { class OTabBar; /** @@ -286,7 +285,8 @@ private: */ void slotTabListSelected( int ); }; -}; +} +} #endif diff --git a/libopie2/opieui/otaskbarapplet.cpp b/libopie2/opieui/otaskbarapplet.cpp index a67356d..b5268f0 100644 --- a/libopie2/opieui/otaskbarapplet.cpp +++ b/libopie2/opieui/otaskbarapplet.cpp @@ -27,6 +27,56 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <opie2/otaskbarapplet.h> + +#include <qpe/qpeapplication.h> +#include <qframe.h> + +using namespace Opie::Ui; + + +/** + * \todo no example yet!!! + * If you want to implement an Applet for the Opie Taskbar + * use this interface. + * The only specail thing about applets is that you need to build + * it as plugin/library and do EXPORT_OPIE_APPLET_v1( YourApplet ) + * at the bottom of your application. This takes care of + * the activation and implementing the TaskbarAppletInterface. + * You also need to add a static int position() functions to your + * application. + * \code + * class MyApplet : public OTaskBarApplet { + * public: + * static int position() { return 3: } + * void doStuff() { + * popup( myWidget ); + * } + * }; + * EXPORT_OPIE_APPLET_v1( MyApplet ) + * \endcode + * + * @author Michael Lauer + * @version 0.5 + * @see TaskbarAppletInterface + */ +OTaskbarApplet::OTaskbarApplet( QWidget* parent, const char* name ) + :QWidget( parent, name ){ + setFixedHeight( 18 ); + setFixedWidth( 14 ); +} + +OTaskbarApplet::~OTaskbarApplet(){ +} + +void OTaskbarApplet::popup( QWidget* widget ){ + QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); + int w = widget->sizeHint().width(); + int x = curPos.x() - (w/2 ); + if ( (x+w) > QPEApplication::desktop()->width() ) + x = QPEApplication::desktop()->width()-w; + widget->move( x, curPos.y()-widget->sizeHint().height() ); + widget->show(); +} -// Empty on purpose until we shipped Opie 1.0 (see otaskbarapplet.h for explanation) diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h index 074367f..0c85ee7 100644 --- a/libopie2/opieui/otaskbarapplet.h +++ b/libopie2/opieui/otaskbarapplet.h @@ -32,13 +32,22 @@ #ifndef OTASKBARAPPLET_H #define OTASKBARAPPLET_H #include <qpe/taskbarappletinterface.h> +#include <qpe/qcom.h> +#include <qwidget.h> + +class QMouseEvent; + +namespace Opie { +namespace Ui { +namespace Private { /*====================================================================================== * OTaskbarAppletWrapper *======================================================================================*/ +class OTaskbarAppletWrapperPrivate; template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface { public: OTaskbarAppletWrapper():_applet( 0 ) @@ -79,16 +88,12 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface } private: T* _applet; + OTaskbarAppletWrapperPrivate *d; }; -#include <qframe.h> -#include <qwidget.h> -#include <qpe/qpeapplication.h> - -class QMouseEvent; - +} /*====================================================================================== * OTaskbarApplet *======================================================================================*/ @@ -102,29 +107,23 @@ class QMouseEvent; class OTaskbarApplet : public QWidget { public: - OTaskbarApplet( QWidget* parent, const char* name = 0 ):QWidget( parent, name ) - { - setFixedHeight( 18 ); - setFixedWidth( 14 ); - } - - virtual ~OTaskbarApplet() - { - } + OTaskbarApplet( QWidget* parent, const char* name = 0 ); + virtual ~OTaskbarApplet(); protected: - virtual void popup( QWidget* widget ) - { - QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); - int w = widget->sizeHint().width(); - int x = curPos.x() - (w/2 ); - if ( (x+w) > QPEApplication::desktop()->width() ) - x = QPEApplication::desktop()->width()-w; - widget->move( x, curPos.y()-widget->sizeHint().height() ); - widget->show(); - } + virtual void popup( QWidget* widget ); +private: + class Private; + Private *d; }; +} +} + +#define EXPORT_OPIE_APPLET_v1( AppLet ) \ + Q_EXPORT_INTERFACE() { \ + Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ + } #endif diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index 66f9ce0..7de0fd3 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp @@ -26,16 +26,20 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* OPIE */ +#include <opie2/otimepicker.h> + /* QT */ +#include <qgroupbox.h> #include <qlayout.h> #include <qlineedit.h> -/* OPIE */ -#include <opie2/otimepicker.h> -using namespace Opie; + +namespace Opie { +namespace Ui { /** * Constructs the widget * @param parent The parent of the OTimePicker @@ -219,8 +223,10 @@ void OTimePicker::setHour(int h) */ OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) : OTimePickerDialogBase (parent , name, true , fl) { + m_timePicker = new OTimePicker( GroupBox1, "m_timePicker" ); + GroupBox1Layout->addWidget( m_timePicker, 0, 0 ); connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), this, SLOT( setTime(const QTime&) ) ); connect ( minuteField, SIGNAL( textChanged(const QString&) ), @@ -289,4 +295,7 @@ void OTimePickerDialog::setMinute ( const QString& minute ) m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); setTime ( m_time ); } } + +} +} diff --git a/libopie2/opieui/otimepicker.h b/libopie2/opieui/otimepicker.h index 2da7773..01bb557 100644 --- a/libopie2/opieui/otimepicker.h +++ b/libopie2/opieui/otimepicker.h @@ -31,20 +31,19 @@ #define OTIMEPICKER_H /* OPIE */ #include <opie2/oclickablelabel.h> -#include "otimepickerbase.h" +#include <opie2/otimepickerbase.h> /* QT */ #include <qwidget.h> #include <qvaluelist.h> #include <qdatetime.h> #include <qdialog.h> -using namespace Opie; -// namespace Opie -// { +namespace Opie { +namespace Ui { /** * A class to pick time. It uses clickable labels * internally to allow a quick selection of a time. @@ -55,9 +54,9 @@ using namespace Opie; * @see QWidget * @see QTime * @author Hakan Ardo, Stefan Eilers */ -class OTimePicker: public QWidget +class OTimePicker : public QWidget { Q_OBJECT public: @@ -113,13 +112,21 @@ public slots: void setHour( const QString& hour ); void setMinute( const QString& minute ); private: + OTimePicker *m_timePicker; QTime m_time; class Private; Private* d; }; -// }; +} +} +/* for Qt2 */ +#if ( QT_VERSION-0 >= 0x030000 ) +#error "Fix the UI File to use namespaces" +#else +typedef Opie::Ui::OTimePicker OUIOTimePicker; +#endif #endif diff --git a/libopie2/opieui/otimepickerbase.ui b/libopie2/opieui/otimepickerbase.ui index 3e7f2fb..c2eb7c5 100644 --- a/libopie2/opieui/otimepickerbase.ui +++ b/libopie2/opieui/otimepickerbase.ui @@ -10,9 +10,9 @@ <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>210</width> + <width>182</width> <height>137</height> </rect> </property> <property stdset="1"> @@ -248,45 +248,9 @@ <property stdset="1"> <name>spacing</name> <number>6</number> </property> - <widget row="0" column="0" > - <class>OTimePicker</class> - <property stdset="1"> - <name>name</name> - <cstring>m_timePicker</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>3</vsizetype> - </sizepolicy> - </property> - </widget> </grid> </widget> </vbox> </widget> -<customwidgets> - <customwidget> - <class>OTimePicker</class> - <header location="local">otimepicker.h</header> - <sizehint> - <width>-1</width> - <height>-1</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>7</hordata> - <verdata>1</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> -</customwidgets> -<images> - <image> - <name>image0</name> - <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data> - </image> -</images> </UI> diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 78154b7..f6c6410 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp @@ -39,8 +39,11 @@ #include <qaction.h> #include <qpopupmenu.h> +using namespace Opie::Core; +using namespace Opie::Ui; + /* XPM */ static const char * view_icon_xpm[] = { "16 16 16 1", " c None", @@ -131,17 +134,17 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) _listview->setShowSortIndicator( true ); _iconview->setGridX( 90 ); _iconview->setGridY( 42 ); _iconview->setAutoArrange( true ); - + #ifdef QWS // TODO: Let this depend on current geometry (rotation) _iconview->setArrangement( QIconView::TopToBottom ); #else _iconview->setArrangement( QIconView::LeftToRight ); #endif - + _iconview->setResizeMode( QIconView::Adjust ); - + // qt-embedded: map stylus right on hold to right button press #ifdef QWS ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); @@ -167,59 +170,59 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) else if ( mode == Tree ) a2->setOn( true ); connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); - + #if (QT_VERSION >= 0x030000) connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); #else connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); #endif - + // // signal forwarders // // unfortunately we can't short-circuit all the QListView and QIconView signals // to OVersatileView signals, because the signal/slot mechanism doesn't allow // type-conversion :-( // common signals for listview - + connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) ); - connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); + connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) ); connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) ); - + connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) ); connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) ); - + connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) ); connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); // common signals for iconview - + connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) ); - connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); + connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) ); connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) ); - + connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) ); connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) ); - + connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) ); connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); - + // listview only signals - + connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) ); connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) ); - + // iconview only signals - + connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); } OVersatileView::~OVersatileView() @@ -419,9 +422,9 @@ void OVersatileView::doubleClicked( QIconViewItem * item ) void OVersatileView::returnPressed( QListViewItem * item ) { emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); } - + void OVersatileView::returnPressed( QIconViewItem * item ) { emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); } @@ -452,9 +455,9 @@ void OVersatileView::collapsed( QListViewItem *item ) // QListView //=============================================================================================// // OVersatileView Case I - API only existing in QListView or QIconView but not in both! //==============================================================================================// - + int OVersatileView::treeStepSize() const // QListView { if ( !isValidViewMode( Tree ) ) { @@ -744,9 +747,9 @@ void OVersatileView::triggerUpdate() // QListView // // only in QIconView // - + uint OVersatileView::count() const // QIconView { if ( !isValidViewMode( Icons ) ) { diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h index 8af21dc..61b61db 100644 --- a/libopie2/opieui/oversatileview.h +++ b/libopie2/opieui/oversatileview.h @@ -44,21 +44,24 @@ class QHeader; class QIconSet; class QIconViewItem; -class OListView; class QListViewItem; class QPopupMenu; class QString; #ifndef QT_NO_DRAGANDDROP class QIconDragItem; #endif +namespace Opie { +namespace Ui { +class OListView; + class OVersatileView : public QWidgetStack { Q_OBJECT - + friend class OVersatileViewItem; //==============================================================================================// // OVersatileView High Level API @@ -68,85 +71,85 @@ class OVersatileView : public QWidgetStack OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); ~OVersatileView(); QPopupMenu* contextMenu() const; - + void setSynchronization( bool sync ); bool synchronization(); - + enum ViewMode { Tree = 0, Icons }; int viewMode(); - + QIconView* iconView() const; OListView* listView() const; - + enum WarningPolicy { None = 0, Warn, WarnReturn }; - + void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode bool warningPolicy() const; - + void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); - + public slots: void setViewMode( int mode ); void setIconViewMode(); void setTreeViewMode(); protected: virtual bool isValidViewMode( int mode ) const; virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); - + private: int _viewmode; bool _synchronization; mutable int _warningpolicy; - + OListView* _listview; QIconView* _iconview; - + QPixmap _treeleaf; QPixmap _treeopened; QPixmap _treeclosed; QPixmap _iconleaf; QPixmap _iconopened; QPixmap _iconclosed; - + QPopupMenu* _contextmenu; - + int _iconstyle; int _treestyle; - + private slots: - + void contextMenuRequested( QListViewItem*, const QPoint&, int ); void contextMenuRequested( QIconViewItem*, const QPoint& ); // type converting signal forwarders - + void selectionChanged( QListViewItem * ); void currentChanged( QListViewItem * ); void clicked( QListViewItem * ); void pressed( QListViewItem * ); void doubleClicked( QListViewItem * ); void returnPressed( QListViewItem * ); void onItem( QListViewItem * ); - + void selectionChanged( QIconViewItem * ); void currentChanged( QIconViewItem * ); void clicked( QIconViewItem * ); void pressed( QIconViewItem * ); void doubleClicked( QIconViewItem * ); void returnPressed( QIconViewItem * ); void onItem( QIconViewItem * ); - + void expanded( QListViewItem * item ); // QListView void collapsed( QListViewItem * item ); // QListView signals: - + void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col ); - + /*#ifndef QT_NO_DRAGANDDROP void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView #endif void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView @@ -172,13 +175,13 @@ public: Bottom = 0, Right }; */ - + // // only in QListView // - + int treeStepSize() const; // QListView virtual void setTreeStepSize( int ); // QListView QHeader * header() const; // QListView @@ -225,9 +228,9 @@ public: bool rootIsDecorated() const; // QListView void setShowSortIndicator( bool show ); // QListView bool showSortIndicator() const; // QListView - + int index( const OVersatileViewItem *item ) const; // QIconView public slots: void triggerUpdate(); // QListView @@ -239,11 +242,11 @@ public: // // only in QIconView // - public: + public: uint count() const; // QIconView - + OVersatileViewItem *firstItem() const; // QIconView OVersatileViewItem *lastItem() const; // QIconView OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView @@ -286,9 +289,9 @@ public: public slots: virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView virtual void updateContents(); // QIconView - + signals: /*#ifndef QT_NO_DRAGANDDROP void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView #endif @@ -321,9 +324,9 @@ public: virtual void selectAll( bool select ); virtual void clearSelection(); virtual void invertSelection(); - + void ensureItemVisible( const OVersatileViewItem * ); virtual void repaintItem( const OVersatileViewItem * ) const; virtual void setCurrentItem( OVersatileViewItem * ); @@ -343,18 +346,18 @@ public: void pressed( OVersatileViewItem * ); void doubleClicked( OVersatileViewItem * ); void returnPressed( OVersatileViewItem * ); - + void onItem( OVersatileViewItem * ); void onViewport(); - + //==============================================================================================// // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures //==============================================================================================// - + /* - + public: virtual void insertItem( OVersatileViewItem * ); // QListView virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView @@ -367,28 +370,30 @@ public: void sort(); // #### make virtual in next major release // QListView virtual void sort( bool ascending = TRUE ); // QIconView */ - + signals: void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView void clicked( OVersatileViewItem *, const QPoint & ); // QIconView - + void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView void pressed( OVersatileViewItem *, const QPoint & ); // QIconView - + void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView - - void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView + + void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView - + void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView - + void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView }; +} +} #endif diff --git a/libopie2/opieui/oversatileviewitem.cpp b/libopie2/opieui/oversatileviewitem.cpp index 66de8eb..03c6738 100644 --- a/libopie2/opieui/oversatileviewitem.cpp +++ b/libopie2/opieui/oversatileviewitem.cpp @@ -30,8 +30,10 @@ #include <opie2/oversatileviewitem.h> #include <opie2/oversatileview.h> +using namespace Opie::Ui; + OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), _versatileview( parent ) { diff --git a/libopie2/opieui/oversatileviewitem.h b/libopie2/opieui/oversatileviewitem.h index ee8ee20..c4977af 100644 --- a/libopie2/opieui/oversatileviewitem.h +++ b/libopie2/opieui/oversatileviewitem.h @@ -39,8 +39,11 @@ /* OPIE */ #include <opie2/olistview.h> +namespace Opie { +namespace Ui { + class OVersatileView; class OVersatileViewItem : public OListViewItem, public QIconViewItem { @@ -96,5 +99,7 @@ class OVersatileViewItem : public OListViewItem, public QIconViewItem void init(); }; +} +} #endif diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp index 8bb4ed6..9519888 100644 --- a/libopie2/opieui/owait.cpp +++ b/libopie2/opieui/owait.cpp @@ -37,8 +37,10 @@ /* QT */ #include <qlayout.h> #include <qpainter.h> +using namespace Opie::Ui; + static int frame = 0; /** * This will construct a modal dialog. diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h index 3267064..03c33e4 100644 --- a/libopie2/opieui/owait.h +++ b/libopie2/opieui/owait.h @@ -36,8 +36,11 @@ #include <qlabel.h> #include <qpixmap.h> #include <qtimer.h> + +namespace Opie { +namespace Ui { /** * This class displays a animated waiting icon in the middle of the screen. * * @short modal hour glass dialog @@ -81,6 +84,7 @@ class OWait : public QDialog int m_aniSize; class Private; Private *d; }; - +} +} #endif diff --git a/libqtaux/oticker.cpp b/libqtaux/oticker.cpp index 2d8397e..e954cc8 100644 --- a/libqtaux/oticker.cpp +++ b/libqtaux/oticker.cpp @@ -32,8 +32,10 @@ /* OPIE */ #include <qpe/config.h> +using namespace Opie::Ui; + OTicker::OTicker( QWidget* parent ) : QLabel( parent ) { setTextFormat( Qt::RichText ); diff --git a/libqtaux/oticker.h b/libqtaux/oticker.h index 4026eb5..a89d334 100644 --- a/libqtaux/oticker.h +++ b/libqtaux/oticker.h @@ -40,8 +40,11 @@ #include <qlabel.h> #include <qframe.h> #include <qcolor.h> + +namespace Opie { +namespace Ui { /** * @class OTicker * @brief The OTicker class provides a QLabel widget that scroll its contents * @@ -142,5 +145,7 @@ private: QPixmap scrollTextPixmap; int pos, updateTimerTime, scrollLength; }; +} +} #endif |