summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2004-03-13 19:51:45 (UTC)
committer zecke <zecke>2004-03-13 19:51:45 (UTC)
commit6d08277737e22b7a1527124623f3571969073ddf (patch) (side-by-side diff)
tree4129e674e21df767b31299e873dd44e33a308e1b /libopie2
parent8e28911f7199f4450ac5eef09482069f9b9caea2 (diff)
downloadopie-6d08277737e22b7a1527124623f3571969073ddf.zip
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.gz
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.bz2
Move XML class to internal PIM
Add namespaces!!! Opie::Core and Opie::Core::Private Opie::Net and Opie::Net::Private Opie::Ui and Opie::Ui::Private Opie::MM and Opie::MM::Private Opie::DB and Opie::DB::Private PIM classes are not yet converted because we will do other work on it as well
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp4
-rw-r--r--libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp4
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.pro2
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.pro2
-rw-r--r--libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp2
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp2
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp2
-rw-r--r--libopie2/examples/opieui/olistviewdemo/main.cpp3
-rw-r--r--libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp2
-rw-r--r--libopie2/examples/opieui/olistviewdemo/olistviewdemo.h2
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_example.cpp3
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_example.h1
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp8
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_mail.h6
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/main.cpp3
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp8
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h6
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp2
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h26
-rw-r--r--libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp2
-rw-r--r--libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h3
-rw-r--r--libopie2/opiecore/device/odevice.cpp17
-rw-r--r--libopie2/opiecore/device/odevice.h9
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h8
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.h9
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_ramses.h7
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_simpad.h8
-rw-r--r--libopie2/opiecore/device/odevice_yopy.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_yopy.h9
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h8
-rw-r--r--libopie2/opiecore/device/odevicebutton.cpp15
-rw-r--r--libopie2/opiecore/device/odevicebutton.h11
-rw-r--r--libopie2/opiecore/oapplication.cpp11
-rw-r--r--libopie2/opiecore/oapplication.h13
-rw-r--r--libopie2/opiecore/oconfig.cpp2
-rw-r--r--libopie2/opiecore/oconfig.h13
-rw-r--r--libopie2/opiecore/odebug.cpp7
-rw-r--r--libopie2/opiecore/odebug.h9
-rw-r--r--libopie2/opiecore/oglobal.cpp6
-rw-r--r--libopie2/opiecore/oglobal.h10
-rw-r--r--libopie2/opiecore/oglobalsettings.cpp3
-rw-r--r--libopie2/opiecore/oglobalsettings.h12
-rw-r--r--libopie2/opiecore/opiecore.pro8
-rw-r--r--libopie2/opiecore/oprocctrl.cpp2
-rw-r--r--libopie2/opiecore/oprocctrl.h10
-rw-r--r--libopie2/opiecore/oprocess.cpp10
-rw-r--r--libopie2/opiecore/oprocess.h13
-rw-r--r--libopie2/opiecore/osmartpointer.h2
-rw-r--r--libopie2/opiecore/ostorageinfo.cpp2
-rw-r--r--libopie2/opiecore/ostorageinfo.h8
-rw-r--r--libopie2/opiedb/TODO1
-rw-r--r--libopie2/opiedb/opiedb.pro2
-rw-r--r--libopie2/opiedb/osqlbackend.cpp2
-rw-r--r--libopie2/opiedb/osqlbackend.h8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.cpp8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.h6
-rw-r--r--libopie2/opiedb/osqldriver.cpp2
-rw-r--r--libopie2/opiedb/osqldriver.h7
-rw-r--r--libopie2/opiedb/osqlerror.cpp2
-rw-r--r--libopie2/opiedb/osqlerror.h5
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp9
-rw-r--r--libopie2/opiedb/osqlitedriver.h8
-rw-r--r--libopie2/opiedb/osqlmanager.cpp6
-rw-r--r--libopie2/opiedb/osqlmanager.h6
-rw-r--r--libopie2/opiedb/osqlquery.cpp2
-rw-r--r--libopie2/opiedb/osqlquery.h8
-rw-r--r--libopie2/opiedb/osqlresult.cpp2
-rw-r--r--libopie2/opiedb/osqlresult.h8
-rw-r--r--libopie2/opiedb/osqltable.cpp2
-rw-r--r--libopie2/opiedb/osqltable.h7
-rw-r--r--libopie2/opiemm/opiemm.pro2
-rw-r--r--libopie2/opiemm/osoundsystem.cpp2
-rw-r--r--libopie2/opiemm/osoundsystem.h17
-rw-r--r--libopie2/opienet/802_11_user.h1
-rw-r--r--libopie2/opienet/dhcp.h2
-rw-r--r--libopie2/opienet/odebugmapper.cpp10
-rw-r--r--libopie2/opienet/odebugmapper.h10
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp7
-rw-r--r--libopie2/opienet/omanufacturerdb.h8
-rw-r--r--libopie2/opienet/onetutils.cpp9
-rw-r--r--libopie2/opienet/onetutils.h15
-rw-r--r--libopie2/opienet/onetwork.cpp9
-rw-r--r--libopie2/opienet/onetwork.h31
-rw-r--r--libopie2/opienet/opcap.cpp8
-rw-r--r--libopie2/opienet/opcap.h52
-rw-r--r--libopie2/opienet/ostation.cpp8
-rw-r--r--libopie2/opienet/ostation.h9
-rw-r--r--libopie2/opiepim/backend/backends.pro6
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp2
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_sql.h8
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp3
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp2
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_sql.h8
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp2
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.h12
-rw-r--r--libopie2/opiepim/core/backends/private/xmltree.cc (renamed from libopie2/opiecore/xmltree.cc)4
-rw-r--r--libopie2/opiepim/core/backends/private/xmltree.h (renamed from libopie2/opiecore/xmltree.h)7
-rw-r--r--libopie2/opieui/big-screen/obigscreen_p.h9
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp13
-rw-r--r--libopie2/opieui/big-screen/osplitter.h15
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp9
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.h7
-rw-r--r--libopie2/opieui/fileselector/ofiledialog.cpp2
-rw-r--r--libopie2/opieui/fileselector/ofiledialog.h7
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp9
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h19
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h10
-rw-r--r--libopie2/opieui/fileselector/ofileview.h9
-rw-r--r--libopie2/opieui/oclickablelabel.cpp2
-rw-r--r--libopie2/opieui/oclickablelabel.h7
-rw-r--r--libopie2/opieui/odialog.cpp2
-rw-r--r--libopie2/opieui/odialog.h5
-rw-r--r--libopie2/opieui/ofontselector.cpp19
-rw-r--r--libopie2/opieui/ofontselector.h12
-rw-r--r--libopie2/opieui/oimageeffect.cpp7
-rw-r--r--libopie2/opieui/oimageeffect.h5
-rw-r--r--libopie2/opieui/olistview.cpp7
-rw-r--r--libopie2/opieui/olistview.h25
-rw-r--r--libopie2/opieui/opieui.pro3
-rw-r--r--libopie2/opieui/opixmapeffect.cpp2
-rw-r--r--libopie2/opieui/opixmapeffect.h6
-rw-r--r--libopie2/opieui/opixmapprovider.cpp2
-rw-r--r--libopie2/opieui/opixmapprovider.h8
-rw-r--r--libopie2/opieui/opopupmenu.cpp3
-rw-r--r--libopie2/opieui/opopupmenu.h5
-rw-r--r--libopie2/opieui/oselector.cpp18
-rw-r--r--libopie2/opieui/oselector.h5
-rw-r--r--libopie2/opieui/oseparator.cpp2
-rw-r--r--libopie2/opieui/oseparator.h5
-rw-r--r--libopie2/opieui/otabbar.cpp2
-rw-r--r--libopie2/opieui/otabbar.h7
-rw-r--r--libopie2/opieui/otabinfo.h7
-rw-r--r--libopie2/opieui/otabwidget.cpp2
-rw-r--r--libopie2/opieui/otabwidget.h8
-rw-r--r--libopie2/opieui/otaskbarapplet.cpp52
-rw-r--r--libopie2/opieui/otaskbarapplet.h49
-rw-r--r--libopie2/opieui/otimepicker.cpp15
-rw-r--r--libopie2/opieui/otimepicker.h19
-rw-r--r--libopie2/opieui/otimepickerbase.ui38
-rw-r--r--libopie2/opieui/oversatileview.cpp43
-rw-r--r--libopie2/opieui/oversatileview.h83
-rw-r--r--libopie2/opieui/oversatileviewitem.cpp2
-rw-r--r--libopie2/opieui/oversatileviewitem.h5
-rw-r--r--libopie2/opieui/owait.cpp2
-rw-r--r--libopie2/opieui/owait.h6
154 files changed, 994 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,16 +1,18 @@
#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" );
OConfigGroupSaver c1( app->config(), "MyGroup" );
app->config()->writeEntry( "AnEntry", "InMyGroup" );
{
OConfigGroupSaver c2( c1.config(), "AnotherGroup" );
app->config()->writeEntry( "AnEntry", "InAnotherGroup" );
} // closing the scope returns to the last group
app->config()->writeEntry( "AnotherEntry", "InMyGroup" );
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
@@ -8,24 +8,26 @@
#include <qradiobutton.h>
#include <qpushbutton.h>
/* OPIE */
#include <qpe/config.h>
#include <opie2/odebug.h>
#include <opie2/oapplication.h>
#include <opie2/oglobal.h>
#include <opie2/oglobalsettings.h>
+using namespace Opie::Core;
+
class DemoApp : public OApplication
{
Q_OBJECT
public:
DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" )
{
// you have access to your OApplication object via oApp
qDebug( "Process-wide OApplication object @ %0x", oApp );
// you have access to global settings via OGlobalSettings
int mode = OGlobalSettings::debugMode();
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,13 +1,15 @@
#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() );
printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() );
return 0;
}
//#include "moc/oconfigdemo.moc"
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,11 +1,13 @@
#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" ) );
printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) );
return 0;
}
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,19 +1,21 @@
#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 );
OSQLManager man;
man.registerPath( QDir::currentDirPath() );
OSQLBackEnd::ValueList list = man.queryBackEnd();
OSQLDriver *driver = man.standard();
qWarning("testmain" + driver->id() );
driver->setUrl("/home/ich/spaltenweise");
if ( driver->open() ) {
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
@@ -1,13 +1,13 @@
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS =
SOURCES = spaltenweise.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopiesql
+LIBS += -lqpe -lopiedb2
TARGET = spaltenweise
include ( $(OPIEDIR)/include.pro )
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,19 +1,21 @@
#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 );
OSQLManager man;
man.registerPath( QDir::currentDirPath() );
OSQLBackEnd::ValueList list = man.queryBackEnd();
OSQLDriver *driver = man.standard();
qWarning("testmain" + driver->id() );
driver->setUrl("/home/ich/zeilenweise");
if ( driver->open() ) {
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
@@ -1,13 +1,13 @@
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS =
SOURCES = zeilenweise.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopiesql
+LIBS += -lqpe -lopiedb2
TARGET = zeilenweise
include ( $(OPIEDIR)/include.pro )
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,14 +1,16 @@
#include <opie2/osoundsystem.h>
+using namespace Opie::MM;
+
int main( int argc, char** argv )
{
qDebug( "OPIE Sound System Demo" );
OSoundSystem* sound = OSoundSystem::instance();
OSoundSystem::CardIterator it = sound->iterator();
/*
while ( it.current() )
{
qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() );
++it;
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
@@ -1,23 +1,25 @@
#include <qdict.h>
#include <qsocketnotifier.h>
#include <qstring.h>
#include <opie2/onetwork.h>
#include <qapplication.h>
#include <opie2/opcap.h>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
+
+using namespace Opie::Net;
//======================== Station help class ===============================
class Station
{
public:
Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {};
~Station() {};
QString type;
int channel;
bool wep;
int beacons;
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
@@ -1,18 +1,20 @@
#include <opie2/onetwork.h>
#include <opie2/ostation.h>
#include <opie2/omanufacturerdb.h>
#include <unistd.h>
+using namespace Opie::Net;
+
int main( int argc, char** argv )
{
qDebug( "OPIE Network Demo" );
ONetwork* net = ONetwork::instance();
ONetwork::InterfaceIterator it = net->iterator();
while ( it.current() )
{
qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() );
qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() );
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
@@ -7,20 +7,23 @@
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#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;
a.showMainWidget(&e);
return a.exec();
}
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
@@ -28,24 +28,26 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "olistviewdemo.h"
#include <opie2/olistview.h>
#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 );
lv->setRootIsDecorated( true );
lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) );
ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
item->setText( "Column2", "ModifiedText" );
item->setText( "Column5", "ThisColumnDoesNotExits" );
new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
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
@@ -35,17 +35,17 @@
#include <qvbox.h>
#include <opie2/olistview.h>
class OListViewDemo: public QVBox
{
Q_OBJECT
public:
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
@@ -1,25 +1,26 @@
#include "osplitter_example.h"
/* 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 )
: QWidget( w, n, f ){
QVBoxLayout * lay = new QVBoxLayout(this);
OSplitter * splitter = new OSplitter( Horizontal, this );
lay->addWidget( splitter );
OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector,
OFileSelector::Normal, QDir::homeDirPath(),
QString::null );
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
@@ -1,20 +1,19 @@
/*
* May be used, copied and modified wihtout any limitation
*/
#ifndef OSPlitter_EXAMPLE_H
#define OSPlitter_EXAMPLE_H
#include <qvbox.h>
-#include <opie2/ofileselector.h>
class OSplitterExample : public QWidget {
Q_OBJECT
public:
static QString appName() { return QString::fromLatin1("osplitter_example"); }
OSplitterExample( QWidget *parent, const char* name, WFlags fl );
};
#endif
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
@@ -1,46 +1,48 @@
#include <qstring.h>
#include <qlabel.h>
#include <qheader.h>
#include <qlayout.h>
#include <qpe/qpeapplication.h>
#include <opie2/oapplicationfactory.h>
#include "osplitter_mail.h"
+using namespace Opie::Ui;
+
OPIE_EXPORT_APP( OApplicationFactory<ListViews> )
class Folder {
int dummy;
};
// -----------------------------------------------------------------
ListViews::ListViews( QWidget* p, const char* name, WFlags fl )
: QWidget( p, name, fl ) {
qApp->installEventFilter( this );
m_lstFolders.setAutoDelete( true );
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 */
m_messages = 0;
m_message = m_attach = 0;
splitti = new OSplitter( Vertical, m_splitter, "Splitti2" );
splitti->setSizeChange( 300 );
splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
QLabel *lbl = new QLabel(splitti);
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
@@ -7,47 +7,45 @@
* layout
*/
#ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H
#define OPIE_SPLITTER_MAIL_EXAMPLE_H
#include <qwidget.h>
#include <qlist.h>
#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"); }
ListViews( QWidget* parent, const char * name, WFlags fl );
~ListViews();
bool eventFilter( QObject* , QEvent* );
private:
void initFolders();
void initFolder( Folder *folder, unsigned int &count );
QListView *m_messages, *m_overview;
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* );
// void slotMessageChanged();
// void slotSizeChange( bool, const QSize& );
#endif
};
#endif
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
@@ -8,22 +8,25 @@
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#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( "." );
OpieUIDemo e;
qDebug( "." );
a.showMainWidget(&e);
qDebug( "." );
return a.exec();
}
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
@@ -16,50 +16,48 @@
// Qt
#include <qcolor.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qvbox.h>
#include <qstring.h>
#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>
#include <opie2/oeditlistbox.h>
#include <opie2/oselector.h>
#include <opie2/opopupmenu.h>
#include <qtabwidget.h>
#include "oversatileviewdemo.h"
// 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 )
{
QMenuBar* mbar = this->menuBar();
OPopupMenu* demo = new OPopupMenu( this );
demo->setTitle( "Title" );
demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox );
demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit );
demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox );
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
@@ -9,25 +9,29 @@
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#ifndef OPIEUIDEMO_H
#define OPIEUIDEMO_H
#include <qmainwindow.h>
+namespace Opie {
+namespace Ui {
class OVersatileView;
+}
+}
class QTabWidget;
class QVBox;
class OpieUIDemo : public QMainWindow {
Q_OBJECT
public:
OpieUIDemo( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel );
~OpieUIDemo();
void demoOCompletionBox();
@@ -38,19 +42,19 @@ public:
public slots:
void demo( int );
void messageBox( const QString& text );
protected:
void build();
void buildVV( QVBox* b );
private:
QTabWidget* main;
- OVersatileView* vv;
+ Opie::Ui::OVersatileView* vv;
};
#endif
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
@@ -29,24 +29,26 @@
Boston, MA 02111-1307, USA.
*/
#include "oversatileviewdemo.h"
#include <opie2/oversatileview.h>
#include <opie2/oversatileviewitem.h>
#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 );
vv->addColumn( "First" );
vv->addColumn( "2nd" );
vv->addColumn( "IIIrd" );
QString counter;
QPixmap leaf( "leaf.png" );
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
@@ -25,49 +25,53 @@
    --        :-=` 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 OVERSATILEVIEWDEMO_H
#define OVERSATILEVIEWDEMO_H
#include <qvbox.h>
+namespace Opie {
+namespace Ui {
class OVersatileView;
class OVersatileViewItem;
+}
+}
class OVersatileViewDemo: public QVBox
{
Q_OBJECT
public:
OVersatileViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 );
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
@@ -10,25 +10,25 @@
#include <qpe/resource.h>
/* QT */
#include <qaction.h>
#include <qtoolbar.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
#include <qlayout.h>
#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 )
: QMainWindow( parent, name, fl )
{
m_stack = new OWidgetStack( this );
setCentralWidget( m_stack );
/* nice Signal Mapper ;) */
QSignalMapper *sm = new QSignalMapper(this);
connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) );
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
@@ -1,28 +1,27 @@
/*
* You may use, modify and distribute this example without any limitation
*/
#ifndef O_STACK_EXAMPLE_SIMPLE_H
#define O_STACK_EXAMPLE_SIMPLE_H
#include <qmainwindow.h>
#include <opie2/owidgetstack.h>
-using namespace Opie;
class StackExample : public QMainWindow {
Q_OBJECT
public:
StackExample( QWidget* paren, const char* name, WFlags fl );
~StackExample();
static QString appName() { return QString::fromLatin1("owidgetstack-example"); }
protected:
void closeEvent( QCloseEvent* e );
private:
- OWidgetStack* m_stack;
+ Opie::Ui::OWidgetStack* m_stack;
QWidget* m_main;
};
#endif
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
@@ -51,50 +51,50 @@ _;:, .> :=|. This program is free software; you can
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#ifndef QT_NO_SOUND
#include <linux/soundcard.h>
#endif
const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
-using namespace Opie;
+using namespace Opie::Core;
ODevice *ODevice::inst()
{
static ODevice *dev = 0;
// rewrite this to only use /proc/cpuinfo or so
if ( !dev )
{
QFile f( PATH_PROC_CPUINFO );
if ( f.open( IO_ReadOnly ) )
{
QTextStream s( &f );
while ( !s.atEnd() )
{
QString line;
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;
}
}
}
else
{
qWarning( "ODevice() - can't open '%s' - unknown hardware - using default." );
}
if ( !dev ) dev = new ODevice();
dev->init();
}
@@ -178,25 +178,25 @@ bool ODevice::setSoftSuspend ( bool /*soft*/ )
*/
bool ODevice::suspend()
{
qDebug("ODevice::suspend");
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
return false;
if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
return false;
bool res = false;
ODevice::sendSuspendmsg();
-
+
struct timeval tvs, tvn;
::gettimeofday ( &tvs, 0 );
::sync(); // flush fs caches
res = ( ::system ( "apm --suspend" ) == 0 );
// This is needed because the iPAQ apm implementation is asynchronous and we
// can not be sure when exactly the device is really suspended
// This can be deleted as soon as a stable familiar with a synchronous apm implementation exists.
if ( res ) {
do { // wait at most 1.5 sec: either suspend didn't work or the device resumed
@@ -615,14 +615,17 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action )
buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message());
// buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data()));
QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" );
}
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
@@ -31,26 +31,27 @@ _;:, .> :=|. This program is free software; you can
#define ODEVICE_H_
/* OPIE */
#include <opie2/odevicebutton.h>
#include <qpe/qpeapplication.h> /* for Transformation enum.. */
/* QT */
#include <qnamespace.h>
#include <qobject.h>
#include <qstring.h>
#include <qstrlist.h>
-namespace Opie
-{
+namespace Opie{
+namespace Core{
+
class ODeviceData;
/**
* The available devices
*/
enum OModel {
Model_Unknown, // = 0
Model_Series_Mask = 0xff000000,
Model_iPAQ = ( 1 << 24 ),
Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
@@ -241,25 +242,25 @@ public:
virtual bool hasHingeSensor() const;
virtual OHingeStatus readHingeSensor();
const QStrList &allowedCpuFrequencies() const;
bool setCurrentCpuFrequency(uint index);
/**
* 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();
/**
* Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it
* returns 0L
*/
const ODeviceButton *buttonForKeycode ( ushort keyCode );
/**
@@ -305,28 +306,30 @@ class ODeviceData {
QString m_sysverstr;
Transformation m_rotation;
ODirection m_direction;
QValueList <ODeviceButton> *m_buttons;
uint m_holdtime;
QStrList *m_cpu_frequencies;
};
}
+}
static inline bool isQWS()
{
return qApp ? ( qApp->type() == QApplication::GuiServer ) : false;
}
static QCString makeChannel ( const char *str )
{
if ( str && !::strchr ( str, '/' ))
return QCString ( "QPE/Application/" ) + 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
@@ -44,24 +44,28 @@
/* STD */
#include <fcntl.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#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)
#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))
typedef struct {
unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
unsigned char TotalTime; /* Units of 5 seconds */
unsigned char OnTime; /* units of 100m/s */
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
@@ -26,25 +26,27 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEVICE_IPAQ
#define ODEVICE_IPAQ
#include "odevice.h"
/* QT */
#include <qwindowsystem_qws.h>
-using namespace Opie;
+namespace Opie {
+namespace Core {
+namespace Private {
class iPAQ : public ODevice, public QWSServer::KeyboardFilter
{
protected:
virtual void init();
virtual void initButtons();
public:
virtual bool setSoftSuspend( bool soft );
virtual bool setDisplayBrightness( int b );
@@ -72,13 +74,17 @@ class iPAQ : public ODevice, public QWSServer::KeyboardFilter
struct i_button {
uint model;
Qt::Key code;
char *utext;
char *pix;
char *fpressedservice;
char *fpressedaction;
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
@@ -68,25 +68,25 @@ typedef struct {
unsigned char OffTime; /* units of 100m/s */
} LED_IN;
typedef struct {
unsigned char mode;
unsigned char pwr;
unsigned char brightness;
} FLITE_IN;
#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";
d->m_vendor = Vendor_HP;
d->m_modelstr = "Jornada 56x";
d->m_model = Model_Jornada_56x;
d->m_systemstr = "Familiar";
d->m_system = System_Familiar;
d->m_rotation = Rot0;
QFile f ( "/etc/familiar-version" );
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
@@ -23,28 +23,31 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEVICE_JORNADA
#define ODEVICE_JORNADA
#include <opie2/odevice.h>
-using namespace Opie;
-
+namespace Opie {
+namespace Core {
+namespace Private {
class Jornada : public ODevice
{
protected:
virtual void init();
public:
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
@@ -44,24 +44,27 @@
/* STD */
#include <fcntl.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#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",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Model_Ramses_MNCI,
Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
"devicebuttons/ipaq_home",
"QPE/Launcher", "home()",
"buttonsettings", "raise()" },
};
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
@@ -25,25 +25,27 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEVICE_RAMSES
#define ODEVICE_RAMSES
#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:
virtual void init();
public:
virtual bool setSoftSuspend( bool soft );
virtual bool suspend();
virtual bool setDisplayStatus( bool on );
virtual bool setDisplayBrightness( int b );
@@ -59,14 +61,17 @@ class Ramses : public ODevice, public QWSServer::KeyboardFilter
};
struct r_button {
uint model;
Qt::Key code;
char *utext;
char *pix;
char *fpressedservice;
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
@@ -44,25 +44,26 @@ _;:, .> :=|. This program is free software; you can
/* STD */
#include <fcntl.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#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"),
"devicebuttons/simpad_lower_up",
"datebook", "nextView()",
"today", "raise()" },
{ Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"),
"devicebuttons/simpad_lower_down",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
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
@@ -26,25 +26,27 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEVICE_SIMPAD
#define ODEVICE_SIMPAD
#include <opie2/odevice.h>
/* QT */
#include <qwindowsystem_qws.h>
-using namespace Opie;
+namespace Opie {
+namespace Core {
+namespace Private {
class SIMpad : public ODevice, public QWSServer::KeyboardFilter
{
protected:
virtual void init();
virtual void initButtons();
public:
virtual bool setSoftSuspend( bool soft );
virtual bool suspend();
virtual bool setDisplayStatus( bool on );
@@ -69,13 +71,17 @@ class SIMpad : public ODevice, public QWSServer::KeyboardFilter
struct s_button {
uint model;
Qt::Key code;
char *utext;
char *pix;
char *fpressedservice;
char *fpressedaction;
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
@@ -44,25 +44,26 @@ _;:,     .>    :=|. This program is free software; you can
/* STD */
#include <fcntl.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#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",
"datebook", "nextView()",
"today", "raise()" },
{ Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ),
"devicebuttons/yopy_ok",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
{ Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ),
"devicebuttons/yopy_end",
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
@@ -23,26 +23,27 @@ _;:,     .>    :=|. This program is free software; you can
-_. . .   )=.  = Library General Public License along with
  --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEVICE_YOPY
#define ODEVICE_YOPY
#include <opie2/odevice.h>
-using namespace Opie;
-
+namespace Opie {
+namespace Core {
+namespace Private {
class Yopy : public ODevice
{
protected:
virtual void init();
virtual void initButtons();
public:
virtual bool suspend();
virtual bool setDisplayBrightness ( int b );
virtual int displayBrightnessResolution() const;
@@ -50,13 +51,17 @@ class Yopy : public ODevice
struct yopy_button
{
Qt::Key code;
char *utext;
char *pix;
char *fpressedservice;
char *fpressedaction;
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
@@ -44,25 +44,26 @@ _;:, .> :=|. This program is free software; you can
/* STD */
#include <fcntl.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#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",
"datebook", "nextView()",
"today", "raise()" },
{ Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
"devicebuttons/z_contact",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
{ Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
"devicebuttons/z_home",
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
@@ -36,26 +36,28 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
// _IO and friends are only defined in kernel headers ...
#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)
#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:
virtual void init();
virtual void initButtons();
public:
virtual bool setSoftSuspend ( bool soft );
virtual bool setDisplayBrightness ( int b );
virtual int displayBrightnessResolution() const;
@@ -83,14 +85,16 @@ class Zaurus : public ODevice
bool m_embedix;
};
struct z_button {
Qt::Key code;
char *utext;
char *pix;
char *fpressedservice;
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
@@ -24,34 +24,40 @@
    --        :-=` 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.
