summaryrefslogtreecommitdiff
path: root/libopie2/opiecore
authorzecke <zecke>2004-03-13 19:51:45 (UTC)
committer zecke <zecke>2004-03-13 19:51:45 (UTC)
commit6d08277737e22b7a1527124623f3571969073ddf (patch) (unidiff)
tree4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiecore
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/opiecore') (more/less context) (ignore whitespace changes)
-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/opiecore/xmltree.cc323
-rw-r--r--libopie2/opiecore/xmltree.h119
36 files changed, 212 insertions, 490 deletions
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
@@ -62,3 +62,3 @@ const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
62 62
63using namespace Opie; 63using namespace Opie::Core;
64 64
@@ -83,7 +83,7 @@ ODevice *ODevice::inst()
83 qDebug( "ODevice() - found '%s'", (const char*) line ); 83 qDebug( "ODevice() - found '%s'", (const char*) line );
84 if ( line.contains( "sharp", false ) ) dev = new Zaurus(); 84 if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus();
85 else if ( line.contains( "ipaq", false ) ) dev = new iPAQ(); 85 else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ();
86 else if ( line.contains( "simpad", false ) ) dev = new SIMpad(); 86 else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad();
87 else if ( line.contains( "jornada", false ) ) dev = new Jornada(); 87 else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada();
88 else if ( line.contains( "ramses", false ) ) dev = new Ramses(); 88 else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses();
89 else qWarning( "ODevice() - unknown hardware - using default." ); 89 else qWarning( "ODevice() - unknown hardware - using default." );
@@ -189,3 +189,3 @@ bool ODevice::suspend()
189 ODevice::sendSuspendmsg(); 189 ODevice::sendSuspendmsg();
190 190
191 struct timeval tvs, tvn; 191 struct timeval tvs, tvn;
@@ -626,2 +626,5 @@ void ODevice::sendSuspendmsg()
626{ 626{
627 if ( isQWS() )
628 return;
629
627 QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); 630 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
@@ -42,4 +42,5 @@ _;:, .> :=|. This program is free software; you can
42 42
43namespace Opie 43namespace Opie{
44{ 44namespace Core{
45
45 class ODeviceData; 46 class ODeviceData;
@@ -252,3 +253,3 @@ public:
252 * button. Note that this list only contains "user mappable" buttons. 253 * button. Note that this list only contains "user mappable" buttons.
253 * 254 *
254 * @todo Make method const and take care of calling initButtons or make that const too 255 * @todo Make method const and take care of calling initButtons or make that const too
@@ -316,2 +317,3 @@ class ODeviceData {
316} 317}
318}
317 319
@@ -330,2 +332,3 @@ static QCString makeChannel ( const char *str )
330 332
333
331#endif 334#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
@@ -55,2 +55,6 @@
55 55
56
57using namespace Opie::Core;
58using namespace Opie::Core::Private;
59
56/* KERNEL */ 60/* KERNEL */
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
@@ -37,3 +37,5 @@
37 37
38using namespace Opie; 38namespace Opie {
39namespace Core {
40namespace Private {
39 41
@@ -83,2 +85,6 @@ struct i_button {
83 85
86}
87}
88}
89
84#endif 90#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
@@ -79,3 +79,3 @@ typedef struct {
79 79
80using namespace Opie; 80using namespace Opie::Core::Private;
81 81
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
@@ -34,4 +34,5 @@
34 34
35using namespace Opie; 35namespace Opie {
36 36namespace Core {
37namespace Private {
37class Jornada : public ODevice 38class Jornada : public ODevice
@@ -47,3 +48,5 @@ class Jornada : public ODevice
47}; 48};
48 49}
50}
51}
49#endif 52#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
@@ -55,2 +55,5 @@
55 55
56using namespace Opie::Core;
57using namespace Opie::Core::Private;
58
56struct r_button ramses_buttons [] = { 59struct r_button ramses_buttons [] = {
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
@@ -36,3 +36,5 @@
36 36
37using namespace Opie; 37namespace Opie {
38namespace Core {
39namespace Private {
38 40
@@ -70,2 +72,5 @@ struct r_button {
70}; 72};
73}
74}
75}
71 76
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
@@ -55,3 +55,4 @@ _;:, .> :=|. This program is free software; you can
55 55
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
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
@@ -37,3 +37,5 @@
37 37
38using namespace Opie; 38namespace Opie {
39namespace Core {
40namespace Private {
39 41
@@ -80,2 +82,6 @@ struct s_button {
80 82
83}
84}
85}
86
81#endif 87#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
@@ -55,3 +55,4 @@ _;:,     .>    :=|. This program is free software; you can
55 55
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
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
@@ -34,4 +34,5 @@ _;:,     .>    :=|. This program is free software; you can
34 34
35using namespace Opie; 35namespace Opie {
36 36namespace Core {
37namespace Private {
37class Yopy : public ODevice 38class Yopy : public ODevice
@@ -61,2 +62,6 @@ struct yopy_button
61 62
63}
64}
65}
66
62#endif 67#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
@@ -55,3 +55,4 @@ _;:, .> :=|. This program is free software; you can
55 55
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
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
@@ -47,4 +47,6 @@
47 47
48using namespace Opie;
49 48
49namespace Opie {
50namespace Core {
51namespace Private {
50class Zaurus : public ODevice 52class Zaurus : public ODevice
@@ -94,3 +96,5 @@ struct z_button {
94}; 96};
95 97}
98}
99}
96#endif 100#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
@@ -35,3 +35,6 @@
35 35
36using namespace Opie; 36
37namespace Opie {
38namespace Core {
39namespace Private {
37 40
@@ -44,3 +47,6 @@ class OQCopMessageData
44}; 47};
48}
45 49
50using namespace Opie::Core;
51using namespace Opie::Core::Private;
46 52
@@ -126,4 +132,4 @@ void OQCopMessage::setData ( const QByteArray &data )
126 132
127/*! \class Opie::ODeviceButton 133/*! \class Opie::Core::ODeviceButton
128 \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. 134 \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device.
129 135
@@ -246 +252,4 @@ void ODeviceButton::setHeldAction(const OQCopMessage& action)
246} 252}
253
254}
255}
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
@@ -25,6 +25,8 @@
25 25
26class OQCopMessageData;
27 26
28namespace Opie 27namespace Opie{
29{ 28namespace Core{
29namespace Private {
30class OQCopMessageData;
31}
30 32
@@ -54,3 +56,3 @@ private:
54 56
55 OQCopMessageData *d; 57 Private::OQCopMessageData *d;
56 class Private; 58 class Private;
@@ -106,2 +108,3 @@ class ODeviceButton
106} 108}
109}
107 110
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
@@ -36,2 +36,5 @@
36 36
37using namespace Opie::Core;
38
39
37OApplication* OApplication::_instance = 0; 40OApplication* OApplication::_instance = 0;
@@ -42,2 +45,5 @@ OApplication* OApplication::_instance = 0;
42 45
46namespace Opie {
47namespace Core {
48namespace Private {
43class OApplicationPrivate 49class OApplicationPrivate
@@ -48,2 +54,3 @@ class OApplicationPrivate
48}; 54};
55}
49 56
@@ -86,3 +93,3 @@ void OApplication::init()
86{ 93{
87 d = new OApplicationPrivate(); 94 d = new Private::OApplicationPrivate();
88 if ( !OApplication::_instance ) 95 if ( !OApplication::_instance )
@@ -127 +134,3 @@ void OApplication::setTitle( const QString& title ) const
127 134
135}
136}
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
@@ -32,3 +32,3 @@
32 32
33#define oApp OApplication::oApplication() 33#define oApp Opie::Core::OApplication::oApplication()
34 34
@@ -37,4 +37,8 @@
37 37
38 38namespace Opie {
39namespace Core {
40namespace Private {
39class OApplicationPrivate; 41class OApplicationPrivate;
42} // private class
43
40class OConfig; 44class OConfig;
@@ -100,5 +104,8 @@ class OApplication : public QPEApplication
100 OConfig* _config; 104 OConfig* _config;
101 OApplicationPrivate* d; 105 Private::OApplicationPrivate* d;
102}; 106};
103 107
108} // Core
109} // Opie
110
104#endif // OAPPLICATION_H 111#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
@@ -40,2 +40,4 @@
40 40
41using namespace Opie::Core;
42
41OConfig::OConfig( const QString &name, Domain domain ) 43OConfig::OConfig( const QString &name, Domain domain )
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
@@ -42,2 +42,5 @@ class QFont;
42 42
43namespace Opie {
44namespace Core {
45
43/** 46/**
@@ -64,2 +67,3 @@ class OConfig : public Config
64 * The current group is used for searching keys and accessing entries. 67 * The current group is used for searching keys and accessing entries.
68 * @todo make const
65 */ 69 */
@@ -74,2 +78,6 @@ class OConfig : public Config
74 QFont readFontEntry( const QString& key, const QFont* pDefault ) const; 78 QFont readFontEntry( const QString& key, const QFont* pDefault ) const;
79
80private:
81 class Private;
82 Private *d;
75}; 83};
@@ -138,3 +146,8 @@ class OConfigGroupSaver
138 OConfigGroupSaver& operator=( const OConfigGroupSaver& ); 146 OConfigGroupSaver& operator=( const OConfigGroupSaver& );
147
148 class Private;
149 Private *d;
139}; 150};
151}
152}
140 153
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
@@ -67,3 +67,4 @@
67 67
68 68namespace Opie {
69namespace Core {
69/*====================================================================================== 70/*======================================================================================
@@ -616,2 +617,3 @@ void odClearDebugConfig()
616 617
618
617#ifdef OPIE_NO_DEBUG 619#ifdef OPIE_NO_DEBUG
@@ -620 +622,4 @@ void odClearDebugConfig()
620#endif 622#endif
623
624}
625} \ 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
@@ -49,2 +49,5 @@ class QBrush;
49 49
50namespace Opie {
51namespace Core {
52
50class odbgstream; 53class odbgstream;
@@ -396,2 +399,6 @@ class ondbgstream {
396 ondbgstream& operator<<( const QBrush & ) { return *this; } 399 ondbgstream& operator<<( const QBrush & ) { return *this; }
400
401private:
402 class Private;
403 Private *d;
397}; 404};
@@ -474 +481,3 @@ void odClearDebugConfig();
474 481
482}
483}
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
@@ -40,2 +40,4 @@
40 40
41using namespace Opie::Core;
42
41static const char Base64EncMap[64] = 43static const char Base64EncMap[64] =
@@ -314,3 +316,3 @@ bool OGlobal::isAppLnkFileName( const QString& str )
314{ 316{
315 if (str.length()==0||str.at(str.length()-1)==QDir::separator()) return false; 317 if (str.isEmpty()||str.at(str.length()-1)==QDir::separator()) return false;
316 return str.startsWith(MimeType::appsFolderName()+QDir::separator()); 318 return str.startsWith(MimeType::appsFolderName()+QDir::separator());
@@ -325,3 +327,3 @@ bool OGlobal::isDocumentFileName( const QString& file )
325{ 327{
326 if (file.length()==0||file.at(file.length()-1)==QDir::separator()) return false; 328 if (file.isEmpty()||file.at(file.length()-1)==QDir::separator()) return false;
327 if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true; 329 if (file.startsWith(QPEApplication::documentDir()+QDir::separator())) return true;
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
@@ -54,2 +54,7 @@ class QString;
54class DateFormat; 54class DateFormat;
55
56
57
58namespace Opie {
59namespace Core {
55/** 60/**
@@ -148,4 +153,7 @@ private:
148 static OConfig* _qpe_config; 153 static OConfig* _qpe_config;
154 class Private;
155 Private *d;
149}; 156};
150 157}
158}
151#endif // OGLOBAL_H 159#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
@@ -46,2 +46,5 @@
46 46
47
48using namespace Opie::Core;
49
47QString* OGlobalSettings::s_desktopPath = 0; 50QString* OGlobalSettings::s_desktopPath = 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
@@ -38,2 +38,5 @@
38 38
39/**
40 * \todo make real const values
41 */
39#define OPIE_DEFAULT_SINGLECLICK true 42#define OPIE_DEFAULT_SINGLECLICK true
@@ -51,2 +54,5 @@
51 54
55namespace Opie {
56namespace Core {
57
52/** 58/**
@@ -370,4 +376,10 @@ private:
370 friend class OApplication; 376 friend class OApplication;
377private:
378 class Private;
379 Private *d;
371}; 380};
372 381
382}
383}
384
373#endif 385#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
@@ -11,4 +11,3 @@ HEADERS = oapplication.h \
11 osmartpointer.h \ 11 osmartpointer.h \
12 ostorageinfo.h \ 12 ostorageinfo.h
13 xmltree.h
14 13
@@ -21,4 +20,3 @@ SOURCES = oapplication.cpp \
21 oprocctrl.cpp \ 20 oprocctrl.cpp \
22 ostorageinfo.cpp \ 21 ostorageinfo.cpp
23 xmltree.cc
24 22
@@ -28,3 +26,3 @@ INTERFACES =
28TARGET = opiecore2 26TARGET = opiecore2
29VERSION = 1.8.5 27VERSION = 1.9.0
30INCLUDEPATH += $(OPIEDIR)/include 28INCLUDEPATH += $(OPIEDIR)/include
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
@@ -43,2 +43,4 @@
43 43
44using namespace Opie::Core::Private;
45
44OProcessController *OProcessController::theOProcessController = 0; 46OProcessController *OProcessController::theOProcessController = 0;
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
@@ -36,5 +36,10 @@
36 36
37class OProcessControllerPrivate;
38class QSocketNotifier; 37class QSocketNotifier;
39 38
39
40namespace Opie {
41namespace Core {
42namespace Private {
43class OProcessControllerPrivate;
44
40/** 45/**
@@ -117,2 +122,5 @@ private:
117 122
123}
124}
125}
118 126
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
@@ -63,2 +63,7 @@ _;:,     .>    :=|. This program is free software; you can
63 63
64using namespace Opie::Core::Private;
65
66namespace Opie {
67namespace Core {
68namespace Private {
64class OProcessPrivate 69class OProcessPrivate
@@ -74,3 +79,3 @@ public:
74}; 79};
75 80}
76 81
@@ -943 +948,4 @@ int OProcess::processPID( const QString& process )
943} 948}
949
950}
951}
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
@@ -45,3 +45,9 @@ _;:,     .>    :=|. This program is free software; you can
45class QSocketNotifier; 45class QSocketNotifier;
46
47namespace Opie {
48namespace Core {
49namespace Private {
50class OProcessController;
46class OProcessPrivate; 51class OProcessPrivate;
52}
47 53
@@ -399,2 +405,3 @@ public:
399 * Lets you see what your arguments are for debugging. 405 * Lets you see what your arguments are for debugging.
406 * \todo make const
400 */ 407 */
@@ -718,3 +725,3 @@ protected:
718 */ 725 */
719 friend class OProcessController; 726 friend class Private::OProcessController;
720 727
@@ -747,4 +754,6 @@ private:
747 void init ( ); 754 void init ( );
748 OProcessPrivate *d; 755 Private::OProcessPrivate *d;
749}; 756};
757}
758}
750 759
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
@@ -42,2 +42,3 @@ _;:, .> :=|. This program is free software; you can
42namespace Opie { 42namespace Opie {
43namespace Core {
43 44
@@ -142,2 +143,3 @@ public:
142} 143}
144}
143 145
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
@@ -31,2 +31,4 @@
31 31
32using namespace Opie::Core;
33
32OStorageInfo::OStorageInfo( QObject *parent ) 34OStorageInfo::OStorageInfo( QObject *parent )
diff --git a/libopie2/opiecore/ostorageinfo.h b/libopie2/opiecore/ostorageinfo.h
index 740fa85..4e1097f 100644
--- a/libopie2/opiecore/ostorageinfo.h
+++ b/libopie2/opiecore/ostorageinfo.h
@@ -34,2 +34,5 @@
34 34
35namespace Opie {
36namespace Core {
37
35class OStorageInfo : public StorageInfo 38class OStorageInfo : public StorageInfo
@@ -58,4 +61,9 @@ class OStorageInfo : public StorageInfo
58 QString mmcPath() const; 61 QString mmcPath() const;
62private:
63 class Private;
64 Private *d;
59}; 65};
60 66
67}
68}
61#endif // OSTORAGE_H 69#endif // OSTORAGE_H
diff --git a/libopie2/opiecore/xmltree.cc b/libopie2/opiecore/xmltree.cc
deleted file mode 100644
index 059791b..0000000
--- a/libopie2/opiecore/xmltree.cc
+++ b/dev/null
@@ -1,323 +0,0 @@
1/* This file is part of the KDE project
2 Copyright (C) 2001 Simon Hausmann <hausmann@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19
20#include <opie2/xmltree.h>
21
22#include <qpe/stringutil.h>
23
24#include <qxml.h>
25
26#include <assert.h>
27
28using namespace Opie;
29
30XMLElement::XMLElement()
31 : m_parent( 0 ), m_next( 0 ), m_prev( 0 ), m_first( 0 ), m_last( 0 )
32{
33}
34
35XMLElement::~XMLElement()
36{
37 XMLElement *n = m_first;
38
39 while ( n )
40 {
41 XMLElement *tmp = n;
42 n = n->m_next;
43 delete tmp;
44 }
45}
46
47void XMLElement::appendChild( XMLElement *child )
48{
49 if ( child->m_parent )
50 child->m_parent->removeChild( child );
51
52 child->m_parent = this;
53
54 if ( m_last )
55 m_last->m_next = child;
56
57 child->m_prev = m_last;
58
59 if ( !m_first )
60 m_first = child;
61
62 m_last = child;
63}
64
65void XMLElement::insertAfter( XMLElement *newChild, XMLElement *refChild )
66{
67 assert( newChild != refChild );
68
69 if ( refChild == m_last )
70 {
71 appendChild( newChild );
72 return;
73 }
74
75 assert( refChild );
76 assert( refChild->m_parent );
77 assert( refChild->m_parent == this );
78
79 if ( newChild->m_parent && newChild != refChild )
80 newChild->m_parent->removeChild( newChild );
81
82 newChild->m_parent = this;
83
84 XMLElement *next = refChild->m_next;
85
86 refChild->m_next = newChild;
87
88 newChild->m_prev = refChild;
89 newChild->m_next = next;
90
91 if ( next )
92 next->m_prev = newChild;
93}
94
95QString XMLElement::attribute( const QString &attr ) const
96{
97 AttributeMap::ConstIterator it = m_attributes.find( attr );
98 if ( it == m_attributes.end() )
99 return QString::null;
100 return it.data();
101}
102
103void XMLElement::setAttribute( const QString &attr, const QString &value )
104{
105 m_attributes.replace( attr, value );
106}
107
108void XMLElement::insertBefore( XMLElement *newChild, XMLElement *refChild )
109{
110 assert( refChild );
111 assert( refChild->m_parent );
112 assert( refChild->m_parent == this );
113 assert( newChild != refChild );
114
115 if ( newChild->m_parent && newChild != refChild )
116 newChild->m_parent->removeChild( newChild );
117
118 newChild->m_parent = this;
119
120 XMLElement *prev = refChild->m_prev;
121
122 refChild->m_prev = newChild;
123
124 newChild->m_prev = prev;
125 newChild->m_next = refChild;
126
127 if ( prev )
128 prev->m_next = newChild;
129
130 if ( refChild == m_first )
131 m_first = newChild;
132}
133
134void XMLElement::removeChild( XMLElement *child )
135{
136 if ( child->m_parent != this )
137 return;
138
139 if ( m_first == child )
140 m_first = child->m_next;
141
142 if ( m_last == child )
143 m_last = child->m_prev;
144
145 if ( child->m_prev )
146 child->m_prev->m_next = child->m_next;
147
148 if ( child->m_next )
149 child->m_next->m_prev = child->m_prev;
150
151 child->m_parent = 0;
152 child->m_prev = 0;
153 child->m_next = 0;
154}
155
156void XMLElement::save( QTextStream &s, uint indent )
157{
158 if ( !m_value.isEmpty() )
159 {
160 s << Qtopia::escapeString( m_value );
161 return;
162 }
163
164 for ( uint i = 0; i < indent; ++i )
165 s << " ";
166
167 s << "<" << m_tag;
168
169 if ( !m_attributes.isEmpty() )
170 {
171 s << " ";
172 AttributeMap::ConstIterator it = m_attributes.begin();
173 AttributeMap::ConstIterator end = m_attributes.end();
174 for (; it != end; ++it )
175 {
176 s << it.key() << "=\"" << Qtopia::escapeString( it.data() ) << "\"";
177 s << " ";
178 }
179 }
180
181 if ( m_last )
182 {
183 if ( ( m_first && !m_first->value().isEmpty() ) || !m_parent )
184 s << ">";
185 else
186 s << ">" << endl;
187
188 int newIndent = indent;
189 if ( m_parent )
190 newIndent++;
191
192 XMLElement *n = m_first;
193 while ( n )
194 {
195 n->save( s, newIndent );
196 n = n->nextChild();
197 }
198
199 if ( m_last && m_last->value().isEmpty() && m_parent )
200 for ( uint i = 0; i < indent; ++i )
201 s << " ";
202
203 if ( m_parent )
204 s << "</" << m_tag << ">" << endl;
205 }
206 else
207 s << "/>" << endl;
208}
209
210class Handler : public QXmlDefaultHandler
211{
212public:
213 Handler() : m_node( 0 ), m_root( 0 ) {}
214
215 XMLElement *root() const { return m_root; }
216
217 virtual bool startDocument();
218 virtual bool endDocument();
219 virtual bool startElement( const QString &ns, const QString &ln, const QString &qName,
220 const QXmlAttributes &attr );
221 virtual bool endElement( const QString &ns, const QString &ln, const QString &qName );
222 virtual bool characters( const QString &ch );
223
224private:
225 XMLElement *m_node;
226 XMLElement *m_root;
227};
228
229bool Handler::startDocument()
230{
231 m_root = m_node = new XMLElement;
232
233 return true;
234}
235
236bool Handler::endDocument()
237{
238 return m_root == m_node;
239}
240
241bool Handler::startElement( const QString &, const QString &, const QString &qName,
242 const QXmlAttributes &attr )
243{
244 XMLElement *bm = new XMLElement;
245
246 XMLElement::AttributeMap attributes;
247 for ( int i = 0; i < attr.length(); ++i )
248 attributes[ attr.qName( i ) ] = attr.value( i );
249
250 bm->setAttributes( attributes );
251
252 bm->setTagName( qName );
253
254 m_node->appendChild( bm );
255 m_node = bm;
256
257 return true;
258}
259
260bool Handler::endElement( const QString &, const QString &, const QString & )
261{
262 if ( m_node == m_root )
263 return false;
264
265 m_node = m_node->parent();
266 return true;
267}
268
269bool Handler::characters( const QString &ch )
270{
271 XMLElement *textNode = new XMLElement;
272 textNode->setValue( ch );
273 m_node->appendChild( textNode );
274 return true;
275}
276
277XMLElement *XMLElement::namedItem( const QString &name )
278{
279 XMLElement *e = m_first;
280
281 for (; e; e = e->nextChild() )
282 if ( e->tagName() == name )
283 return e;
284
285 return 0;
286}
287
288XMLElement *XMLElement::clone() const
289{
290 XMLElement *res = new XMLElement;
291
292 res->setTagName( m_tag );
293 res->setValue( m_value );
294 res->setAttributes( m_attributes );
295
296 XMLElement *e = m_first;
297 for (; e; e = e->m_next )
298 res->appendChild( e->clone() );
299
300 return res;
301}
302
303XMLElement *XMLElement::load( const QString &fileName )
304{
305 QFile f( fileName );
306 if ( !f.open( IO_ReadOnly ) )
307 return 0;
308
309 QTextStream stream( &f );
310 stream.setEncoding( QTextStream::UnicodeUTF8 );
311 QXmlInputSource src( stream );
312 QXmlSimpleReader reader;
313 Handler handler;
314
315 reader.setFeature( "http://trolltech.com/xml/features/report-whitespace-only-CharData", false );
316 reader.setContentHandler( &handler );
317 reader.parse( src );
318
319 return handler.root();;
320}
321
322/* vim: et sw=4
323 */
diff --git a/libopie2/opiecore/xmltree.h b/libopie2/opiecore/xmltree.h
deleted file mode 100644
index 4b6bdfa..0000000
--- a/libopie2/opiecore/xmltree.h
+++ b/dev/null
@@ -1,119 +0,0 @@
1/* This file is part of the KDE project
2 Copyright (C) 2000,2001 Simon Hausmann <hausmann@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19
20
21#ifndef __bookmarks_h__
22#define __bookmarks_h__
23
24#include <qstring.h>
25#include <qmap.h>
26#include <qtextstream.h>
27
28namespace Opie
29{
30
31/**
32 * A small xml lib written by Simon Hausmann.
33 */
34class XMLElement
35{
36public:
37 typedef QMap<QString, QString> AttributeMap;
38
39 /**
40 * The constructor of XMLElement
41 */
42 XMLElement();
43 ~XMLElement();
44
45 /** appendChild appends a child to the XMLElement behind the last element.
46 * The ownership of the child get's transfered to the
47 * this XMLElement.
48 * If child is already the child of another parent
49 * it's get removed from the other parent first.
50 */
51 void appendChild( XMLElement *child );
52
53 /** inserts newChild after refChild. If newChild is the child
54 * of another parent the child will get removed.
55 * The ownership of child gets transfered.
56 *
57 */
58 void insertAfter( XMLElement *newChild, XMLElement *refChild );
59
60 /** same as insertAfter but the element get's inserted before refChild.
61 *
62 */
63 void insertBefore( XMLElement *newChild, XMLElement *refChild );
64
65 /** removeChild removes the child from the XMLElement.
66 * The ownership gets dropped. You need to delete the
67 * child yourself.
68 */
69 void removeChild( XMLElement *child );
70
71 /** parent() returns the parent of this XMLElement
72 * If there is no parent 0l gets returned
73 */
74 XMLElement *parent() const { return m_parent; }
75 XMLElement *firstChild() const { return m_first; }
76 XMLElement *nextChild() const { return m_next; }
77 XMLElement *prevChild() const { return m_prev; }
78 XMLElement *lastChild() const { return m_last; }
79
80 void setTagName( const QString &tag ) { m_tag = tag; }
81 QString tagName() const { return m_tag; }
82
83 void setValue( const QString &val ) { m_value = val; }
84 QString value() const { return m_value; }
85
86 void setAttributes( const AttributeMap &attrs ) { m_attributes = attrs; }
87 AttributeMap attributes() const { return m_attributes; }
88 AttributeMap &attributes() { return m_attributes; }
89
90 QString attribute( const QString & ) const;
91 void setAttribute( const QString &attr, const QString &value );
92 void save( QTextStream &stream, uint indent = 0 );
93
94 XMLElement *namedItem( const QString &name );
95
96 XMLElement *clone() const;
97
98 static XMLElement *load( const QString &fileName );
99
100private:
101 QString m_tag;
102 QString m_value;
103 AttributeMap m_attributes;
104
105 XMLElement *m_parent;
106 XMLElement *m_next;
107 XMLElement *m_prev;
108 XMLElement *m_first;
109 XMLElement *m_last;
110
111 XMLElement( const XMLElement &rhs );
112 XMLElement &operator=( const XMLElement &rhs );
113 class Private;
114 Private* d;
115};
116
117} // namespace Opie
118
119#endif