*/
#include <qpixmap.h>
#include <qstring.h>
#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 )
{
init ( QCString(), QCString(), QByteArray());
}
OQCopMessage::OQCopMessage ( const OQCopMessage &copy )
: d ( 0 )
{
init ( copy. channel(), copy. message(), copy. data());
}
@@ -115,26 +121,26 @@ void OQCopMessage::setChannel ( const QCString &ch )
}
void OQCopMessage::setMessage ( const QCString &m )
{
d->m_message = m;
}
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
device. userText() and pixmap() may be used to describe this button
to the user in help documentation.
\ingroup qtopiaemb
\internal
*/
ODeviceButton::ODeviceButton()
@@ -235,12 +241,15 @@ void ODeviceButton::setPressedAction(const OQCopMessage& action)
m_PressedAction = action;
}
void ODeviceButton::setFactoryPresetHeldAction(const OQCopMessage& action)
{
m_FactoryPresetHeldAction = 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
@@ -14,28 +14,30 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef DEVICE_BUTTON_H
#define DEVICE_BUTTON_H
#include <qpixmap.h>
#include <qstring.h>
-class OQCopMessageData;
-namespace Opie
-{
+namespace Opie{
+namespace Core{
+namespace Private {
+class OQCopMessageData;
+}
class OQCopMessage
{
public:
OQCopMessage ( );
OQCopMessage ( const OQCopMessage &copy );
OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( ));
OQCopMessage &operator = ( const OQCopMessage &assign );
void setChannel ( const QCString &channel );
void setMessage ( const QCString &message );
@@ -43,25 +45,25 @@ public:
QCString channel ( ) const;
QCString message ( ) const;
QByteArray data ( ) const;
bool isNull()const;
bool send ( );
private:
void init ( const QCString &m_channel, const QCString &message, const QByteArray &args );
- OQCopMessageData *d;
+ Private::OQCopMessageData *d;
class Private;
Private* m_data;
};
/**
* This class represents a physical button on a Qtopia device. A device may
* have n "user programmable" buttons, which are number 1..n. The location
* and number of buttons will vary from device to device. userText() and pixmap()
* may be used to describe this button to the user in help documentation.
*
* @version 1.0
@@ -95,14 +97,15 @@ class ODeviceButton
ushort m_Keycode;
QString m_UserText;
QPixmap m_Pixmap;
OQCopMessage m_FactoryPresetPressedAction;
OQCopMessage m_PressedAction;
OQCopMessage m_FactoryPresetHeldAction;
OQCopMessage m_HeldAction;
class Private;
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
@@ -25,36 +25,43 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
#include <opie2/odebug.h>
#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
**************************************************************************************************/
OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
:QPEApplication( argc, argv ),
_appname( rAppName ),
_config( 0 )
{
init();
@@ -75,25 +82,25 @@ OApplication::~OApplication()
OConfig* OApplication::config()
{
if ( !_config )
{
_config = new OConfig( _appname );
}
return _config;
}
void OApplication::init()
{
- d = new OApplicationPrivate();
+ d = new Private::OApplicationPrivate();
if ( !OApplication::_instance )
{
OApplication::_instance = this;
/* register SIGSEGV handler to give programs an option
* to exit gracefully, e.g. save or close devices or files.
struct sigaction sa;
sa.sa_handler = ( void (*)(int) ) &segv_handler;
sa.sa_flags = SA_SIGINFO | SA_RESTART;
sigemptyset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, NULL);
*/
@@ -116,12 +123,14 @@ void OApplication::showMainWidget( QWidget* widget, bool nomax )
void OApplication::setTitle( const QString& title ) const
{
if ( mainWidget() )
{
if ( !title.isNull() )
mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
else
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
@@ -21,31 +21,35 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef 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
{
Q_OBJECT
public:
/**
* Constructor. Parses command-line arguments and sets the window caption.
*
* @param rAppName application name. Will be used for finding the
@@ -89,16 +93,19 @@ class OApplication : public QPEApplication
*
* @param title the title. If not given, resets caption to appname
*/
virtual void setTitle( const QString& title = QString::null ) const;
protected:
void init();
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
@@ -29,24 +29,26 @@
Boston, MA 02111-1307, USA.
*/
/* QT */
#include <qfont.h>
#include <qcolor.h>
/* OPIE */
#include <opie2/oconfig.h>
+using namespace Opie::Core;
+
OConfig::OConfig( const QString &name, Domain domain )
:Config( name, domain )
{
qDebug( "OConfig::OConfig()" );
}
OConfig::~OConfig()
{
qDebug( "OConfig::~OConfig()" );
}
QColor OConfig::readColorEntry( const QString& key, const QColor* pDefault ) const
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
@@ -31,56 +31,64 @@
#ifndef OCONFIG_H
#define OCONFIG_H
//FIXME: Implement for X11 or reuse libqpe/Config there also?
//FIXME: Or rather use QSettings also for libqpe?
#include <qpe/config.h>
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
*/
class OConfig : public Config
{
public:
/**
* Constructs a OConfig object with a @a name.
*/
OConfig( const QString &name, Domain domain = User );
/**
* Destructs the OConfig object.
*
* Writes back any dirty configuration entries, and destroys
* dynamically created objects.
*/
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.
*/
QColor readColorEntry( const QString& key, const QColor* pDefault ) const;
/**
* @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.
*
* Careful programmers always set the group of a
* @ref OConfig object to the group they want to read from
* and set it back to the old one of afterwards. This is usually
* written as:
* <pre>
*
* QString oldgroup config()->group();
@@ -127,15 +135,20 @@ class OConfigGroupSaver
* @todo make it not inline for bc reasons. See KDE BC guide
*/
~OConfigGroupSaver() { _config->setGroup( _oldgroup ); }
OConfig* config() { return _config; };
private:
OConfig* _config;
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
@@ -56,25 +56,26 @@
#include <stdlib.h> // abort
#include <unistd.h> // getpid
#include <stdarg.h> // vararg stuff
#include <ctype.h> // isprint
#include <syslog.h>
#include <errno.h>
#include <string.h>
#ifndef OPIE_NO_BACKTRACE
#include <execinfo.h>
#endif
-
+namespace Opie {
+namespace Core {
/*======================================================================================
* debug levels
*======================================================================================*/
enum DebugLevels {
ODEBUG_INFO = 0,
ODEBUG_WARN = 1,
ODEBUG_ERROR = 2,
ODEBUG_FATAL = 3
};
/*======================================================================================
@@ -605,16 +606,20 @@ QString odBacktrace( int levels )
#endif
return s;
}
void odClearDebugConfig()
{
/*
delete oDebug_data->config;
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
@@ -38,24 +38,27 @@
class QWidget;
class QDateTime;
class QDate;
class QTime;
class QPoint;
class QSize;
class QRect;
class QRegion;
class QStringList;
class QColor;
class QBrush;
+namespace Opie {
+namespace Core {
+
class odbgstream;
class ondbgstream;
#ifdef __GNUC__
#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] "
#else
#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
#endif
#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] "
#define owarn odWarning()
@@ -385,24 +388,28 @@ class ondbgstream {
ondbgstream &form(const char *, ...) { return *this; }
ondbgstream& operator<<( const QDateTime& ) { return *this; }
ondbgstream& operator<<( const QDate& ) { return *this; }
ondbgstream& operator<<( const QTime& ) { return *this; }
ondbgstream& operator<<( const QPoint & ) { return *this; }
ondbgstream& operator<<( const QSize & ) { return *this; }
ondbgstream& operator<<( const QRect & ) { return *this; }
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
*======================================================================================*/
/**
* Does nothing.
* @param a stream
* @return the given @p s
*/
inline ondbgstream& endl( ondbgstream & s) { return s; }
@@ -463,12 +470,14 @@ odbgstream odFatal(bool cond, int area = 0);
* Deletes the odebugrc cache and therefore forces KDebug to reread the
* config file
*/
void odClearDebugConfig();
#ifdef OPIE_NO_DEBUG
#define odDebug ondDebug
#define odBacktrace ondBacktrace
#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
@@ -29,24 +29,26 @@
#include <opie2/oglobal.h>
#include <qtextstream.h>
#include <qdir.h>
#include <qpe/mimetype.h>
#include <qpe/qpeapplication.h>
#include <qpe/storage.h>
#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,
0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F
};
@@ -303,36 +305,36 @@ QByteArray OGlobal::decodeBase64( const QByteArray& in) {
if (++didx < len )
out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
// Resize the output buffer
if ( len == 0 || len < out.size() )
out.resize(len);
return out;
}
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:
* This fun should check the document-path value for the mounted media
* which has to be implemented later. this moment we just check for a
* 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;
for (fs = fl.first();fs!=0;fs=fl.next()) {
if (fs->isRemovable()&&file.startsWith(fs->name()+QDir::separator()))
return true;
}
if (file.startsWith(homeDirPath())+"/Documents/") return true;
return false;
}
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
@@ -43,24 +43,29 @@
#endif
#include <sys/types.h>
//FIXME Is it wise or even necessary to inherit OGlobal from Global?
// once we totally skip libqpe it should ideally swallow Global -zecke
// You're right. I deleted global as the base class. -mickeyl
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
* which might be useful for other applications to use. It features access
* to the global device config and specialized functions to get information
* out of this config like Weekstart or Owner name.
*
* @todo ODP implement the things from Global which are good
* @author mickey,alwin,zecke
* @version 0.1
*/
@@ -137,15 +142,18 @@ public:
static void setWeekStartsOnMonday( bool );
static void setUseAMPM( bool );
//@}
//@{
static Global::Command* builtinCommands();
static QGuardedPtr<QWidget>* builtinRunning();
//@}
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
@@ -35,24 +35,27 @@
#include <opie2/oglobalsettings.h>
#include <opie2/oconfig.h>
#include <opie2/oglobal.h>
/* QT */
#include <qdir.h>
/* 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;
QFont *OGlobalSettings::_generalFont = 0;
QFont *OGlobalSettings::_fixedFont = 0;
QFont *OGlobalSettings::_toolBarFont = 0;
QFont *OGlobalSettings::_menuFont = 0;
QFont *OGlobalSettings::_windowTitleFont = 0;
QFont *OGlobalSettings::_taskbarFont = 0;
QColor *OGlobalSettings::OpieGray = 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
@@ -27,37 +27,43 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OGLOBALSETTINGS_H
#define OGLOBALSETTINGS_H
#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
#define OPIE_DEFAULT_LARGE_CURSOR false
#define OPIE_DEFAULT_VISUAL_ACTIVATE true
#define OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED 50
//FIXME: There's still a whole lot of stuff in here which has to be revised
//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.
*
*/
class OGlobalSettings
{
public:
/**
* Returns a threshold in pixels for drag & drop operations.
* As long as the mouse movement has not exceeded this number
* of pixels in either X or Y direction no drag operation may
@@ -359,15 +365,21 @@ private:
static QFont *_taskbarFont;
static QColor * kde2Gray;
static QColor * kde2Blue;
static QColor * kde2AlternateColor;
static OMouseSettings *s_mouseSettings;
static QColor * OpieGray;
static QColor * OpieBlue;
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
@@ -1,41 +1,39 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = oapplication.h \
oconfig.h \
odebug.h \
oglobal.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 ) {
LIBS = -lqpe
include ( $(OPIEDIR)/include.pro )
}
contains( platform, x11 ) {
LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
}
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
@@ -32,24 +32,26 @@
#include <sys/socket.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <qsocketnotifier.h>
#include "oprocctrl.h"
+using namespace Opie::Core::Private;
+
OProcessController *OProcessController::theOProcessController = 0;
struct sigaction OProcessController::oldChildHandlerData;
bool OProcessController::handlerSet = false;
OProcessController::OProcessController()
{
assert( theOProcessController == 0 );
if (0 > pipe(fd))
printf(strerror(errno));
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
@@ -25,27 +25,32 @@
// e9025461@student.tuwien.ac.at
// Ported by Holger Freyther
//
#ifndef __KPROCCTRL_H__
#define __KPROCCTRL_H__
#include <qvaluelist.h>
#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>
*
* A class for internal use by OProcess only. -- Exactly one instance
* of this class is generated by the first instance of OProcess that is
* created (a pointer to it gets stored in @ref theOProcessController ).
*
* This class takes care of the actual (UN*X) signal handling.
*/
class OProcessController : public QObject
@@ -106,16 +111,19 @@ private:
static struct sigaction oldChildHandlerData;
static bool handlerSet;
QValueList<OProcess*> processList;
QTimer delayedChildrenCleanupTimer;
// Disallow assignment and copy-construction
OProcessController( const OProcessController& );
OProcessController& operator= ( const OProcessController& );
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
@@ -52,36 +52,41 @@ _;:,     .>    :=|. This program is free software; you can
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <unistd.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_INITGROUPS
#include <grp.h>
#endif
+using namespace Opie::Core::Private;
+
+namespace Opie {
+namespace Core {
+namespace Private {
class OProcessPrivate
{
public:
OProcessPrivate() : useShell( false )
{ }
bool useShell;
QMap<QString, QString> env;
QString wd;
QCString shell;
};
-
+}
OProcess::OProcess( QObject *parent, const char *name )
: QObject( parent, name )
{
init ( );
}
OProcess::OProcess( const QString &arg0, QObject *parent, const char *name )
: QObject( parent, name )
{
init ( );
*this << arg0;
@@ -932,12 +937,15 @@ int OProcess::processPID( const QString& process )
}
if ( line.contains( process ) )
{
//qDebug( "found process id #%d", (*it).toInt() );
return (*it).toInt();
}
else
{
//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
@@ -34,25 +34,31 @@ _;:,     .>    :=|. This program is free software; you can
/* QT */
#include <qcstring.h>
#include <qobject.h>
#include <qvaluelist.h>
/* STD */
#include <sys/types.h> // for pid_t
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
class QSocketNotifier;
+
+namespace Opie {
+namespace Core {
+namespace Private {
+class OProcessController;
class OProcessPrivate;
+}
/**
* Child process invocation, monitoring and control.
*
* @sect General usage and features
*
*This class allows a KDE and OPIE application to start child processes without having
*to worry about UN*X signal handling issues and zombie process reaping.
*
*@see KProcIO
*
*Basically, this class distinguishes three different ways of running
@@ -388,24 +394,25 @@ public:
/**
* This causes the stderr file descriptor of the child process to be
* closed.
*
* @return @p false if no communication to the process's stderr
* had been specified in the call to @ref start().
*/
bool closeStderr();
/**
* Lets you see what your arguments are for debugging.
+ * \todo make const
*/
const QValueList<QCString> &args()
{
return arguments;
}
/**
* Controls whether the started process should drop any
* setuid/segid privileges or whether it should keep them
*
* The default is @p false : drop privileges
@@ -707,25 +714,25 @@ protected:
int childError( int fdno );
// information about the data that has to be sent to the child:
const char *input_data; // the buffer holding the data
int input_sent; // # of bytes already transmitted
int input_total; // total length of input_data
/**
* @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.
* Here is the algorithm used for finding an executable shell:
*
* @li Try the executable pointed to by the "SHELL" environment
* variable with white spaces stripped off
*
* @li If your process runs with uid != euid or gid != egid, a shell
* not listed in /etc/shells will not used.
*
@@ -736,17 +743,19 @@ private:
/**
* Used by @ref searchShell in order to find out whether the shell found
* is actually executable at all.
*/
bool isExecutable( const QCString &filename );
// Disallow assignment and copy-construction
OProcess( const OProcess& );
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
@@ -31,24 +31,25 @@ _;:, .> :=|. This program is free software; you can
#ifndef _OSmartPointer_h
#define _OSmartPointer_h
/*!
* \file OSmartPointer.h
* \brief smart pointer and reference counter
* \author Rajko Albrecht
*
*/
namespace Opie {
+namespace Core {
//! simple reference counter class
class ORefCount {
protected:
//! reference count member
long m_RefCount;
public:
//! first reference must be added after "new" via Pointer()
ORefCount() : m_RefCount(0)
{}
virtual ~ORefCount() {}
//! add a reference
@@ -131,15 +132,16 @@ public:
//! supports "if (pointer)"
operator bool () const { return (ptr != NULL); }
//! "if (pointer)" as non const
operator bool () { return ptr != NULL;}
//! support if (!pointer)"
bool operator! () const { return (ptr == NULL); }
//! support if (!pointer)" as non const
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
@@ -20,24 +20,26 @@
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/ostorageinfo.h>
+using namespace Opie::Core;
+
OStorageInfo::OStorageInfo( QObject *parent )
: StorageInfo( parent )
{
}
OStorageInfo::~OStorageInfo()
{
}
QString OStorageInfo::cfPath()const
{
QString r = "";
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
@@ -23,40 +23,48 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OSTORAGE_H
#define OSTORAGE_H
#include <qpe/storage.h>
+namespace Opie {
+namespace Core {
+
class OStorageInfo : public StorageInfo
{
Q_OBJECT
public:
OStorageInfo( QObject *parent=0 );
~OStorageInfo();
/**
* @returns the mount path of the CF (Compact Flash) card
*
**/
QString cfPath() const;
/**
* @returns the mount path of the SD (Secure Digital) card
*
**/
QString sdPath() const;
/**
* @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
@@ -1,9 +1,10 @@
* something like Capabilities of a Driver
- 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
@@ -12,25 +12,25 @@ HEADERS = osqlbackend.h \
osqlitedriver.h
SOURCES = osqlbackend.cpp \
osqldriver.cpp \
osqlerror.cpp \
osqlmanager.cpp \
osqlquery.cpp \
osqlresult.cpp \
osqltable.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
!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
}
contains( platform, x11 ) {
LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
}
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,15 +1,17 @@
#include "osqlbackend.h"
+using namespace Opie::DB;
+
OSQLBackEnd::OSQLBackEnd( const QString& name,
const QString& vendor,
const QString& license,
const QCString& lib )
: m_name( name), m_vendor( vendor), m_license( license ), m_lib( lib )
{
m_default = false;
m_pref = -1;
}
OSQLBackEnd::OSQLBackEnd( const OSQLBackEnd& back ) {
(*this) = back;
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
@@ -1,20 +1,23 @@
#ifndef OSQL_BACKEND_H
#define OSQL_BACKEND_H
#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
* 3rd party plugins.
* It's used to show
*/
class OSQLBackEnd /*: public QShared */ {
public:
typedef QValueList<OSQLBackEnd> ValueList;
/**
* A basic c'tor
@@ -61,15 +64,20 @@ public:
void setLibrary( const QCString& lib );
void setDefault( bool );
void setPreference( int );
private:
QString m_name;
QString m_vendor;
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
@@ -1,17 +1,21 @@
#include <qdir.h>
#include <qmap.h>
#include "osqlbackendmanager.h"
+/**
+ * \todo FIXME CONFIG!!!
+ */
+
namespace {
class Config {
typedef QMap<QString, QString> List;
public:
Config( const QString& fileName );
/**
* Quite simple layout in nature
* BeginFile
* Key = Value
*/
bool load();
QString value( const QString& key );
@@ -35,24 +39,28 @@ namespace {
for (it = list.begin(); it != list.end(); ++it ) {
line = (*it).stripWhiteSpace();
qWarning("Anonymous::Config:" + line );
QStringList test = QStringList::split(' ', line );
m_list.insert( test[0], test[2] );
}
return true;
}
QString Config::value( const QString& key ) {
return m_list[key];
}
};
+
+
+using namespace Opie::DB;
+
OSQLBackEndManager::OSQLBackEndManager( const QStringList& path )
:m_path( path )
{
}
OSQLBackEndManager::~OSQLBackEndManager() {
}
/**
* scan dirs
*/
OSQLBackEnd::ValueList OSQLBackEndManager::scan() {
OSQLBackEnd::ValueList list;
if (!m_path.isEmpty() ) {
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
@@ -1,20 +1,26 @@
#ifndef OSQL_BACKEND_MANAGER_H
#define OSQL_BACKEND_MANAGER_H
#include <qstringlist.h>
#include "osqlbackend.h"
+namespace Opie {
+namespace DB {
+
class OSQLBackEndManager {
public:
OSQLBackEndManager(const QStringList& path );
~OSQLBackEndManager();
OSQLBackEnd::ValueList scan();
private:
OSQLBackEnd::ValueList scanDir( const QString& dir );
OSQLBackEnd file2backend( const QString& file );
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,13 +1,15 @@
#include <qpe/qlibrary.h>
#include "osqldriver.h"
+using namespace Opie::DB;
+
OSQLDriver::OSQLDriver( QLibrary* lib )
: QObject(), m_lib(lib) {
}
OSQLDriver::~OSQLDriver() {
delete m_lib;
}
bool OSQLDriver::sync() {
return true;
}
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
@@ -1,21 +1,25 @@
#ifndef OSQL_DRIVER_H
#define OSQL_DRIVER_H
#include <qobject.h>
#include <qstring.h>
#include "osqltable.h"
class QLibrary;
+
+namespace Opie {
+namespace DB {
+
class OSQLResult;
class OSQLQuery;
class OSQLError;
/**
* A OSQLDriver implements the communication with
* a database.
* After you queried and loaded a driver you can
* set some informations and finally try to open
* the database
*
*/
@@ -75,13 +79,16 @@ public:
*/
virtual OSQLTable::ValueList tables() const = 0l;
virtual bool sync();
private:
QLibrary* m_lib;
class OSQLDriverPrivate;
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,14 +1,16 @@
#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 ),
m_type( type ), m_number( subType )
{
}
OSQLError::~OSQLError() {
}
QString OSQLError::driverText()const {
return m_drvText;
}
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
@@ -1,18 +1,21 @@
#ifndef OSQL_ERROR_H
#define OSQL_ERROR_H
#include <qstring.h>
#include <qvaluelist.h>
+
+namespace Opie {
+namespace DB {
/**
* OSQLError is the base class of all errors
*/
class OSQLError {
public:
typedef QValueList<OSQLError> ValueList;
enum Type { None = 0, // NoError
Internal, // Internal Error in OSQL
Unknown, // Unknown Error
Transaction, // Transaction Error
Statement, // Wrong Statement
Connection, // Connection Error( lost )
@@ -47,13 +50,15 @@ public:
QString databaseText()const;
int type()const;
int subNumber()const;
private:
QString m_drvText;
QString m_drvDBText;
int m_type;
int m_number;
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
@@ -31,24 +31,27 @@
#include "osqlquery.h"
#include "osqlitedriver.h"
#include <opie2/odebug.h>
#include <stdlib.h>
// fromLocal8Bit() does not work as expected. Thus it
// 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;
OSQLiteDriver *driver;
};
}
OSQLiteDriver::OSQLiteDriver( QLibrary *lib )
: OSQLDriver( lib )
{
@@ -77,33 +80,33 @@ void OSQLiteDriver::setUrl( const QString& url ) {
void OSQLiteDriver::setOptions( const QStringList& ) {
}
/*
* try to open a db specified via setUrl
* 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;
}
/* close the db
* sqlite closes them without
* telling failure or success
*/
bool OSQLiteDriver::close() {
@@ -117,25 +120,25 @@ bool OSQLiteDriver::close() {
/* Query */
OSQLResult OSQLiteDriver::query( OSQLQuery* qu) {
if ( !m_sqlite ) {
// FIXME set error code
OSQLResult result( OSQLResult::Failure );
return result;
}
Query query;
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
}
OSQLResult result(OSQLResult::Success,
query.items,
query.errors );
return result;
}
OSQLTable::ValueList OSQLiteDriver::tables() const {
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
@@ -1,34 +1,42 @@
#ifndef OSQL_LITE_DRIVER_H
#define OSQL_LITE_DRIVER_H
#include <sqlite.h>
#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 );
~OSQLiteDriver();
QString id()const;
void setUserName( const QString& );
void setPassword( const QString& );
void setUrl( const QString& url );
void setOptions( const QStringList& );
bool open();
bool close();
OSQLError lastError();
OSQLResult query( OSQLQuery* );
OSQLTable::ValueList tables()const;
private:
OSQLError m_lastE;
OSQLResult m_result;
OSQLResultItem m_items;
int handleCallBack( int, char**, char** );
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
@@ -1,19 +1,21 @@
#include <stdlib.h>
#include "osqlmanager.h"
#include "osqlbackendmanager.h"
#include "osqlitedriver.h"
+using namespace Opie::DB;
+
OSQLManager::OSQLManager() {
}
OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
m_list.clear();
QString opie = QString::fromLatin1( getenv("OPIEDIR") );
QString qpe = QString::fromLatin1( getenv("QPEDIR") );
if ( !m_path.contains(opie) && !opie.isEmpty() )
m_path << opie;
if ( !m_path.contains(qpe) && !qpe.isEmpty() )
m_path << qpe;
@@ -22,36 +24,36 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
m_list += builtIn();
return m_list;
}
/*
* loading dso's is currently not enabled due problems with QLibrary
* beeing in libqpe and not libqte
*/
OSQLDriver* OSQLManager::load( const QString& name ) {
OSQLDriver* driver = 0l;
if ( name == "SQLite" ) {
- driver = new OSQLiteDriver();
+ driver = new Opie::DB::Private::OSQLiteDriver;
}
return driver;
}
/*
* same as above
*/
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;
}
/*
* let's find the a default with the highes preference
*/
OSQLDriver* OSQLManager::standard() {
OSQLDriver* driver =0l;
if ( m_list.isEmpty() ) queryBackEnd();
OSQLBackEnd::ValueList::Iterator it;
OSQLBackEnd back;
for ( it = m_list.begin(); it != m_list.end(); ++it ) {
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
@@ -1,22 +1,24 @@
#ifndef OSQL_MANAGER_H
#define OSQL_MANAGER_H
#include <qobject.h>
#include <qstringlist.h>
#include "osqlbackend.h"
+namespace Opie {
+namespace DB {
/**
* OSQLManager is responsible for loading
* and unloading, querying different OSQL
* services
* Load a OSQLDriver and delete it yourself
*
*/
class OSQLDriver;
class OSQLManager : public QObject {
Q_OBJECT
public:
/**
@@ -50,15 +52,19 @@ public:
* registered path for backends
*/
void registerPath( const QString& path );
/**
* unregisterPath from the search path list
*/
bool unregisterPath( const QString& path );
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,15 +1,17 @@
#include "osqlquery.h"
+using namespace Opie::DB;
+
OSQLQuery::OSQLQuery() {
}
OSQLQuery::~OSQLQuery() {
}
OSQLRawQuery::OSQLRawQuery(const QString& query)
: OSQLQuery(), m_query( query ) {
}
OSQLRawQuery::~OSQLRawQuery() {
}
QString OSQLRawQuery::query()const {
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
@@ -1,21 +1,24 @@
#ifndef OSQL_QUERY_H
#define OSQL_QUERY_H
#include <qmap.h>
#include <qvaluelist.h>
#include <qstring.h>
+namespace Opie {
+namespace DB {
+
/** I'm not happy with them
class OSQLQueryOrder {
public:
typedef QValueList<OSQLQueryOrder> ValueList;
OSQLQueryOrder(const QString& table = QString::null );
OSQLQueryOrder( const OSQLQueryOrder& );
~OSQLQueryOrder();
void setOrderFields( const QStringList& list );
void setValue( const QString& fieldName, const QString& Value );
void setValues( const QMap<QString, QString>& );
QMap<QString, QString> orders() const;
QString orderStatement()const;
@@ -38,24 +41,27 @@ private:
int m_vergleich;
const QString& m_left;
const QString& m_right;
};
*/
class OSQLQuery {
public:
OSQLQuery();
virtual ~OSQLQuery();
virtual QString query()const = 0;
+private:
+ class Private;
+ Private *d;
};
class OSQLRawQuery : public OSQLQuery {
public:
OSQLRawQuery( const QString& query );
~OSQLRawQuery();
QString query() const;
private:
class OSQLRawQueryPrivate;
OSQLRawQueryPrivate* d;
QString m_query;
@@ -110,13 +116,15 @@ public:
OSQLUpdateQuery( const QString& table );
~OSQLUpdateQuery();
void setWhere( const OSQLWhere& );
void setWheres( const OSQLWhere::ValueList& );
*/
/* replaces all previous set Values */
/*
void setValue( const QString& field, const QString& value );
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,15 +1,17 @@
#include "osqlresult.h"
+using namespace Opie::DB;
+
OSQLResultItem::OSQLResultItem( const TableString& string,
const TableInt& Int)
: m_string( string ), m_int( Int )
{
}
OSQLResultItem::~OSQLResultItem() {
}
OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) {
*this = item;
}
OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) {
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
@@ -1,21 +1,25 @@
#ifndef OSQL_RESULT_H
#define OSQL_RESULT_H
#include <qdatetime.h>
#include <qmap.h>
#include <qvaluelist.h>
#include "osqlerror.h"
+
+namespace Opie {
+namespace DB {
+
/**
* ResultItem represents one row of the resulting answer
*/
class OSQLResultItem {
public:
typedef QValueList<OSQLResultItem> ValueList;
/**
* TableString is used to establish the relations
* between the column name and the real item
*/
typedef QMap<QString, QString> TableString;
@@ -98,15 +102,19 @@ public:
void setErrors( const OSQLError::ValueList& error );
void setResults( const OSQLResultItem::ValueList& result );
OSQLResultItem first();
OSQLResultItem next();
bool atEnd();
OSQLResultItem::ValueList::ConstIterator iterator()const;
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,14 +1,16 @@
#include "osqltable.h"
+using namespace Opie::DB;
+
OSQLTableItem::OSQLTableItem() {}
OSQLTableItem::OSQLTableItem( enum Type type,
const QString& field,
const QVariant& var)
: m_type( type ), m_field( field ), m_var( var )
{
}
OSQLTableItem::~OSQLTableItem() {}
OSQLTableItem::OSQLTableItem( const OSQLTableItem& item) {
*this = item;
}
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
@@ -1,19 +1,21 @@
#ifndef OSQL_TABLE_H
#define OSQL_TABLE_H
#include <qstring.h>
#include <qvaluelist.h>
#include <qvariant.h>
+namespace Opie {
+namespace DB {
/**
* OSQLTableItem saves one column of a complete
* table
*/
class OSQLTableItem {
public:
typedef QValueList<OSQLTableItem> ValueList;
/**
* Type kinds ( to be extended )
*/
enum Type { Undefined=-1, Integer=0, BigInteger =1,
Float = 2, VarChar = 4 };
@@ -81,15 +83,20 @@ public:
void setColumns( const OSQLTableItem::ValueList& );
/**
* returns all columns of the table
*/
OSQLTableItem::ValueList columns() const;
QString tableName()const;
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
@@ -1,18 +1,18 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
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 ) {
include ( $(OPIEDIR)/include.pro )
}
contains( platform, x11 ) {
LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
}
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
@@ -32,24 +32,26 @@
#include <opie2/osoundsystem.h>
#include <opie2/odebug.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/soundcard.h>
#include <sys/stat.h>
+using namespace Opie::Core;
+using namespace Opie::MM;
/*======================================================================================
* OSoundSystem
*======================================================================================*/
OSoundSystem* OSoundSystem::_instance = 0;
OSoundSystem::OSoundSystem()
{
odebug << "OSoundSystem::OSoundSystem()" << oendl;
synchronize();
}
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
@@ -27,24 +27,27 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OSOUNDSYSTEM_H
#define OSOUNDSYSTEM_H
#include <qobject.h>
#include <qdict.h>
#include <qmap.h>
+namespace Opie {
+namespace MM {
+
class OAudioInterface;
class OMixerInterface;
class OSoundCard;
/*======================================================================================
* OSoundSystem
*======================================================================================*/
/**
* @brief A container class for all audio interfaces
*
* This class provides access to all available audio/midi/sequencer interfaces of your computer.
@@ -81,24 +84,26 @@ class OSoundSystem : public QObject
* @internal Rebuild the internal interface database
* @note Sometimes it might be useful to call this from client code,
* e.g. after issuing a cardctl insert
*/
void synchronize();
protected:
OSoundSystem();
private:
static OSoundSystem* _instance;
CardMap _interfaces;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OSoundCard
*======================================================================================*/
class OSoundCard : public QObject
{
Q_OBJECT
public:
@@ -115,24 +120,27 @@ class OSoundCard : public QObject
bool hasMixer() const { return _audio; };
bool hasAudio() const { return _mixer; };
OAudioInterface* audio() const { return _audio; };
OMixerInterface* mixer() const { return _mixer; };
protected:
OAudioInterface* _audio;
OMixerInterface* _mixer;
private:
void init();
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OAudioInterface
*======================================================================================*/
class OAudioInterface : public QObject
{
Q_OBJECT
public:
/**
@@ -141,24 +149,27 @@ class OAudioInterface : public QObject
*/
OAudioInterface( QObject* parent, const char* name );
/**
* Destructor.
*/
virtual ~OAudioInterface();
protected:
const int _sfd;
private:
void init();
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OMixerInterface
*======================================================================================*/
class OMixerInterface : public QObject
{
Q_OBJECT
public:
@@ -201,16 +212,22 @@ class OMixerInterface : public QObject
/**
* @returns the volume of @a channel or -1, if the channel doesn't exist.
* @note You might want to use @ref hasChannel() to check if a channel exists.
*/
int volume( const QString& channel ) const;
protected:
int _fd;
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
@@ -446,13 +446,14 @@ struct ctrl_end_ack_t {
u_int16_t duration;
u_int8_t ra[6];
u_int8_t bssid[6];
u_int8_t fcs[4];
};
#define CTRL_END_ACK_LEN (2+2+6+6+4)
#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
@@ -33,24 +33,25 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This software has been written for the Internet Software Consortium
* by Ted Lemon in cooperation with Vixie Enterprises. To learn more
* about the Internet Software Consortium, see ``http://www.isc.org''.
* To learn more about Vixie Enterprises, see ``http://www.vix.com''.
*/
#ifndef DHCP_H
#define DHCP_H
+
#define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \
20 + /* IP header */ \
8) /* UDP header */
#define DHCP_SNAME_LEN 64
#define DHCP_FILE_LEN 128
#define DHCP_FIXED_NON_UDP 236
#define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD)
/* Everything but options. */
#define DHCP_MTU_MAX 1500
#define DHCP_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN)
#define BOOTP_MIN_LEN 300
@@ -188,14 +189,15 @@ struct dhcp_packet {
/* FQDN suboptions: */
#define FQDN_NO_CLIENT_UPDATE 1
#define FQDN_SERVER_UPDATE 2
#define FQDN_ENCODED 3
#define FQDN_RCODE1 4
#define FQDN_RCODE2 5
#define FQDN_HOSTNAME 6
#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
@@ -1,21 +1,27 @@
/*
* debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
*/
#include <opie2/odebug.h>
#include "odebugmapper.h"
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
+namespace Private {
+
DebugMapper::DebugMapper()
{
odebug << "DebugMapper::DebugMapper()" << oendl;
_map.insert( 0x8902, new QString("SIOCSPGRP") );
_map.insert( 0x8904, new QString("SIOCGPGRP") );
_map.insert( 0x8905, new QString("SIOCATMARK") );
_map.insert( 0x8906, new QString("SIOCGSTAMP") );
_map.insert( 0x890B, new QString("SIOCADDRT") );
_map.insert( 0x890C, new QString("SIOCDELRT") );
_map.insert( 0x890D, new QString("SIOCRTMSG") );
@@ -203,13 +209,15 @@ const QString& DebugMapper::map( int value ) const
if ( !result )
{
owarn << "DebugMapper::map() - value " << value << " is not found." << oendl;
return QString::null;
}
else
{
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
@@ -1,26 +1,36 @@
/*
* debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
*/
#ifndef DEBUGMAPPER_H
#define DEBUGMAPPER_H
#include <qstring.h>
#include <qintdict.h>
+namespace Opie {
+namespace Net {
+namespace Private {
+
typedef QIntDict<QString> IntStringMap;
class DebugMapper
{
public:
DebugMapper();
~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
@@ -34,24 +34,28 @@
/* OPIE */
#include <opie2/odebug.h>
#ifdef OPIE_IMPROVE_GUI_LATENCY
#include <qpe/global.h>
#endif
/* QT */
#include <qapplication.h>
#include <qfile.h>
#include <qtextstream.h>
+using namespace Opie::Core;
+namespace Opie {
+namespace Net {
+
OManufacturerDB* OManufacturerDB::_instance = 0;
OManufacturerDB* OManufacturerDB::instance()
{
if ( !OManufacturerDB::_instance )
{
odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl;
_instance = new OManufacturerDB();
}
return _instance;
}
@@ -124,12 +128,15 @@ OManufacturerDB::~OManufacturerDB()
const QString& OManufacturerDB::lookup( const QString& macaddr ) const
{
return manufacturers[macaddr.upper().left(8)];
}
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
@@ -24,24 +24,27 @@
    --        :-=` 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 OMANUFACTURERDB_H
#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
* certain Mac Address. Only the first three bytes define the vendor.
*/
class OManufacturerDB
{
public:
/**
* @returns the one-and-only @ref OManufacturerDB instance.
*/
@@ -54,16 +57,21 @@ class OManufacturerDB
* @returns the enhanced manufacturer string given a @a macaddr.
*/
const QString& lookupExt( const QString& macaddr ) const;
protected:
OManufacturerDB();
virtual ~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
@@ -28,24 +28,27 @@
Boston, MA 02111-1307, USA.
*/
#include <opie2/onetutils.h>
#include <opie2/onetwork.h>
#include <opie2/omanufacturerdb.h>
#include <net/if.h>
#include <assert.h>
#include <stdio.h>
+namespace Opie {
+namespace Net {
+
/*======================================================================================
* OMacAddress
*======================================================================================*/
// static initializer for broadcast and unknown MAC Adresses
const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast );
const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 };
const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown );
//TODO: Incorporate Ethernet Manufacturer database here! (inline or so)
@@ -176,24 +179,27 @@ int OPrivateIOCTL::typeSetArgs() const
void OPrivateIOCTL::invoke() const
{
( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl );
}
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
*======================================================================================*/
void dumpBytes( const unsigned char* data, int num )
{
printf( "Dumping %d bytes @ %0x", num, data );
printf( "-------------------------------------------\n" );
for ( int i = 0; i < num; ++i )
{
printf( "%02x ", data[i] );
@@ -221,12 +227,15 @@ QString modeToString( int mode )
switch ( mode )
{
case IW_MODE_AUTO: return "auto";
case IW_MODE_ADHOC: return "adhoc";
case IW_MODE_INFRA: return "managed";
case IW_MODE_MASTER: return "master";
case IW_MODE_REPEAT: return "repeater";
case IW_MODE_SECOND: return "second";
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
@@ -32,24 +32,28 @@
#ifndef ONETUTILS_H
#define ONETUTILS_H
#include <qdict.h>
#include <qmap.h>
#include <qstring.h>
#include <qhostaddress.h>
#include <qobject.h>
#include <sys/types.h>
struct ifreq;
+
+namespace Opie {
+namespace Net {
+
class OWirelessNetworkInterface;
/*======================================================================================
* OMacAddress
*======================================================================================*/
class OMacAddress
{
public:
// QString c'tor? -zecke
OMacAddress();
OMacAddress( unsigned char* );
@@ -63,40 +67,45 @@ class OMacAddress
// no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem?
static OMacAddress fromString( const QString& );
public:
static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff
static const OMacAddress& unknown; // 44:44:44:44:44:44
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 );
/*======================================================================================
* OHostAddress
*======================================================================================*/
class OHostAddress : public QHostAddress
{
/*public:
OHostAddress();
~OHostAddress();
*/
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OPrivateIOCTL
*======================================================================================*/
class OPrivateIOCTL : public QObject
{
public:
OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs );
~OPrivateIOCTL();
@@ -106,33 +115,39 @@ class OPrivateIOCTL : public QObject
int numberSetArgs() const;
int typeSetArgs() const;
// FIXME return int? as ::ioctl does? -zecke
void invoke() const;
void setParameter( int, u_int32_t );
private:
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
#define IW_PRIV_TYPE_CHAR 0x2000
#define IW_PRIV_TYPE_INT 0x4000
#define IW_PRIV_TYPE_FLOAT 0x5000
#define IW_PRIV_TYPE_ADDR 0x6000
#define IW_PRIV_SIZE_FIXED 0x0800
#define IW_PRIV_SIZE_MASK 0x07FF
#ifndef ARPHRD_IEEE80211
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
@@ -48,31 +48,37 @@
#include <stdlib.h>
#include <math.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <net/if_arp.h>
#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()
{
odebug << "ONetwork::ONetwork()" << oendl;
odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl;
synchronize();
}
void ONetwork::synchronize()
{
// gather available interfaces by inspecting /proc/net/dev
@@ -1228,12 +1234,15 @@ void OOrinocoMonitoringInterface::setEnabled( bool b )
}
else
{
_if->setPrivate( "monitor", 2, 0, 0 );
}
}
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
@@ -47,24 +47,27 @@
#include <opie2/onetutils.h>
#include <opie2/ostation.h>
/* QT */
#include <qvaluelist.h>
#include <qdict.h>
#include <qmap.h>
#include <qobject.h>
#include <qhostaddress.h>
+namespace Opie {
+namespace Net {
+
class ONetworkInterface;
class OWirelessNetworkInterface;
class OChannelHopper;
class OMonitoringInterface;
/*======================================================================================
* ONetwork
*======================================================================================*/
/**
* @brief A container class for all network interfaces
*
@@ -114,24 +117,26 @@ class ONetwork : public QObject
void synchronize();
/**
* @returns the wireless extension version used at compile time.
**/
static short wirelessExtensionVersion();
protected:
ONetwork();
private:
static ONetwork* _instance;
InterfaceMap _interfaces;
+ class Private;
+ Private *d;
};
/*======================================================================================
* ONetworkInterface
*======================================================================================*/
/**
* @brief A network interface wrapper.
*
* This class provides a wrapper for a network interface. All the cumbersume details of
* Linux ioctls are hidden under a convenient high-level interface.
@@ -225,24 +230,27 @@ class ONetworkInterface : public QObject
int dataLinkType() const;
protected:
const int _sfd;
mutable ifreq _ifr;
OMonitoringInterface* _mon;
protected:
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
*======================================================================================*/
/**
* @brief A radio frequency channel hopper.
*
* This class provides a channel hopper for radio frequencies. A channel hopper frequently
* changes the radio frequency channel of its associated @ref OWirelessNetworkInterface.
* This is necessary when in monitoring mode and scanning for other devices, because
@@ -287,24 +295,26 @@ class OChannelHopper : public QObject
*/
void hopped( int );
protected:
virtual void timerEvent( QTimerEvent* );
private:
OWirelessNetworkInterface* _iface;
int _interval;
int _tid;
QValueList<int> _channels;
QValueList<int>::Iterator _channel;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWirelessNetworkInterface
*======================================================================================*/
/**
* @brief A network interface wrapper for interfaces supporting the wireless extensions protocol.
*
* This class provides a high-level encapsulation of the Linux wireless extension API.
*
@@ -446,114 +456,135 @@ class OWirelessNetworkInterface : public ONetworkInterface
virtual void init();
struct iwreq& iwr() const;
bool wioctl( int call ) const;
bool wioctl( int call, struct iwreq& ) const;
protected:
mutable struct iwreq _iwr;
QMap<int,int> _channels;
struct iw_range _range;
private:
OChannelHopper* _hopper;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OMonitoringInterface
*======================================================================================*/
class OMonitoringInterface
{
public:
OMonitoringInterface();
OMonitoringInterface( ONetworkInterface*, bool _prismHeader );
virtual ~OMonitoringInterface();
public:
virtual void setEnabled( bool );
virtual void setChannel( int );
virtual QString name() const = 0;
protected:
OWirelessNetworkInterface* _if;
bool _prismHeader;
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OCiscoMonitoring
*======================================================================================*/
class OCiscoMonitoringInterface : public OMonitoringInterface
{
public:
OCiscoMonitoringInterface( ONetworkInterface*, bool _prismHeader );
virtual ~OCiscoMonitoringInterface();
virtual void setEnabled( bool );
virtual QString name() const;
virtual void setChannel( int );
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWlanNGMonitoringInterface
*======================================================================================*/
class OWlanNGMonitoringInterface : public OMonitoringInterface
{
public:
OWlanNGMonitoringInterface( ONetworkInterface*, bool _prismHeader );
virtual ~OWlanNGMonitoringInterface();
public:
virtual void setEnabled( bool );
virtual QString name() const;
virtual void setChannel( int );
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OHostAPMonitoringInterface
*======================================================================================*/
class OHostAPMonitoringInterface : public OMonitoringInterface
{
public:
OHostAPMonitoringInterface( ONetworkInterface*, bool _prismHeader );
virtual ~OHostAPMonitoringInterface();
public:
virtual void setEnabled( bool );
virtual QString name() const;
+
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OOrinocoMonitoringInterface
*======================================================================================*/
class OOrinocoMonitoringInterface : public OMonitoringInterface
{
public:
OOrinocoMonitoringInterface( ONetworkInterface*, bool _prismHeader );
virtual ~OOrinocoMonitoringInterface();
public:
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
@@ -36,24 +36,29 @@
#include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects)
#include <qsocketnotifier.h>
#include <qobjectlist.h>
/* SYSTEM */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
/* LOCAL */
#include "udp_ports.h"
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
+
/*======================================================================================
* OPacket
*======================================================================================*/
OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* data, QObject* parent )
:QObject( parent, "Generic" ), _hdr( header ), _data( data )
{
//qDebug( "OPacket::OPacket(): (Len %d, CapLen %d)" /*, ctime((const time_t*) header.ts.tv_sec)*/, header.len, header.caplen );
_end = (unsigned char*) data + header.len;
//qDebug( "OPacket::data @ %0x, end @ %0x", data, _end );
@@ -1335,13 +1340,14 @@ int OPacketCapturer::snapShot() const
bool OPacketCapturer::swapped() const
{
return pcap_is_swapped( _pch );
}
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
@@ -55,26 +55,28 @@ extern "C" // work around a bpf/pcap conflict in recent headers
#include <time.h>
/* Custom Network Includes (must go here, don't reorder!) */
#include "802_11_user.h"
#include "dhcp.h"
/* TYPEDEFS */
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
*======================================================================================*/
/** @brief A class representing a data frame on the wire.
*
* The whole family of the packet classes are used when capturing frames from a network.
* Most standard network protocols in use share a common architecture, which mostly is
* a packet header and then the packet payload. In layered architectures, each lower layer
* encapsulates data from its upper layer - that is it
* treats the data from its upper layer as payload and prepends an own header to the packet,
@@ -132,64 +134,72 @@ class OPacket : public QObject
void updateStats( QMap<QString,int>&, QObjectList* );
private:
QString dumpStructure() const;
QString _dumpStructure( QObjectList* ) const;
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 );
/*======================================================================================
* OEthernetPacket - DLT_EN10MB frame
*======================================================================================*/
class OEthernetPacket : public QObject
{
Q_OBJECT
public:
OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 );
virtual ~OEthernetPacket();
OMacAddress sourceAddress() const;
OMacAddress destinationAddress() const;
int type() const;
private:
const struct ether_header* _ether;
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* OPrismHeaderPacket - DLT_PRISM_HEADER frame
*======================================================================================*/
class OPrismHeaderPacket : public QObject
{
Q_OBJECT
public:
OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 );
virtual ~OPrismHeaderPacket();
unsigned int signalStrength() const;
private:
const struct prism_hdr* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanPacket - DLT_IEEE802_11 frame
*======================================================================================*/
class OWaveLanPacket : public QObject
{
Q_OBJECT
public:
OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 );
@@ -201,24 +211,26 @@ class OWaveLanPacket : public QObject
virtual OMacAddress macAddress1() const;
virtual OMacAddress macAddress2() const;
virtual OMacAddress macAddress3() const;
virtual OMacAddress macAddress4() const;
bool usesPowerManagement() const;
int type() const;
int subType() const;
int version() const;
bool usesWep() const;
private:
const struct ieee_802_11_header* _wlanhdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementPacket - type: management (T_MGMT)
*======================================================================================*/
class OWaveLanManagementPacket : public QObject
{
Q_OBJECT
public:
@@ -230,207 +242,231 @@ class OWaveLanManagementPacket : public QObject
int beaconInterval() const;
int capabilities() const; // generic
bool canESS() const;
bool canIBSS() const;
bool canCFP() const;
bool canCFP_REQ() const;
bool canPrivacy() const;
private:
const struct ieee_802_11_mgmt_header* _header;
const struct ieee_802_11_mgmt_body* _body;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementSSID
*======================================================================================*/
class OWaveLanManagementSSID : public QObject
{
Q_OBJECT
public:
OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementSSID();
QString ID( bool decloak = false ) const;
private:
const struct ssid_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementRates
*======================================================================================*/
class OWaveLanManagementRates : public QObject
{
Q_OBJECT
public:
OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementRates();
private:
const struct rates_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementCF
*======================================================================================*/
class OWaveLanManagementCF : public QObject
{
Q_OBJECT
public:
OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementCF();
private:
const struct cf_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementFH
*======================================================================================*/
class OWaveLanManagementFH : public QObject
{
Q_OBJECT
public:
OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementFH();
private:
const struct fh_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementDS
*======================================================================================*/
class OWaveLanManagementDS : public QObject
{
Q_OBJECT
public:
OWaveLanManagementDS( const unsigned char*, const struct ds_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementDS();
int channel() const;
private:
const struct ds_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementTim
*======================================================================================*/
class OWaveLanManagementTim : public QObject
{
Q_OBJECT
public:
OWaveLanManagementTim( const unsigned char*, const struct tim_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementTim();
private:
const struct tim_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementIBSS
*======================================================================================*/
class OWaveLanManagementIBSS : public QObject
{
Q_OBJECT
public:
OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementIBSS();
private:
const struct ibss_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanManagementChallenge
*======================================================================================*/
class OWaveLanManagementChallenge : public QObject
{
Q_OBJECT
public:
OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementChallenge();
private:
const struct challenge_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanDataPacket - type: data (T_DATA)
*======================================================================================*/
class OWaveLanDataPacket : public QObject
{
Q_OBJECT
public:
OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 );
virtual ~OWaveLanDataPacket();
private:
const struct ieee_802_11_data_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OWaveLanControlPacket - type: control (T_CTRL)
*======================================================================================*/
class OWaveLanControlPacket : public QObject
{
Q_OBJECT
public:
OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 );
virtual ~OWaveLanControlPacket();
QString controlType() const;
private:
const struct ieee_802_11_control_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OLLCPacket - IEEE 802.2 Link Level Control
*======================================================================================*/
class OLLCPacket : public QObject
{
Q_OBJECT
public:
OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 );
virtual ~OLLCPacket();
private:
const struct ieee_802_11_802_2_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OIPPacket
*======================================================================================*/
class OIPPacket : public QObject
{
Q_OBJECT
public:
OIPPacket( const unsigned char*, const struct iphdr*, QObject* parent = 0 );
@@ -440,69 +476,75 @@ class OIPPacket : public QObject
QHostAddress toIPAddress() const;
int tos() const;
int len() const;
int id() const;
int offset() const;
int ttl() const;
int protocol() const;
int checksum() const;
private:
const struct iphdr* _iphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OARPPacket
*======================================================================================*/
class OARPPacket : public QObject
{
Q_OBJECT
public:
OARPPacket( const unsigned char*, const struct myarphdr*, QObject* parent = 0 );
virtual ~OARPPacket();
QHostAddress senderIPV4Address() const;
OMacAddress senderMacAddress() const;
QHostAddress targetIPV4Address() const;
OMacAddress targetMacAddress() const;
//int type() const;
QString type() const;
private:
const struct myarphdr* _arphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OUDPPacket
*======================================================================================*/
class OUDPPacket : public QObject
{
Q_OBJECT
public:
OUDPPacket( const unsigned char*, const struct udphdr*, QObject* parent = 0 );
virtual ~OUDPPacket();
int fromPort() const;
int toPort() const;
int length() const;
int checksum() const;
private:
const struct udphdr* _udphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
* ODHCPPacket
*======================================================================================*/
class ODHCPPacket : public QObject
{
Q_OBJECT
public:
ODHCPPacket( const unsigned char*, const struct dhcp_packet*, QObject* parent = 0 );
@@ -513,47 +555,51 @@ class ODHCPPacket : public QObject
QHostAddress serverAddress() const;
QHostAddress relayAddress() const;
OMacAddress clientMacAddress() const;
bool isRequest() const;
bool isReply() const;
QString type() const;
private:
const struct dhcp_packet* _dhcphdr;
unsigned char _type;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OTCPPacket
*======================================================================================*/
class OTCPPacket : public QObject
{
Q_OBJECT
public:
OTCPPacket( const unsigned char*, const struct tcphdr*, QObject* parent = 0 );
virtual ~OTCPPacket();
int fromPort() const;
int toPort() const;
int seq() const;
int ack() const;
int window() const;
int checksum() const;
private:
const struct tcphdr* _tcphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
* OPacketCapturer
*======================================================================================*/
/**
* @brief A class based wrapper for network packet capturing.
*
* This class is the base of a high-level interface to the well known packet capturing
* library libpcap.
@@ -656,16 +702,20 @@ class OPacketCapturer : public QObject
protected slots:
void readyToReceive();
protected:
QString _name; // devicename
bool _open; // check this before doing pcap calls
pcap_t* _pch; // pcap library handle
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
@@ -22,24 +22,29 @@
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/ostation.h>
#include <opie2/odebug.h>
+
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
/*======================================================================================
* OStation
*======================================================================================*/
OStation::OStation()
{
odebug << "OStation::OStation()" << oendl;
type = "<unknown>";
macAddress = OMacAddress::unknown;
ssid = "<unknown>";
channel = 0;
@@ -53,12 +58,15 @@ OStation::~OStation()
odebug << "OStation::~OStation()" << oendl;
}
void OStation::dump()
{
odebug << "------- OStation::dump() ------------" << oendl;
qDebug( "type: %s", (const char*) type );
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
@@ -31,43 +31,52 @@
#ifndef OSTATION_H
#define OSTATION_H
#include <opie2/onetutils.h>
#include <qlist.h>
#include <qstring.h>
#include <qhostaddress.h>
#include <qobject.h>
#include <sys/types.h>
+namespace Opie {
+namespace Net {
+
class OStation;
+
typedef QList<OStation> OStationList;
/*======================================================================================
* OStation
*======================================================================================*/
class OStation
{
public:
OStation();
~OStation();
void dump();
/* Ethernet */
QString type;
OMacAddress macAddress;
QHostAddress ipAddress;
/* WaveLan */
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
@@ -1,31 +1,33 @@
SOURCES += core/backends/ocontactaccessbackend_sql.cpp \
core/backends/ocontactaccessbackend_vcard.cpp \
core/backends/ocontactaccessbackend_xml.cpp \
core/backends/ocontactaccess.cpp \
core/backends/odatebookaccessbackend.cpp \
core/backends/odatebookaccessbackend_xml.cpp \
core/backends/otodoaccessbackend.cpp \
core/backends/otodoaccess.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 \
core/backends/ocontactaccessbackend_vcard.h \
core/backends/ocontactaccessbackend_xml.h \
core/backends/ocontactaccess.h \
core/backends/odatebookaccessbackend.h \
core/backends/odatebookaccessbackend_sql.h \
core/backends/odatebookaccessbackend_xml.h \
core/backends/opimaccessbackend.h \
core/backends/opimaccesstemplate.h \
core/backends/otodoaccessbackend.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
@@ -37,25 +37,25 @@
#include <qstringlist.h>
#include <qpe/global.h>
#include <qpe/recordfields.h>
#include <opie2/opimcontactfields.h>
#include <opie2/opimdateconversion.h>
#include <opie2/osqldriver.h>
#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".
// DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !!
#define __STORE_HORIZONTAL_
// Distinct loading is not very fast. If I expect that every person has just
// one (and always one) 'Last Name', I can request all uid's for existing lastnames,
// which is faster..
// But this may not be true for all entries, like company contacts..
// The current AddressBook application handles this problem, but other may not.. (eilers)
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
@@ -31,27 +31,31 @@
*/
#ifndef _OPimContactAccessBackend_SQL_
#define _OPimContactAccessBackend_SQL_
#include <opie2/ocontactaccessbackend.h>
#include <opie2/ocontactaccess.h>
#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 */
/**
* This class is the SQL implementation of a Contact backend
* it does implement everything available for OPimContact.
* @see OPimAccessBackend for more information of available methods
*/
class OPimContactAccessBackend_SQL : public OPimContactAccessBackend {
public:
OPimContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null );
@@ -82,28 +86,28 @@ class OPimContactAccessBackend_SQL : public OPimContactAccessBackend {
bool hasQuerySettings (uint querySettings) const;
// Currently only asc implemented..
QArray<int> sorted( bool asc, int , int , int );
bool add ( const OPimContact &newcontact );
bool replace ( const OPimContact &contact );
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();
protected:
bool m_changed;
QString m_fileName;
QArray<int> m_uids;
- OSQLDriver* m_driver;
+ Opie::DB::OSQLDriver* m_driver;
};
}
#endif
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
@@ -32,32 +32,33 @@
#include <opie2/ocontactaccessbackend_xml.h>
#include <qasciidict.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qregexp.h>
#include <qarray.h>
#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 ):
m_changed( false )
{
// Just m_contactlist should call delete if an entry
// is removed.
m_contactList.setAutoDelete( true );
m_uidToContact.setAutoDelete( false );
m_appName = appname;
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
@@ -37,24 +37,26 @@
#include <qarray.h>
#include <qstringlist.h>
#include <qpe/global.h>
#include <opie2/osqldriver.h>
#include <opie2/osqlmanager.h>
#include <opie2/osqlquery.h>
#include <opie2/opimrecurrence.h>
#include <opie2/odatebookaccessbackend_sql.h>
+using namespace Opie::DB;
+
namespace Opie {
ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL( const QString& ,
const QString& fileName )
: ODateBookAccessBackend(), m_driver( NULL )
{
m_fileName = fileName.isEmpty() ? Global::applicationFileName( "datebook", "datebook.db" ) : fileName;
// Get the standart sql-driver from the OSQLManager..
OSQLManager man;
m_driver = man.standard();
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
@@ -25,25 +25,29 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H
#define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H
#include <qmap.h>
#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
* It fully implements the interface
* @see ODateBookAccessBackend
* @see OPimAccessBackend
*/
class ODateBookAccessBackend_SQL : public ODateBookAccessBackend {
public:
ODateBookAccessBackend_SQL( const QString& appName,
const QString& fileName = QString::null);
@@ -68,26 +72,26 @@ public:
OPimEvent::ValueList directNonRepeats();
OPimEvent::ValueList directRawRepeats();
private:
bool loadFile();
QString m_fileName;
QArray<int> m_uids;
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;
};
}
#endif
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
@@ -32,24 +32,26 @@
#include <qpe/global.h>
#include <opie2/osqldriver.h>
#include <opie2/osqlresult.h>
#include <opie2/osqlmanager.h>
#include <opie2/osqlquery.h>
#include <opie2/otodoaccesssql.h>
#include <opie2/opimstate.h>
#include <opie2/opimnotifymanager.h>
#include <opie2/opimrecurrence.h>
+using namespace Opie::DB;
+
using namespace Opie;
/*
* first some query
* CREATE query
* LOAD query
* INSERT
* REMOVE
* CLEAR
*/
namespace {
/**
* CreateQuery for the Todolist Table
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
@@ -24,27 +24,31 @@
-- :-=` 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 OPIE_PIM_ACCESS_SQL_H
#define OPIE_PIM_ACCESS_SQL_H
#include <qasciidict.h>
#include <opie2/otodoaccessbackend.h>
+namespace Opie {
+namespace DB {
class OSQLDriver;
class OSQLResult;
class OSQLResultItem;
+}
+}
namespace Opie {
class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend {
public:
OPimTodoAccessBackendSQL( const QString& file );
~OPimTodoAccessBackendSQL();
bool load();
bool reload();
bool save();
QArray<int> allRecords()const;
@@ -62,27 +66,27 @@ public:
const QDate& end, bool includeNoDates );
QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat );
QBitArray supports()const;
QArray<int> matchRegexp( const QRegExp &r ) const;
void removeAllCompleted();
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;
};
}
#endif
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
@@ -8,33 +8,33 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-#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 )
{
}
XMLElement::~XMLElement()
{
XMLElement *n = m_first;
while ( n )
{
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
@@ -16,26 +16,27 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __bookmarks_h__
#define __bookmarks_h__
#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.
*/
class XMLElement
{
public:
typedef QMap<QString, QString> AttributeMap;
/**
* The constructor of XMLElement
*/
@@ -105,15 +106,17 @@ private:
XMLElement *m_parent;
XMLElement *m_next;
XMLElement *m_prev;
XMLElement *m_first;
XMLElement *m_last;
XMLElement( const XMLElement &rhs );
XMLElement &operator=( const XMLElement &rhs );
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
@@ -1,28 +1,31 @@
#ifndef OPIE_BIG_SCREEN_PRIVATE
#define OPIE_BIG_SCREEN_PRIVATE
/* QT */
#include <qstring.h>
class QWidget;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
+namespace Private{
struct OSplitterContainer
{
bool operator==( const OSplitterContainer& o) const
{
if (widget != o.widget ) return false;
if (icon != o.icon ) return false;
if (name != o.name ) return false;
return true;
}
QWidget* widget;
QString icon;
QString name;
};
-};
+}
+}
+}
#endif
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp
index 89f3793..bcfd3a6 100644
--- a/libopie2/opieui/big-screen/osplitter.cpp
+++ b/libopie2/opieui/big-screen/osplitter.cpp
@@ -26,25 +26,26 @@
*/
#include "osplitter.h"
/* OPIE */
#include <opie2/otabwidget.h>
/* QT */
#include <qvaluelist.h>
#include <qvbox.h>
-using namespace Opie;
+using namespace Opie::Ui;
+using namespace Opie::Ui::Private;
/**
*
* This is the constructor of OSplitter
* You might want to call setSizeChange to tell
* OSplitter to change its layout when a specefic
* mark was crossed. OSplitter sets a default value.
*
* You cann add widget with addWidget to the OSplitter.
* OSplitter supports also grouping of Splitters where they
* can share one OTabBar in small screen mode. This can be used
* for email clients like vies but see the example.
@@ -159,25 +160,25 @@ void OSplitter::setSizeChange( int width_height )
*/
void OSplitter::addWidget( OSplitter* split )
{
m_splitter.append( split );
/*
* set tab widget
*/
if (m_tabWidget )
setTabWidget( m_parentTab );
else
{
- Opie::OSplitterContainer con;
+ OSplitterContainer con;
con.widget =split;
addToBox( con );
}
}
/*
* If in a tab it should be removed
* and if in a hbox the reparent kills it too
*/
/**
* This removes the splitter again. You currently need to call this
* before you delete or otherwise you can get mem corruption
@@ -204,25 +205,25 @@ void OSplitter::removeWidget( OSplitter* split)
* @param icon The icon of the possible Tab
* @param label The label of the possible Tab
*/
void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label )
{
#ifdef DEBUG
if (!wid )
{
qWarning("Widget is not valid!");
return;
}
#endif
- Opie::OSplitterContainer cont;
+ OSplitterContainer cont;
cont.widget = wid;
cont.icon =icon;
cont.name = label;
m_container.append( cont );
/*
*
*/
if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) )
setTabWidget( m_parentTab );
else
@@ -387,39 +388,39 @@ void OSplitter::resizeEvent( QResizeEvent* res )
qWarning("Changng to vbox %s", name() );
changeVBox();
mode = false;
}
emit sizeChanged(mode, m_orient );
}
/*
* Adds a container to a tab either the parent tab
* or our own
*/
-void OSplitter::addToTab( const Opie::OSplitterContainer& con )
+void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con )
{
QWidget *wid = con.widget;
// not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) );
if (m_parentTab )
m_parentTab->addTab( wid, con.icon, con.name );
else
m_tabWidget->addTab( wid, con.icon, con.name );
}
/*
* adds a container to the box
*/
-void OSplitter::addToBox( const Opie::OSplitterContainer& con )
+void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con )
{
QWidget* wid = con.widget;
wid->reparent(m_hbox, 0, QPoint(0, 0) );
}
/*
* Removes a widget from the tab
*/
void OSplitter::removeFromTab( QWidget* wid )
{
if (m_parentTab )
@@ -536,25 +537,25 @@ void OSplitter::commonChangeBox()
for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it )
{
/* only if parent tab.. m_tabWidgets gets deleted and would do that as well */
if (m_parentTab )
removeFromTab( (*it).widget );
qWarning("Adding to box %s", (*it).name.latin1() );
addToBox( (*it) );
}
for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() )
{
/* tell them the world had changed */
split->setTabWidget( 0 );
- Opie::OSplitterContainer con;
+ OSplitterContainer con;
con.widget = split;
// con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget)
// : static_cast<QWidget*>(split->m_hbox);
addToBox( con );
}
if (m_parentTab )
m_parentTab->addTab(m_hbox, iconName(), label() );
else
{
diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h
index 2daae7f..7b5ea53 100644
--- a/libopie2/opieui/big-screen/osplitter.h
+++ b/libopie2/opieui/big-screen/osplitter.h
@@ -14,75 +14,75 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-
+
*/
#ifndef OSPLITTER_H
#define OSPLITTER_H
#include "obigscreen_p.h"
/* QT */
#include <qframe.h>
#include <qlist.h>
#include <qstring.h>
#include <qvaluelist.h>
class QHBox;
//template class QValueList<Opie::OSplitterContainer>;
/*
* TODO
* -check API docu
* -one more example
* -allow inserting at a position
*/
-namespace Opie
-{
+namespace Opie{
+namespace Ui {
class OTabWidget;
/**
*
* If you've widgets that could be placed side by side but you think
* on small resolutions is not enough place but it would really make sense
* on bigger resolutions this class will help you.
* You can add as many widgets you want to it. Set a poliy on which width/height it
* should switch the layout.
* You can either say to place widgets vertical or horizontal.
* This class uses QHBox, QVBox and QTAbWidget internally.
* OSplitter takes ownership of the widgets
*
* @since 1.2
*
* @short a small dynamically changing its layout to store two or more widgets side by side
* @version 0.1
* @author zecke
*/
class OSplitter : public QFrame
{
Q_OBJECT
public:
- typedef QValueList<Opie::OSplitterContainer> ContainerList;
+ typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList;
OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0,
const char* name = 0, WFlags fl = 0 );
~OSplitter();
void setLabel( const QString& name );
void setIconName( const QString& name );
QString label()const;
QString iconName()const;
void setSizeChange( int width_height );
void addWidget( OSplitter* splitter );
@@ -115,36 +115,37 @@ signals:
public:
// QSize sizeHint()const;
// QSize minimumSizeHint()const;
protected:
void resizeEvent( QResizeEvent* );
private:
/* true if OTabMode */
bool layoutMode()const;
// void reparentAll();
void setTabWidget( OTabWidget*);
- void addToTab( const Opie::OSplitterContainer& );
- void addToBox( const Opie::OSplitterContainer& );
+ void addToTab( const Opie::Ui::Private::OSplitterContainer& );
+ void addToBox( const Opie::Ui::Private::OSplitterContainer& );
void removeFromTab( QWidget* );
void changeTab();
void changeHBox();
void changeVBox();
void commonChangeBox();
QHBox *m_hbox;
OTabWidget *m_tabWidget;
OTabWidget *m_parentTab;
Orientation m_orient;
int m_size_policy;
ContainerList m_container;
QList<OSplitter> m_splitter;
QString m_icon, m_name;
struct Private;
Private *d;
};
-};
+}
+}
#endif
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index 57e97e3..a0a6355 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
@@ -23,29 +23,29 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "owidgetstack.h"
/* QT */
#include <qapplication.h>
#include <qwidgetstack.h>
-namespace {
+namespace Opie {
+namespace Ui {
const int mode_size = 330;
-}
-using namespace Opie;
+
/**
* This is the standard widget. For simple usage see the example. Normally this widget
* is the central widget of a QMainWindow.
* Use removeWidget before you delete a widget yourself. OWidgetStack does not
* yet recognize removal of children.
*
* @param parent The parent widget. It maybe 0 but then you need to take care of deletion.
* Or you use QPEApplication::showMainWidget().
* @param name Name will be passed on to QObject
* @param fl Additional window flags passed to QFrame. see @Qt::WFlags
*/
@@ -424,12 +424,15 @@ void OWidgetStack::switchTop() {
m_mWidget->reparent(this, 0, frameRect().topLeft() );
m_mWidget->setGeometry( frameRect() );
m_mWidget->show();
}else
/* ### FIXME we need to place the widget better */
it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) );
}
}
delete m_stack;
m_stack = 0;
}
+
+}
+} \ No newline at end of file
diff --git a/libopie2/opieui/big-screen/owidgetstack.h b/libopie2/opieui/big-screen/owidgetstack.h
index 53818c8..d2f9a9f 100644
--- a/libopie2/opieui/big-screen/owidgetstack.h
+++ b/libopie2/opieui/big-screen/owidgetstack.h
@@ -26,26 +26,26 @@
*/
#ifndef OWIDGETSTACK_H
#define OWIDGETSTACK_H
/* QT*/
#include <qframe.h>
#include <qmap.h>
class QWidgetStack;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
/**
*
* OWidgetStack is the answer to the problem of using Opie at different screen
* sizes and to have a different behaviour. Most applications use a QWidgetStack
* to supply a view on click. And by clicking the (X) you go back but this
* behaviour feels strange on bigger screens. It's ok on smaller one because
* one can't determine the difference.
* This stack reads the default out of the size of the desktop widget but
* can be forced to have either the one or the other behaviour.
* The first widget added is considered the 'main' widget and its
* sizeHint will be taking if in BigScreen mode.
* In small screen mode this widget behaves exactly like a QWidgetStack and in BigScreen
@@ -118,15 +118,16 @@ private:
QMap<int, QWidget*> m_list;
QWidgetStack *m_stack;
QWidget *m_mWidget;
QWidget *m_last;
enum Mode m_mode;
bool m_forced : 1;
struct Private;
Private *d;
};
-};
+}
+}
#endif
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
@@ -30,25 +30,25 @@
/* OPIE */
#include <opie2/ofiledialog.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
/* QT */
#include <qfileinfo.h>
#include <qstring.h>
#include <qapplication.h>
#include <qlayout.h>
-using namespace Opie;
+using namespace Opie::Ui;
namespace
{
/*
* helper functions to load the start dir
* and to save it
* helper to extract the dir out of a file name
*/
/**
* This method will use Config( argv[0] );
* @param key The group key used
*/
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
@@ -26,26 +26,26 @@
*/
#ifndef OFILEDIALOG_H
#define OFILEDIALOG_H
/* OPIE */
#include <opie2/ofileselector.h>
/* 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
* a file for either opening or saving.
* Most of the time the c'tor will not be used instead using
* the static member functions is prefered.
*
* <pre>
* QMap<QString, QStringList> mimeTypes;
* QStringList types;
* types << "text[slash]* ";
@@ -95,15 +95,16 @@ public:
private:
class OFileDialogPrivate;
OFileDialogPrivate *d;
OFileSelector *file;
private slots:
void slotFileSelected( const QString & );
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
@@ -46,26 +46,29 @@
#include <qdir.h>
#include <qhbox.h>
#include <qheader.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qpopupmenu.h>
#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 )
{}
OFileViewInterface::~OFileViewInterface()
{}
QString OFileViewInterface::name()const
{
return m_name;
}
@@ -801,24 +804,26 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent )
if (!m_view )
{
m_view = new OFileViewFileListView( parent, startDirectory(), selector() );
}
return m_view;
}
void OFileViewFileSystem::activate( const QString& str)
{
m_all = (str != QObject::tr("Files") );
}
+
+}
/* Selector */
/**
* @short new and complete c'tor
*
* Create a OFileSelector to let the user select a file. It can
* either be used to open a file, select a save name in a dir or
* as a dropin for the FileSelector.
*
* <pre>
* QMap<QString, QStringList> mimeTypes;
* QStringList types;
* types << "text@slash* ";
@@ -1155,12 +1160,14 @@ void OFileSelector::setCloseVisible( bool b )
m_shClose = b;
currentView()->reread();
}
void OFileSelector::setNameVisible( bool b )
{
if ( b )
m_nameBox->show();
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
@@ -43,47 +43,49 @@
#include <qwidget.h>
#include <qmap.h>
#include <qvaluelist.h>
#include <qstringlist.h>
class QLineEdit;
class QComboBox;
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
*
* This class is first used insert the OFileDialog.
* It supports multiple view and mimetype filtering for now.
*
* @see OFileDialog
* @see FileSelector
* @author zecke
* @version 0.1
*/
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
* Open = Open A File
* Save = Save a File
* FILESELECTOR = As A GUI in a screen to select a file
*/
enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 };
// enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 };
/**
* Normal = The old FileSelector
@@ -176,44 +178,45 @@ private:
private:
/* inits the Widgets */
void initUI();
/* inits the MimeType ComboBox content + connects signals and slots */
void initMime();
/* init the Views :) */
void initViews();
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;
int m_mode;
int m_selector;
struct Data; // used for future versions
Data *d;
private slots:
void slotMimeTypeChanged();
/* will set the text of the lineedit and emit a fileChanged signal */
void slotDocLnkBridge( const DocLnk& );
void slotFileBridge( const QString& );
void slotViewChange( const QString& );
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
@@ -47,28 +47,28 @@
* b) leave some object inside the OFileSelector which can be used?
* c) when switching views tell which view we want o have.. internally we can switch then
*
* I'll take c) -zecke
*/
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:
OFileViewInterface( OFileSelector* selector );
virtual ~OFileViewInterface();
virtual QString selectedName()const = 0;
virtual QString selectedPath()const = 0;
virtual QString directory()const = 0;
virtual void reread() = 0;
virtual int fileCount()const = 0;
virtual DocLnk selectedDocument()const;
@@ -177,15 +177,17 @@ private:
QString m_currentDir;
QToolButton *m_btnNew, *m_btnClose;
void connectSlots();
void addFile( QFileInfo* info, bool symlink = FALSE );
void addDir ( QFileInfo* info, bool symlink = FALSE );
void addSymlink( QFileInfo* info, bool = FALSE );
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
@@ -28,26 +28,27 @@
#ifndef OFILEVIEW_H
#define OFILEVIEW_H
/* QT */
#include <qobject.h>
#include <qwidget.h>
class QFileInfo;
class QDir;
class DocLnk;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
+namespace Private {
/**
* A OFileView is a specialised View for the
* OFileSelector
* With a View you can chage the user visible
* representation of a OFileLister
* OFileView is just a basic interface which helps you to
* write new views
*/
class OFileView : public QWidget
{
Q_OBJECT
@@ -81,15 +82,17 @@ signals:
class OFileViewFactory
{
// Q_OBJECT
public:
OFileViewFactory() {} ;
virtual ~OFileViewFactory() = 0;
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
@@ -20,25 +20,25 @@
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/oclickablelabel.h>
-using namespace Opie;
+using namespace Opie::Ui;
/**
* This constructs the clickable ButtonLabel
*
* @param parent The parent of this label
* @param name A name of this label @see QObject
* @param fl The windowing flags
*/
OClickableLabel::OClickableLabel(QWidget* parent, const char* name, WFlags fl)
:QLabel(parent,name,fl)
{
textInverted=false;
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
@@ -24,26 +24,26 @@
    --        :-=` 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 OCLICKABLELABEL_H
#define OCLICKABLELABEL_H
/* QT */
#include <qlabel.h>
-namespace Opie
-{
+namespace Opie{
+namespace Ui {
/**
* This class is a special QLabel which can behave
* as a QPushButton or QToggleButton.
* The reason to use a clickable is if you want to save space
* or you want to skip the border of a normal button
*
* <pre>
* QLabel* lbl = new OClickableLabel( parent, "PushLabel" );
* lbl->setPixmap( "config" );
* QWhatsThis::add( lbl, tr("Click here to do something") );
* </pre>
@@ -89,15 +89,16 @@ private:
bool isToggle : 1;
bool isDown : 1;
bool textInverted : 1;
void showState(bool on);
void setInverted(bool on);
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
@@ -23,24 +23,26 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#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)
:QDialog(parent, name, modal, f)
{
// d = new ODialogPrivate();
}
int ODialog::marginHint()
{
return( mMarginSize );
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
@@ -46,24 +46,27 @@ class QLayoutItem;
* above, below, to the right and to the left shall be @ref marginHint().
* If you add a separator line above the buttons, there shall be a
* @ref marginHint() between the buttons and the separator and a
* @ref marginHint() above the separator as well.
*
* @author Michael 'Mickey' Lauer <mickey@Vanille.de>
*/
// 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
public:
/**
* Constructor.
*
* Takes the same arguments as @ref QDialog.
*/
ODialog(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags f = 0);
@@ -79,13 +82,15 @@ class ODialog : public QDialog
* widgets inside a dialog according to the KDE standard.
*/
static int spacingHint();
private:
static int mMarginSize;
static int mSpacingSize;
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
@@ -29,47 +29,42 @@
/* OPIE */
#include <opie2/ofontselector.h>
#include <qpe/fontdatabase.h>
/* QT */
#include <qlayout.h>
#include <qlistbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qmultilineedit.h>
-using namespace Opie;
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
+namespace Private {
class OFontSelectorPrivate
{
public:
QListBox * m_font_family_list;
QComboBox * m_font_style_list;
QComboBox * m_font_size_list;
QMultiLineEdit *m_preview;
bool m_pointbug : 1;
FontDatabase m_fdb;
};
-};
-
-namespace
-{
-
class FontListItem : public QListBoxText
{
public:
FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText()
{
m_name = t;
m_styles = styles;
m_sizes = sizes;
QString str = t;
str [0] = str [0]. upper();
setText ( str );
@@ -86,37 +81,42 @@ public:
}
const QValueList<int> &sizes() const
{
return m_sizes;
}
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++ )
{
if ( box->text ( i ) == str )
return i;
}
return -1;
}
-}
/* static same as anon. namespace */
static int qt_version()
{
const char *qver = qVersion();
return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
}
/**
* Constructs the Selector object
* @param withpreview If a font preview should be given
* @param parent The parent of the Font Selector
@@ -417,12 +417,13 @@ void OFontSelector::resizeEvent ( QResizeEvent *re )
if ( d->m_preview )
{
d->m_preview->setMinimumHeight ( 1 );
d->m_preview->setMaximumHeight ( 32767 );
}
QWidget::resizeEvent ( 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
@@ -26,28 +26,29 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OFONTSELECTOR_H
#define OFONTSELECTOR_H
/* QT */
#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
* fonts
*
*
* @short A widget to select a font
* @see QWidget
* @see QFont
* @author Rober Griebl
*/
@@ -86,19 +87,20 @@ protected slots:
/** @internal */
virtual void fontSizeClicked ( int );
protected:
virtual void resizeEvent ( QResizeEvent *re );
private:
void loadFonts ( QListBox * );
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
@@ -32,24 +32,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <math.h>
#include <qimage.h>
#include <stdlib.h>
#include <opie2/oimageeffect.h>
#include <opie2/odebug.h>
#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) +
0.587*qGreen(color) +
0.1140000000000001*qBlue(color))));
}
//======================================================================
//
// Gradient effects
//
@@ -3756,13 +3760,14 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen)
brightness=1.0;
else
if (brightness < 0)
brightness=0.0;
v = (int)(brightness*255);
c.setHsv(h, s, v);
data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i]));
}
}
-
+}
+}
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
@@ -30,24 +30,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// $Id$
#ifndef OIMAGEEFFECT_H
#define OIMAGEEFFECT_H
class QImage;
class QSize;
class QColor;
+namespace Opie {
+namespace Ui {
/**
* This class includes various @ref QImage based graphical effects.
*
* Everything is
* static, so there is no need to create an instance of this class. You can
* just call the static methods. They are encapsulated here merely to provide
* a common namespace.
*/
class OImageEffect
{
public:
@@ -547,13 +549,16 @@ private:
* Helper function to find the nearest color to the RBG triplet
*/
static int nearestColor( int r, int g, int b, const QColor *pal, int size );
static void hull(const int x_offset, const int y_offset, const int polarity,
const int width, const int height,
unsigned int *f, unsigned int *g);
static unsigned int generateNoise(unsigned int pixel, NoiseType type);
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
@@ -27,24 +27,29 @@
*/
/* QT */
#include <qpixmap.h>
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/olistview.h>
+using namespace Opie::Core;
+
+
+namespace Opie {
+namespace Ui {
/*======================================================================================
* OListView
*======================================================================================*/
OListView::OListView( QWidget *parent, const char *name )
:QListView( parent, name )
{
//FIXME: get from global settings and calculate ==> see oglobalsettings.*
m_alternateBackground = QColor( 238, 246, 255 );
m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine );
m_fullWidth = true;
@@ -746,12 +751,14 @@ ONamedListViewItem* ONamedListViewItem::find( int column, const QString& text, i
}
ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QString& text, int recurse ) const
{
int col = ( (ONamedListView*) listView() )->findColumn( column );
if ( col != -1 )
return ( (ONamedListView*) listView() )->find( (ONamedListViewItem*) firstChild(), col, text, recurse );
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
@@ -27,42 +27,46 @@
*/
#ifndef OLISTVIEW_H
#define OLISTVIEW_H
#include <qcolor.h>
#include <qlistview.h>
#include <qpen.h>
#include <qdatastream.h>
#include <qstringlist.h>
+
+namespace Opie {
+namespace Ui {
class OListViewItem;
/*======================================================================================
* OListView
*======================================================================================*/
/**
* @brief A list/tree widget.
*
* A @ref QListView variant featuring visual and functional enhancements
* like an alternate background for odd rows, an autostretch mode
* for the width of the widget ( >= Qt 3 only ) and persistence capabilities.
*
* @author Michael 'Mickey' Lauer <mickey@vanille.de>
*/
class OListView: public QListView
{
+ Q_OBJECT
public:
/**
* Constructor.
*
* The parameters @a parent and @a name are handled by
* @ref QListView, as usual.
*/
OListView( QWidget* parent = 0, const char* name = 0 );
/**
* Destructor.
*/
virtual ~OListView();
@@ -130,26 +134,28 @@ class OListView: public QListView
* Collapse all items
*/
void collapse();
protected slots:
/**
* expand the current OListViewItem
*/
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
/**
* @relates OListView
* Writes @a listview to the @a stream and returns a reference to the stream.
*/
QDataStream& operator<<( QDataStream& stream, const OListView& listview );
/**
* @relates OListView
* Reads @a listview from the @a stream and returns a reference to the stream.
*/
@@ -233,26 +239,28 @@ class OListViewItem: public QListViewItem
* serialize this object to or from a @ref QDataStream
* @param s the stream used to serialize this object.
*/
virtual void serializeFrom( QDataStream& s );
#endif
/**
* expand the the item
*/
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
/**
* @relates QListViewItem
* Writes listview @a item and all subitems recursively to @a stream
* and returns a reference to the stream.
*/
QDataStream& operator<<( QDataStream& stream, const OListViewItem& item );
/**
* @relates QListViewItem
* Reads listview @a item from @a stream and returns a reference to the stream.
@@ -345,24 +353,27 @@ class ONamedListView: public OListView
* Set @a recurse to indicate how much subchild levels to search, e.g.<ul>
* <li>set it to 0 to search only among direct childs,
* <li>set it to 1 to search direct childs and all 1st order subchilds
* <li>set it to -1 for maximum recursion.
* </ul>
* @sa ONamedListViewItem::find()
*/
virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const;
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
*======================================================================================*/
/**
* @brief An OListView variant with named columns.
*
* This class provides a higher-level interface to an OListViewItem.
*
* @author Michael 'Mickey' Lauer <mickey@vanille.de>
@@ -394,16 +405,22 @@ class ONamedListViewItem: public OListViewItem
virtual void setText( const QStringList& texts );
/**
* @returns the first child which has a @a text in column @a column.
* Set @a recurse to indicate how much subchild levels to search, e.g.<ul>
* <li>set it to 0 to search only among direct childs,
* <li>set it to 1 to search direct childs and all 1st order subchilds
* <li>set it to -1 for maximum recursion.
* </ul>
* @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
@@ -1,46 +1,43 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
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 \
otabwidget.h \
otaskbarapplet.h \
oticker.h \
otimepicker.h \
oversatileview.h \
oversatileviewitem.h \
owait.h
SOURCES = oclickablelabel.cpp \
odialog.cpp \
ofontselector.cpp \
oimageeffect.cpp \
olistview.cpp \
opixmapeffect.cpp \
opopupmenu.cpp \
opixmapprovider.cpp \
- oresource.cpp \
oselector.cpp \
oseparator.cpp \
otabbar.cpp \
otabwidget.cpp \
otaskbarapplet.cpp \
oticker.cpp \
otimepicker.cpp \
oversatileview.cpp \
oversatileviewitem.cpp \
owait.cpp
include ( big-screen/big-screen.pro )
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
@@ -8,24 +8,26 @@
// $Id$
/* QT */
#include <qimage.h>
#include <qpainter.h>
/* OPIE */
#include <opie2/opixmapeffect.h>
#include <opie2/oimageeffect.h>
+
+using namespace Opie::Ui;
//======================================================================
//
// Gradient effects
//
//======================================================================
OPixmap& OPixmapEffect::gradient(OPixmap &pixmap, const QColor &ca,
const QColor &cb, GradientType eff, int ncols)
{
if(pixmap.depth() > 8 &&
(eff == VerticalGradient || eff == HorizontalGradient)) {
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
@@ -6,24 +6,27 @@
*/
// $Id$
#ifndef __OPIXMAP_EFFECT_H
#define __OPIXMAP_EFFECT_H
#include <qsize.h>
typedef QPixmap OPixmap;
class QColor;
+
+namespace Opie {
+namespace Ui {
/**
* This class includes various pixmap-based graphical effects.
*
* Everything is
* static, so there is no need to create an instance of this class. You can
* just call the static methods. They are encapsulated here merely to provide
* a common namespace.
*/
class OPixmapEffect
{
public:
enum GradientType { VerticalGradient, HorizontalGradient,
@@ -201,15 +204,16 @@ public:
* @return Returns the @ref pixmap(), provided for convenience.
*/
static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size);
/**
* Calculate a 'selected' pixmap, for instance a selected icon
* on the desktop.
* @param pixmap the pixmap to select
* @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
@@ -11,17 +11,19 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#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
@@ -14,41 +14,49 @@
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OPIXMAPPROVIDER_H
#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.
*
* Used e.g. by @ref KHistoryCombo
*
* @author Carsten Pfeiffer <pfeiffer@kde.org>
* @short an abstract interface for looking up icons
*/
class OPixmapProvider
{
public:
virtual ~OPixmapProvider();
/**
* You may subclass this and return a pixmap of size @p size for @p text.
* @param text the text that is associated with the pixmap
* @param size the size of the icon in pixels, 0 for defaylt size.
* See @ref KIcon::StdSize.
* @return the pixmap for the arguments, or null if there is none
*/
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
@@ -18,24 +18,27 @@
*/
/* QT */
#include <qdrawutil.h>
#include <qtimer.h>
/* OPIE */
#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);
}
OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */,
const QColor &/* color */, const QColor &/* textColor */,
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
@@ -22,24 +22,26 @@
#define _OPOPUP_H
#define INCLUDE_MENUITEM_DEF
/* QT */
#include <qpopupmenu.h>
/* 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
* @ref OPopupMenu::insertTitle will do it for you, but it is allowed if
* you wish to customize it's look.
*
* @author Daniel M. Duley <mosfet@kde.org>
* @short OPopupMenu title widget.
*/
class OPopupTitle : public QWidget
{
@@ -247,13 +249,16 @@ protected slots:
QString underlineText(const QString& text, uint length);
/// @since 3.1
void resetKeyboardVars(bool noMatches = false);
void itemHighlighted(int whichItem);
void showCtxMenu(QPoint pos);
void ctxMenuHiding();
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
@@ -27,24 +27,26 @@
#include <opie2/oimageeffect.h>
#include <opie2/oselector.h>
#define STORE_W 8
#define STORE_W2 STORE_W * 2
//-----------------------------------------------------------------------------
/*
* 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;
yPos = 0;
minX = 0;
minY = 0;
maxX = 100;
maxY = 100;
store.setOptimization( QPixmap::BestOptim );
store.resize( STORE_W2, STORE_W2 );
}
@@ -64,25 +66,25 @@ void OXYSelector::setRange( int _minX, int _minY, int _maxX, int _maxY )
maxY = _maxY;
}
void OXYSelector::setValues( int _xPos, int _yPos )
{
xPos = _xPos;
yPos = _yPos;
if ( xPos > maxX )
xPos = maxX;
else if ( xPos < minX )
xPos = minX;
-
+
if ( yPos > maxY )
yPos = maxY;
else if ( yPos < minY )
yPos = minY;
int xp = 2 + (width() - 4) * xPos / (maxX - minX);
int yp = height() - 2 - (height() - 4) * yPos / (maxY - minY);
setPosition( xp, yp );
}
QRect OXYSelector::contentsRect() const
@@ -249,25 +251,25 @@ void OSelector::paintEvent( QPaintEvent * )
if ( indent() )
{
if ( orientation() == Vertical )
qDrawShadePanel( &painter, 0, 3, width()-5, height()-6,
colorGroup(), TRUE, 2, &brush );
else
qDrawShadePanel( &painter, 3, 0, width()-6, height()-5,
colorGroup(), TRUE, 2, &brush );
}
QPoint pos = calcArrowPos( value() );
- drawArrow( &painter, TRUE, pos );
+ drawArrow( &painter, TRUE, pos );
painter.end();
}
void OSelector::mousePressEvent( QMouseEvent *e )
{
moveArrow( e->pos() );
}
void OSelector::mouseMoveEvent( QMouseEvent *e )
{
moveArrow( e->pos() );
@@ -279,28 +281,28 @@ void OSelector::wheelEvent( QWheelEvent *e )
emit valueChanged( val );
setValue( val );
}
void OSelector::valueChange()
{
QPainter painter;
QPoint pos;
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();
}
void OSelector::moveArrow( const QPoint &pos )
{
int val;
if ( orientation() == Vertical )
val = ( maxValue() - minValue() ) * (height()-pos.y()-3)
/ (height()-10) + minValue();
else
@@ -352,26 +354,26 @@ void OSelector::drawArrow( QPainter *painter, bool show, const QPoint &pos )
array.setPoint( 0, pos.x()+0, pos.y()+0 );
array.setPoint( 1, pos.x()+5, pos.y()+5 );
array.setPoint( 2, pos.x()+5, pos.y()-5 );
}
else
{
array.setPoint( 0, pos.x()+0, pos.y()+0 );
array.setPoint( 1, pos.x()+5, pos.y()+5 );
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);
}
else
{
repaint(pos.x()-5, pos.y(), 11, 6, true);
}
}
}
@@ -391,25 +393,25 @@ OGradientSelector::OGradientSelector( Orientation o, QWidget *parent,
init();
}
OGradientSelector::~OGradientSelector()
{}
void OGradientSelector::init()
{
color1.setRgb( 0, 0, 0 );
color2.setRgb( 255, 255, 255 );
-
+
text1 = text2 = "";
}
void OGradientSelector::drawContents( QPainter *painter )
{
QImage image( contentsRect().width(), contentsRect().height(), 32 );
QColor col;
float scale;
int redDiff = color2.red() - color1.red();
@@ -463,25 +465,25 @@ void OGradientSelector::drawContents( QPainter *painter )
painter->drawPixmap( contentsRect().x(), contentsRect().y(), p );
if ( orientation() == Vertical )
{
int yPos = contentsRect().top() + painter->fontMetrics().ascent() + 2;
int xPos = contentsRect().left() + (contentsRect().width() -
painter->fontMetrics().width( text2 )) / 2;
QPen pen( color2 );
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 );
}
else
{
int yPos = contentsRect().bottom()-painter->fontMetrics().descent()-2;
QPen pen( color2 );
painter->setPen( pen );
painter->drawText( contentsRect().left() + 2, 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
@@ -18,24 +18,27 @@
*/
//-----------------------------------------------------------------------------
// Selector widgets for KDE Color Selector, but probably useful for other
// stuff also.
#ifndef __OSELECT_H__
#define __OSELECT_H__
#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
* by a cross. An example is the @ref OHSSelector which
* allows to choose from a range of colors, and which is
* used in OColorDialog.
*
* A custom drawing routine for the widget surface has
* to be provided by the subclass.
*/
class OXYSelector : public QWidget
@@ -503,16 +506,18 @@ protected:
int h;
int s;
int v;
int r;
int g;
int b;
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
@@ -27,24 +27,26 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* OPIE */
#include <opie2/odebug.h>
#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)
{
setLineWidth(1);
setMidLineWidth(0);
setOrientation( HLine );
}
OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags 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
@@ -26,24 +26,27 @@
    --        :-=` 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 OSEPARATOR_H
#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>
* @author Michael Roth <mroth@wirlweb.de>
* @version $Id$
*/
class OSeparator : public QFrame
{
Q_OBJECT
Q_PROPERTY( int orientation READ orientation WRITE setOrientation )
public:
@@ -77,14 +80,16 @@ class OSeparator : public QFrame
/**
* The recommended height (width) for a horizontal (vertical) separator.
**/
virtual QSize sizeHint() const;
protected:
virtual void drawFrame( QPainter * );
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
@@ -22,25 +22,25 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/otabbar.h>
-using namespace Opie;
+using namespace Opie::Ui;
OTabBar::OTabBar( QWidget *parent , const char *name )
:QTabBar( parent, name )
{}
void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const
{
QRect r = br;
if ( t->iconset)
{
QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled;
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
@@ -26,26 +26,26 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OTABBAR_H
#define OTABBAR_H
/* QT */
#include <qtabbar.h>
-namespace Opie
-{
+namespace Opie {
+namespace Ui {
/**
* @class OTabBar
* @brief The OTabBar class is a derivative of QTabBar.
*
* OTabBar is a derivation of TrollTech's QTabBar which provides
* a row of tabs for selection. The only difference between this
* class and QTabBar is that there is no dotted line box around
* the label of the tab with the current focus.
*/
class OTabBar : public QTabBar
{
@@ -71,15 +71,16 @@ protected:
* @param p Pointer to QPainter used for drawing.
* @param br QRect providing region to draw label in.
* @param t Tab to draw label for.
* @param has_focus Boolean value not used, retained for compatibility reasons.
*/
void paintLabel( QPainter *, const QRect &, QTab *, bool ) const;
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
@@ -29,26 +29,26 @@
*/
#ifndef OTABINFO_H
#define OTABINFO_H
/* QT */
#include <qlist.h>
#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
* of widgets added to the control.
*
* OTabInfo provides the following information about a widget added to an
* OTabWidget control:
*
* ID - integer tab bar ID
* Control - QWidget pointer to child widget
* Label - QString text label for OTabWidget selection control
@@ -126,15 +126,16 @@ private:
QString p;
QString l;
class Private;
Private *d;
};
/**
* @class OTabInfoList
* @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
@@ -32,25 +32,25 @@
#include <opie2/otabwidget.h>
/* OPIE */
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include <opie2/otabbar.h>
/* 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 )
{
if ( s == Global )
{
Config config( "qpe" );
config.setGroup( "Appearance" );
s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab );
if ( s <= Global || s > IconList)
{
s = IconTab;
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
@@ -29,33 +29,32 @@
*/
#ifndef OTABWIDGET_H
#define OTABWIDGET_H
/* OPIE */
#include <opie2/otabinfo.h>
/* 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;
/**
* @class OTabWidget
* @brief The OTabWidget class provides a stack of widgets.
*
* OTabWidget is a derivation of TrollTech's QTabWidget which provides
* a stack of widgets. Widgets can be selected using either a tab bar or
* drop down list box.
*
* The normal way to use OTabWidget is to do the following in the
@@ -278,15 +277,16 @@ private:
*/
void slotTabBarSelected( int );
/**
* @fn slotTabListSelected( int index )
* @brief Slot which is called when a drop down selection is made.
*
* @param id Index of widget selected.
*/
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
@@ -19,14 +19,64 @@
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+#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
@@ -24,29 +24,38 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef 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 )
{
}
virtual ~OTaskbarAppletWrapper()
{
delete _applet;
}
@@ -71,60 +80,50 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface
{
if ( !_applet ) _applet = new T( parent );
return _applet;
}
virtual int position() const
{
return T::position();
}
private:
T* _applet;
+ OTaskbarAppletWrapperPrivate *d;
};
-#include <qframe.h>
-#include <qwidget.h>
-#include <qpe/qpeapplication.h>
-
-class QMouseEvent;
-
+}
/*======================================================================================
* OTaskbarApplet
*======================================================================================*/
// Must be inline until after we shipped Opie 1.0
// Having OTaskBarApplet reside in libopieui2 is not possible
// until we link the launcher binary against libopieui2 -
// otherwise the necessary symbols are not present, when
// the dynamic loader [dlopen] tries to resolve an applet which
// inherits OTaskbarApplet
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
@@ -18,32 +18,36 @@
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+/* 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
* @param name The name of the object
* @param fl Window Flags
*/
OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl)
:QWidget(parent,name,fl)
{
QVBoxLayout *vbox=new QVBoxLayout(this);
@@ -211,24 +215,26 @@ void OTimePicker::setHour(int h)
/**
* This is a modal Dialog.
*
* @param parent The parent widget
* @param name The name of the object
* @param fl Possible window flags
*/
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&) ),
this, SLOT ( setMinute(const QString&) ) );
connect ( hourField, SIGNAL( textChanged(const QString&) ),
this, SLOT ( setHour(const QString&) ) );
}
/**
* @return the time
@@ -281,12 +287,15 @@ void OTimePickerDialog::setHour ( const QString& hour )
* Method to set a new minute. It tries to convert the string to int and
* if the resulting date is valid a new date is set.
* @see setHour
*/
void OTimePickerDialog::setMinute ( const QString& minute )
{
if ( QTime::isValid ( m_time.hour(), minute.toInt(), 00 ) )
{
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
@@ -23,49 +23,48 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OTIMEPICKER_H
#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.
* A time can be selected by two clicks of a user
*
* @short A widget to quickly pick a QTime
* @version 1.0
* @see QWidget
* @see QTime
* @author Hakan Ardo, Stefan Eilers
*/
-class OTimePicker: public QWidget
+class OTimePicker : public QWidget
{
Q_OBJECT
public:
OTimePicker(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
public slots:
void setHour(int h);
void setMinute(int m);
void setTime( const QTime& );
void setTime( int h, int m );
@@ -105,21 +104,29 @@ class OTimePickerDialog: public OTimePickerDialogBase
public:
OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 );
~OTimePickerDialog() { };
QTime time()const;
public slots:
void setTime( const QTime& time );
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
@@ -2,25 +2,25 @@
<class>OTimePickerDialogBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>OTimePickerDialogBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>210</width>
+ <width>182</width>
<height>137</height>
</rect>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>1</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>caption</name>
@@ -240,53 +240,17 @@
<name>title</name>
<string>Pick Time:</string>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<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
@@ -31,24 +31,27 @@
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/oversatileview.h>
#include <opie2/oversatileviewitem.h>
#include <opie2/olistview.h>
/* QT */
#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",
". c #87BD88",
"+ c #8BBE8B",
"@ c #81BA81",
"# c #6DAF6D",
"$ c #87BD87",
"% c #FCFDFC",
"& c #AED0AE",
"* c #4E9C4C",
@@ -123,33 +126,33 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode )
// Create child widgets and set some reasonable default styles
//
_listview = new OListView( this, "oversatileview embedded listview" );
_iconview = new QIconView( this, "oversatileview embedded iconview" );
_listview->setAllColumnsShowFocus( true );
_listview->setRootIsDecorated( true );
_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 );
( (QPEApplication*) qApp)->setStylusOperation( _listview->viewport(), QPEApplication::RightOnHold );
#endif
setViewMode( mode ); // TODO: Read last style from config
// setSynchronization( true ); // TODO: Implement this
// create context menu allowing to switch between the views
@@ -159,75 +162,75 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode )
QActionGroup* ag = new QActionGroup( _contextmenu, "style option group" );
QAction* a1 = new QAction( "View Items in Icon Style", QIconSet( QPixmap( view_icon_xpm ) ),
"View Icons", 0, ag, "viewicon action", true );
QAction* a2 = new QAction( "View Items in Tree Style", QIconSet( QPixmap( view_tree_xpm ) ),
"View Tree", 0, ag, "viewtree action", true );
ag->addTo( _contextmenu );
if ( mode == Icons )
a1->setOn( true );
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()
{
}
QPopupMenu* OVersatileView::contextMenu() const
{
return _contextmenu;
}
@@ -411,25 +414,25 @@ void OVersatileView::doubleClicked( QListViewItem * item )
emit( doubleClicked( static_cast<OVersatileViewItem*>( item ) ) );
}
void OVersatileView::doubleClicked( QIconViewItem * item )
{
emit( doubleClicked( static_cast<OVersatileViewItem*>( item ) ) );
}
void OVersatileView::returnPressed( QListViewItem * item )
{
emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) );
}
-
+
void OVersatileView::returnPressed( QIconViewItem * item )
{
emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) );
}
void OVersatileView::onItem( QListViewItem * item )
{
emit( onItem( static_cast<OVersatileViewItem*>( item ) ) );
}
void OVersatileView::onItem( QIconViewItem * item )
{
@@ -444,25 +447,25 @@ void OVersatileView::expanded( QListViewItem *item ) // QListView
emit( expanded( static_cast<OVersatileViewItem*>( item ) ) );
}
void OVersatileView::collapsed( QListViewItem *item ) // QListView
{
if ( !_treeclosed.isNull() )
item->setPixmap( 0, _treeclosed );
emit( collapsed( static_cast<OVersatileViewItem*>( item ) ) );
}
//=============================================================================================//
// OVersatileView Case I - API only existing in QListView or QIconView but not in both!
//==============================================================================================//
-
+
int OVersatileView::treeStepSize() const // QListView
{
if ( !isValidViewMode( Tree ) )
{
return -1;
}
return _listview->treeStepSize();
}
void OVersatileView::setTreeStepSize( int size ) // QListView
{
if ( !isValidViewMode( Tree ) )
{
@@ -736,25 +739,25 @@ bool OVersatileView::showSortIndicator() const // QListView
void OVersatileView::triggerUpdate() // QListView
{
if ( !isValidViewMode( Tree ) )
{
return;
}
_listview->triggerUpdate();
}
//
// only in QIconView
//
-
+
uint OVersatileView::count() const // QIconView
{
if ( !isValidViewMode( Icons ) )
{
return 0;
}
return _iconview->count();
}
int OVersatileView::index( const OVersatileViewItem *item ) 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
@@ -36,125 +36,128 @@
#include <qwidgetstack.h>
#include <qiconview.h>
/* OPIE */
#include <opie2/oapplication.h>
/* FORWARDS */
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
//==============================================================================================//
public:
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
void itemRenamed( OVersatileViewItem *item ); // QIconView
*/
//==============================================================================================//
// "Derived" API - Case 1: Methods existing either only in QListView or only in QIconView
//==============================================================================================//
public:
@@ -164,29 +167,29 @@ public:
LeftToRight = 0,
TopToBottom
};
enum ResizeMode { // QIconView
Fixed = 0,
Adjust
};
enum ItemTextPos { // QIconView
Bottom = 0,
Right
};
*/
-
+
//
// only in QListView
//
-
+
int treeStepSize() const; // QListView
virtual void setTreeStepSize( int ); // QListView
QHeader * header() const; // QListView
virtual int addColumn( const QString &label, int size = -1); // QListView
virtual int addColumn( const QIconSet& iconset, const QString &label, int size = -1); // QListView
void removeColumn( int index ); // #### make virtual in next major release! // QListView
virtual void setColumnText( int column, const QString &label ); // QListView
virtual void setColumnText( int column, const QIconSet& iconset, const QString &label ); // QListView
QString columnText( int column ) const; // QListView
virtual void setColumnWidth( int column, int width ); // QListView
@@ -217,41 +220,41 @@ public:
virtual void setAllColumnsShowFocus( bool ); // QListView
bool allColumnsShowFocus() const; // QListView
virtual void setItemMargin( int ); // QListView
int itemMargin() const; // QListView
virtual void setRootIsDecorated( bool ); // QListView
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
signals:
void expanded( OVersatileViewItem *item ); // QListView
void collapsed( OVersatileViewItem *item ); // QListView
//
// only in QIconView
//
- public:
+ public:
uint count() const; // QIconView
-
+
OVersatileViewItem *firstItem() const; // QIconView
OVersatileViewItem *lastItem() const; // QIconView
OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView
OVersatileViewItem *findItem( const QString &text ) const; // QIconView
OVersatileViewItem* findFirstVisibleItem( const QRect &r ) const; // QIconView
OVersatileViewItem* findLastVisibleItem( const QRect &r ) const; // QIconView
virtual void setGridX( int rx ); // QIconView
virtual void setGridY( int ry ); // QIconView
int gridX() const; // QIconView
@@ -278,25 +281,25 @@ public:
bool sorting() const; // QIconView
bool sortDirection() const; // QIconView
virtual void setItemsMovable( bool b ); // QIconView
bool itemsMovable() const; // QIconView
virtual void setWordWrapIconText( bool b ); // QIconView
bool wordWrapIconText() const; // QIconView
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
*/
void moved(); // QIconView
void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView
void itemRenamed( OVersatileViewItem *item ); // QIconView
//==============================================================================================//
// "Derived" API - Case 2: Methods existing in QListView and QIconView with the same signatures
//==============================================================================================//
@@ -313,82 +316,84 @@ public:
virtual void setFont( const QFont & );
virtual void setPalette( const QPalette & );
virtual void takeItem( OVersatileViewItem * );
void setSelectionMode( SelectionMode mode );
SelectionMode selectionMode() const;
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 * );
OVersatileViewItem * currentItem() const;
// bool eventFilter( QObject * o, QEvent * ); // use QWidgetStack implementation
// QSize minimumSizeHint() const; // use QWidgetStack implementation
// QSizePolicy sizePolicy() const; // use QWidgetStack implementation
// QSize sizeHint() const; // use QWidgetStack implementation
signals:
void selectionChanged();
void selectionChanged( OVersatileViewItem * );
void currentChanged( OVersatileViewItem * );
void clicked( OVersatileViewItem * );
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
virtual void setSelected( OVersatileViewItem *, bool ); // QListView
virtual void setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ); // QIconView
virtual void setSorting( int column, bool increasing = TRUE ); // QListView
void setSorting( bool sort, bool ascending = TRUE ); // QIconView
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
@@ -22,24 +22,26 @@
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/oversatileviewitem.h>
#include <opie2/oversatileview.h>
+using namespace Opie::Ui;
+
OVersatileViewItem::OVersatileViewItem( OVersatileView * parent )
:OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ),
_versatileview( parent )
{
init();
}
OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after )
:OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ),
_versatileview( parent )
{
init();
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
@@ -31,24 +31,27 @@
#ifndef OVERSATILEVIEWITEM_H
#define OVERSATILEVIEWITEM_H
/* QT */
#include <qiconview.h>
/* OPIE */
#include <opie2/olistview.h>
+namespace Opie {
+namespace Ui {
+
class OVersatileView;
class OVersatileViewItem : public OListViewItem, public QIconViewItem
{
public:
OVersatileViewItem( OVersatileView * parent );
OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after );
OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem * after );
OVersatileViewItem( OVersatileView * parent, QString,
@@ -88,13 +91,15 @@ class OVersatileViewItem : public OListViewItem, public QIconViewItem
virtual void setRenameEnabled( bool );
// TODO: Implement the remaining method multiplexers
private:
OVersatileView* _versatileview;
private:
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
@@ -29,24 +29,26 @@
*/
#include "owait.h"
/* OPIE */
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
/* QT */
#include <qlayout.h>
#include <qpainter.h>
+using namespace Opie::Ui;
+
static int frame = 0;
/**
* This will construct a modal dialog.
*
* The default timer length is 10.
*
* @param parent The parent of the widget
* @param msg The name of the object
* @param dispIcon Display Icon?
*/
OWait::OWait( QWidget *parent, const char* msg, bool dispIcon )
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
@@ -28,24 +28,27 @@
*/
#ifndef OWAIT_H
#define OWAIT_H
/* QT */
#include <qdialog.h>
#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
* @see QDialog
* @author Maximilian Reiß
*/
class OWait : public QDialog
{
Q_OBJECT
public:
@@ -73,14 +76,15 @@ class OWait : public QDialog
private:
void timerEvent( QTimerEvent * );
void paintEvent( QPaintEvent * );
QPixmap m_pix;
QLabel *m_lb;
QTimer *m_waitTimer;
int m_timerLength;
int m_aniSize;
class Private;
Private *d;
};
-
+}
+}
#endif