author | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
commit | 6d08277737e22b7a1527124623f3571969073ddf (patch) (unidiff) | |
tree | 4129e674e21df767b31299e873dd44e33a308e1b /libopie2/examples | |
parent | 8e28911f7199f4450ac5eef09482069f9b9caea2 (diff) | |
download | opie-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
25 files changed, 75 insertions, 42 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,31 +1,33 @@ | |||
1 | #include <opie2/oapplication.h> | 1 | #include <opie2/oapplication.h> |
2 | #include <opie2/oconfig.h> | 2 | #include <opie2/oconfig.h> |
3 | #include <qpe/config.h> | 3 | #include <qpe/config.h> |
4 | 4 | ||
5 | using namespace Opie::Core; | ||
6 | |||
5 | int main( int argc, char** argv ) | 7 | int main( int argc, char** argv ) |
6 | { | 8 | { |
7 | OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" ); | 9 | OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" ); |
8 | 10 | ||
9 | OConfigGroupSaver c1( app->config(), "MyGroup" ); | 11 | OConfigGroupSaver c1( app->config(), "MyGroup" ); |
10 | app->config()->writeEntry( "AnEntry", "InMyGroup" ); | 12 | app->config()->writeEntry( "AnEntry", "InMyGroup" ); |
11 | { | 13 | { |
12 | OConfigGroupSaver c2( c1.config(), "AnotherGroup" ); | 14 | OConfigGroupSaver c2( c1.config(), "AnotherGroup" ); |
13 | app->config()->writeEntry( "AnEntry", "InAnotherGroup" ); | 15 | app->config()->writeEntry( "AnEntry", "InAnotherGroup" ); |
14 | } // closing the scope returns to the last group | 16 | } // closing the scope returns to the last group |
15 | 17 | ||
16 | app->config()->writeEntry( "AnotherEntry", "InMyGroup" ); | 18 | app->config()->writeEntry( "AnotherEntry", "InMyGroup" ); |
17 | 19 | ||
18 | // do more stuff ... | 20 | // do more stuff ... |
19 | 21 | ||
20 | // in this (special) case it is necessary to manually call OConfig::write() (see below) | 22 | // in this (special) case it is necessary to manually call OConfig::write() (see below) |
21 | app->config()->write(); | 23 | app->config()->write(); |
22 | 24 | ||
23 | // can't delete the app when using the OConfigGroupSaver on top level scope, | 25 | // can't delete the app when using the OConfigGroupSaver on top level scope, |
24 | // because the destructor of the OConfigGroupSaver needs an application object | 26 | // because the destructor of the OConfigGroupSaver needs an application object |
25 | //delete app; // destructor deletes config which writes changes back to disk | 27 | //delete app; // destructor deletes config which writes changes back to disk |
26 | 28 | ||
27 | return 0; | 29 | return 0; |
28 | 30 | ||
29 | } | 31 | } |
30 | 32 | ||
31 | //#include "moc/oconfigdemo.moc" | 33 | //#include "moc/oconfigdemo.moc" |
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 | |||
@@ -1,67 +1,69 @@ | |||
1 | /* QT */ | 1 | /* QT */ |
2 | 2 | ||
3 | #include <qvbox.h> | 3 | #include <qvbox.h> |
4 | #include <qhbox.h> | 4 | #include <qhbox.h> |
5 | #include <qvbuttongroup.h> | 5 | #include <qvbuttongroup.h> |
6 | #include <qhbuttongroup.h> | 6 | #include <qhbuttongroup.h> |
7 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
8 | #include <qradiobutton.h> | 8 | #include <qradiobutton.h> |
9 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
10 | 10 | ||
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | 12 | ||
13 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
14 | 14 | ||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/oapplication.h> | 16 | #include <opie2/oapplication.h> |
17 | #include <opie2/oglobal.h> | 17 | #include <opie2/oglobal.h> |
18 | #include <opie2/oglobalsettings.h> | 18 | #include <opie2/oglobalsettings.h> |
19 | 19 | ||
20 | using namespace Opie::Core; | ||
21 | |||
20 | class DemoApp : public OApplication | 22 | class DemoApp : public OApplication |
21 | { | 23 | { |
22 | Q_OBJECT | 24 | Q_OBJECT |
23 | public: | 25 | public: |
24 | DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) | 26 | DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) |
25 | { | 27 | { |
26 | // you have access to your OApplication object via oApp | 28 | // you have access to your OApplication object via oApp |
27 | qDebug( "Process-wide OApplication object @ %0x", oApp ); | 29 | qDebug( "Process-wide OApplication object @ %0x", oApp ); |
28 | 30 | ||
29 | // you have access to global settings via OGlobalSettings | 31 | // you have access to global settings via OGlobalSettings |
30 | int mode = OGlobalSettings::debugMode(); | 32 | int mode = OGlobalSettings::debugMode(); |
31 | 33 | ||
32 | QVBox* vbox = new QVBox(); | 34 | QVBox* vbox = new QVBox(); |
33 | setMainWidget( vbox ); | 35 | setMainWidget( vbox ); |
34 | 36 | ||
35 | g = new QVButtonGroup( "Output Strategy", vbox ); | 37 | g = new QVButtonGroup( "Output Strategy", vbox ); |
36 | QRadioButton* r0 = new QRadioButton( "file", g ); | 38 | QRadioButton* r0 = new QRadioButton( "file", g ); |
37 | QRadioButton* r1 = new QRadioButton( "messagebox", g ); | 39 | QRadioButton* r1 = new QRadioButton( "messagebox", g ); |
38 | QRadioButton* r2 = new QRadioButton( "stderr", g ); | 40 | QRadioButton* r2 = new QRadioButton( "stderr", g ); |
39 | QRadioButton* r3 = new QRadioButton( "syslog", g ); | 41 | QRadioButton* r3 = new QRadioButton( "syslog", g ); |
40 | QRadioButton* r4 = new QRadioButton( "socket", g ); | 42 | QRadioButton* r4 = new QRadioButton( "socket", g ); |
41 | g->insert( r0, 0 ); | 43 | g->insert( r0, 0 ); |
42 | g->insert( r1, 1 ); | 44 | g->insert( r1, 1 ); |
43 | g->insert( r2, 2 ); | 45 | g->insert( r2, 2 ); |
44 | g->insert( r3, 3 ); | 46 | g->insert( r3, 3 ); |
45 | g->insert( r4, 4 ); | 47 | g->insert( r4, 4 ); |
46 | g->setRadioButtonExclusive( true ); | 48 | g->setRadioButtonExclusive( true ); |
47 | connect( g, SIGNAL( clicked(int) ), this, SLOT( chooseMethod(int) ) ); | 49 | connect( g, SIGNAL( clicked(int) ), this, SLOT( chooseMethod(int) ) ); |
48 | 50 | ||
49 | if ( mode != -1 ) g->setButton( mode ); | 51 | if ( mode != -1 ) g->setButton( mode ); |
50 | 52 | ||
51 | QHButtonGroup* hbox = new QHButtonGroup( "Extra Output Information", vbox ); | 53 | QHButtonGroup* hbox = new QHButtonGroup( "Extra Output Information", vbox ); |
52 | e = new QLineEdit( hbox ); | 54 | e = new QLineEdit( hbox ); |
53 | QPushButton* pb = new QPushButton( hbox ); | 55 | QPushButton* pb = new QPushButton( hbox ); |
54 | 56 | ||
55 | connect( e, SIGNAL( returnPressed() ), this, SLOT( updateDebugOutput() ) ); | 57 | connect( e, SIGNAL( returnPressed() ), this, SLOT( updateDebugOutput() ) ); |
56 | connect( pb, SIGNAL( clicked() ), this, SLOT( updateDebugOutput() ) ); | 58 | connect( pb, SIGNAL( clicked() ), this, SLOT( updateDebugOutput() ) ); |
57 | 59 | ||
58 | // show the additional debug mode dependent output information | 60 | // show the additional debug mode dependent output information |
59 | e->setText( OGlobalSettings::debugOutput() ); | 61 | e->setText( OGlobalSettings::debugOutput() ); |
60 | 62 | ||
61 | // buttos | 63 | // buttos |
62 | QPushButton* info = new QPushButton( "Emit Debug(Info) Output!", vbox ); | 64 | QPushButton* info = new QPushButton( "Emit Debug(Info) Output!", vbox ); |
63 | connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); | 65 | connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); |
64 | QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); | 66 | QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); |
65 | connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); | 67 | connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); |
66 | QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); | 68 | QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); |
67 | connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); | 69 | connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); |
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 @@ | |||
1 | #include <opie2/oglobalsettings.h> | 1 | #include <opie2/oglobalsettings.h> |
2 | #include <iostream.h> | 2 | #include <iostream> |
3 | |||
4 | using namespace Opie::Core; | ||
3 | 5 | ||
4 | int main( int argc, char** argv ) | 6 | int main( int argc, char** argv ) |
5 | { | 7 | { |
6 | printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() ); | 8 | printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() ); |
7 | printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() ); | 9 | printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() ); |
8 | 10 | ||
9 | return 0; | 11 | return 0; |
10 | 12 | ||
11 | } | 13 | } |
12 | 14 | ||
13 | //#include "moc/oconfigdemo.moc" | 15 | //#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 @@ | |||
1 | #include <opie2/oprocess.h> | 1 | #include <opie2/oprocess.h> |
2 | #include <iostream.h> | 2 | #include <iostream> |
3 | |||
4 | using namespace Opie::Core; | ||
3 | 5 | ||
4 | int main( int argc, char** argv ) | 6 | int main( int argc, char** argv ) |
5 | { | 7 | { |
6 | printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) ); | 8 | printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) ); |
7 | printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) ); | 9 | printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) ); |
8 | 10 | ||
9 | return 0; | 11 | return 0; |
10 | } | 12 | } |
11 | 13 | ||
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,41 +1,43 @@ | |||
1 | #include <qdir.h> | 1 | #include <qdir.h> |
2 | 2 | ||
3 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
4 | #include "../osqlmanager.h" | 4 | #include <opie2/osqlmanager.h> |
5 | #include "../osqlquery.h" | 5 | #include <opie2/osqlquery.h> |
6 | #include "../osqldriver.h" | 6 | #include <opie2/osqldriver.h> |
7 | #include "../osqlresult.h" | 7 | #include <opie2/osqlresult.h> |
8 | |||
9 | using namespace Opie::DB; | ||
8 | 10 | ||
9 | int main( int argc, char* argv[] ) { | 11 | int main( int argc, char* argv[] ) { |
10 | 12 | ||
11 | QPEApplication app( argc, argv ); | 13 | QPEApplication app( argc, argv ); |
12 | OSQLManager man; | 14 | OSQLManager man; |
13 | man.registerPath( QDir::currentDirPath() ); | 15 | man.registerPath( QDir::currentDirPath() ); |
14 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
15 | 17 | ||
16 | OSQLDriver *driver = man.standard(); | 18 | OSQLDriver *driver = man.standard(); |
17 | qWarning("testmain" + driver->id() ); | 19 | qWarning("testmain" + driver->id() ); |
18 | driver->setUrl("/home/ich/spaltenweise"); | 20 | driver->setUrl("/home/ich/spaltenweise"); |
19 | if ( driver->open() ) { | 21 | if ( driver->open() ) { |
20 | qWarning("could open"); | 22 | qWarning("could open"); |
21 | }else | 23 | }else |
22 | qWarning("wasn't able to open"); | 24 | qWarning("wasn't able to open"); |
23 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" | 25 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" |
24 | "uid,categories,completed," | 26 | "uid,categories,completed," |
25 | "progress,summary,HasDate," | 27 | "progress,summary,HasDate," |
26 | "DateDay,DateMonth,DateYear," | 28 | "DateDay,DateMonth,DateYear," |
27 | "priority,description)" ); | 29 | "priority,description)" ); |
28 | 30 | ||
29 | OSQLResult res = driver->query( raw ); | 31 | OSQLResult res = driver->query( raw ); |
30 | delete raw; | 32 | delete raw; |
31 | for (int i = 0; i< 10000; i++ ) { | 33 | for (int i = 0; i< 10000; i++ ) { |
32 | int uid = i; | 34 | int uid = i; |
33 | OSQLRawQuery raw("insert into todolist VALUES("+ | 35 | OSQLRawQuery raw("insert into todolist VALUES("+ |
34 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ | 36 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ |
35 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ | 37 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ |
36 | "'Description\n12344')"); | 38 | "'Description\n12344')"); |
37 | OSQLResult res = driver->query( &raw ); | 39 | OSQLResult res = driver->query( &raw ); |
38 | 40 | ||
39 | } | 41 | } |
40 | return 0; | 42 | return 0; |
41 | }; | 43 | }; |
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 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = | 3 | HEADERS = |
4 | SOURCES = spaltenweise.cpp | 4 | SOURCES = spaltenweise.cpp |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
7 | LIBS += -lqpe -lopiesql | 7 | LIBS += -lqpe -lopiedb2 |
8 | TARGET = spaltenweise | 8 | TARGET = spaltenweise |
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | 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,55 +1,57 @@ | |||
1 | #include <qdir.h> | 1 | #include <qdir.h> |
2 | 2 | ||
3 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
4 | #include "../osqlmanager.h" | 4 | #include <opie2/osqlmanager.h> |
5 | #include "../osqlquery.h" | 5 | #include <opie2/osqlquery.h> |
6 | #include "../osqldriver.h" | 6 | #include <opie2/osqldriver.h> |
7 | #include "../osqlresult.h" | 7 | #include <opie2/osqlresult.h> |
8 | |||
9 | using namespace Opie::DB; | ||
8 | 10 | ||
9 | int main( int argc, char* argv[] ) { | 11 | int main( int argc, char* argv[] ) { |
10 | 12 | ||
11 | QPEApplication app( argc, argv ); | 13 | QPEApplication app( argc, argv ); |
12 | OSQLManager man; | 14 | OSQLManager man; |
13 | man.registerPath( QDir::currentDirPath() ); | 15 | man.registerPath( QDir::currentDirPath() ); |
14 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
15 | 17 | ||
16 | OSQLDriver *driver = man.standard(); | 18 | OSQLDriver *driver = man.standard(); |
17 | qWarning("testmain" + driver->id() ); | 19 | qWarning("testmain" + driver->id() ); |
18 | driver->setUrl("/home/ich/zeilenweise"); | 20 | driver->setUrl("/home/ich/zeilenweise"); |
19 | if ( driver->open() ) { | 21 | if ( driver->open() ) { |
20 | qWarning("could open"); | 22 | qWarning("could open"); |
21 | }else | 23 | }else |
22 | qWarning("wasn't able to open"); | 24 | qWarning("wasn't able to open"); |
23 | OSQLRawQuery raw2("BEGIN TRANSACTION"); | 25 | OSQLRawQuery raw2("BEGIN TRANSACTION"); |
24 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); | 26 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); |
25 | OSQLResult res = driver->query( &raw2 ); | 27 | OSQLResult res = driver->query( &raw2 ); |
26 | res = driver->query( raw ); | 28 | res = driver->query( raw ); |
27 | delete raw; | 29 | delete raw; |
28 | for (int i = 0; i< 10000; i++ ) { | 30 | for (int i = 0; i< 10000; i++ ) { |
29 | int uid = i; | 31 | int uid = i; |
30 | OSQLRawQuery *raw; | 32 | OSQLRawQuery *raw; |
31 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); | 33 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); |
32 | OSQLResult res = driver->query(raw ); | 34 | OSQLResult res = driver->query(raw ); |
33 | delete raw; | 35 | delete raw; |
34 | 36 | ||
35 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + | 37 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + |
36 | ",'Completed',1)" ); | 38 | ",'Completed',1)" ); |
37 | res = driver->query(raw ); | 39 | res = driver->query(raw ); |
38 | delete raw; | 40 | delete raw; |
39 | 41 | ||
40 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 42 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
41 | QString::number(uid)+",'Progress',100)" ); | 43 | QString::number(uid)+",'Progress',100)" ); |
42 | res = driver->query( raw ); | 44 | res = driver->query( raw ); |
43 | delete raw; | 45 | delete raw; |
44 | 46 | ||
45 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 47 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
46 | QString::number(uid)+",'Summary',"+ | 48 | QString::number(uid)+",'Summary',"+ |
47 | "'Summary234-"+ QString::number(uid) + "')"); | 49 | "'Summary234-"+ QString::number(uid) + "')"); |
48 | res = driver->query( raw ); | 50 | res = driver->query( raw ); |
49 | delete raw; | 51 | delete raw; |
50 | 52 | ||
51 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 53 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
52 | QString::number(uid)+",'HasDate',1)"); | 54 | QString::number(uid)+",'HasDate',1)"); |
53 | res = driver->query( raw ); | 55 | res = driver->query( raw ); |
54 | delete raw; | 56 | delete raw; |
55 | 57 | ||
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 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = | 3 | HEADERS = |
4 | SOURCES = zeilenweise.cpp | 4 | SOURCES = zeilenweise.cpp |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
7 | LIBS += -lqpe -lopiesql | 7 | LIBS += -lqpe -lopiedb2 |
8 | TARGET = zeilenweise | 8 | TARGET = zeilenweise |
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | 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,32 +1,34 @@ | |||
1 | #include <opie2/osoundsystem.h> | 1 | #include <opie2/osoundsystem.h> |
2 | 2 | ||
3 | using namespace Opie::MM; | ||
4 | |||
3 | int main( int argc, char** argv ) | 5 | int main( int argc, char** argv ) |
4 | { | 6 | { |
5 | qDebug( "OPIE Sound System Demo" ); | 7 | qDebug( "OPIE Sound System Demo" ); |
6 | 8 | ||
7 | OSoundSystem* sound = OSoundSystem::instance(); | 9 | OSoundSystem* sound = OSoundSystem::instance(); |
8 | 10 | ||
9 | OSoundSystem::CardIterator it = sound->iterator(); | 11 | OSoundSystem::CardIterator it = sound->iterator(); |
10 | /* | 12 | /* |
11 | while ( it.current() ) | 13 | while ( it.current() ) |
12 | { | 14 | { |
13 | qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() ); | 15 | qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() ); |
14 | ++it; | 16 | ++it; |
15 | } | 17 | } |
16 | 18 | ||
17 | */ | 19 | */ |
18 | OSoundCard* card = it.current(); | 20 | OSoundCard* card = it.current(); |
19 | 21 | ||
20 | OMixerInterface* mixer = card->mixer(); | 22 | OMixerInterface* mixer = card->mixer(); |
21 | 23 | ||
22 | QStringList channels = mixer->allChannels(); | 24 | QStringList channels = mixer->allChannels(); |
23 | 25 | ||
24 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) | 26 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) |
25 | { | 27 | { |
26 | qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it ); | 28 | qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it ); |
27 | qDebug( "OSSDEMO: +--- volume %d (left) | %d (right)", mixer->volume( *it ) & 0xff, mixer->volume( *it ) >> 8 ); | 29 | qDebug( "OSSDEMO: +--- volume %d (left) | %d (right)", mixer->volume( *it ) & 0xff, mixer->volume( *it ) >> 8 ); |
28 | } | 30 | } |
29 | 31 | ||
30 | return 0; | 32 | return 0; |
31 | 33 | ||
32 | } | 34 | } |
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,59 +1,61 @@ | |||
1 | #include <qdict.h> | 1 | #include <qdict.h> |
2 | #include <qsocketnotifier.h> | 2 | #include <qsocketnotifier.h> |
3 | #include <qstring.h> | 3 | #include <qstring.h> |
4 | #include <opie2/onetwork.h> | 4 | #include <opie2/onetwork.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <opie2/opcap.h> | 6 | #include <opie2/opcap.h> |
7 | #include <cerrno> | 7 | #include <cerrno> |
8 | #include <cstdio> | 8 | #include <cstdio> |
9 | #include <cstdlib> | 9 | #include <cstdlib> |
10 | #include <cstring> | 10 | #include <cstring> |
11 | 11 | ||
12 | |||
13 | using namespace Opie::Net; | ||
12 | //======================== Station help class =============================== | 14 | //======================== Station help class =============================== |
13 | 15 | ||
14 | class Station | 16 | class Station |
15 | { | 17 | { |
16 | public: | 18 | public: |
17 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; | 19 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; |
18 | ~Station() {}; | 20 | ~Station() {}; |
19 | 21 | ||
20 | QString type; | 22 | QString type; |
21 | int channel; | 23 | int channel; |
22 | bool wep; | 24 | bool wep; |
23 | int beacons; | 25 | int beacons; |
24 | }; | 26 | }; |
25 | 27 | ||
26 | QDict<Station> stations; | 28 | QDict<Station> stations; |
27 | 29 | ||
28 | //======================== Application class =============================== | 30 | //======================== Application class =============================== |
29 | 31 | ||
30 | class Wellenreiter : public QApplication | 32 | class Wellenreiter : public QApplication |
31 | { | 33 | { |
32 | Q_OBJECT | 34 | Q_OBJECT |
33 | public: | 35 | public: |
34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) | 36 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) |
35 | { | 37 | { |
36 | 38 | ||
37 | ONetwork* net = ONetwork::instance(); | 39 | ONetwork* net = ONetwork::instance(); |
38 | 40 | ||
39 | if ( argc < 3 ) | 41 | if ( argc < 3 ) |
40 | { | 42 | { |
41 | printf( "Usage: ./%s <interface> <driver> <interval>\n", argv[0] ); | 43 | printf( "Usage: ./%s <interface> <driver> <interval>\n", argv[0] ); |
42 | printf( "\n" ); | 44 | printf( "\n" ); |
43 | printf( "Valid wireless interfaces (detected) are:\n" ); | 45 | printf( "Valid wireless interfaces (detected) are:\n" ); |
44 | 46 | ||
45 | ONetwork::InterfaceIterator it = net->iterator(); | 47 | ONetwork::InterfaceIterator it = net->iterator(); |
46 | while ( it.current() ) | 48 | while ( it.current() ) |
47 | { | 49 | { |
48 | if ( it.current()->isWireless() ) | 50 | if ( it.current()->isWireless() ) |
49 | { | 51 | { |
50 | printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), | 52 | printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), |
51 | (const char*) it.current()->macAddress().toString(), | 53 | (const char*) it.current()->macAddress().toString(), |
52 | (const char*) it.current()->ipV4Address() ); | 54 | (const char*) it.current()->ipV4Address() ); |
53 | } | 55 | } |
54 | ++it; | 56 | ++it; |
55 | } | 57 | } |
56 | exit( -1 ); | 58 | exit( -1 ); |
57 | } | 59 | } |
58 | 60 | ||
59 | printf( "*******************************************************************\n" ); | 61 | printf( "*******************************************************************\n" ); |
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,54 +1,56 @@ | |||
1 | #include <opie2/onetwork.h> | 1 | #include <opie2/onetwork.h> |
2 | #include <opie2/ostation.h> | 2 | #include <opie2/ostation.h> |
3 | #include <opie2/omanufacturerdb.h> | 3 | #include <opie2/omanufacturerdb.h> |
4 | 4 | ||
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | 6 | ||
7 | using namespace Opie::Net; | ||
8 | |||
7 | int main( int argc, char** argv ) | 9 | int main( int argc, char** argv ) |
8 | { | 10 | { |
9 | qDebug( "OPIE Network Demo" ); | 11 | qDebug( "OPIE Network Demo" ); |
10 | 12 | ||
11 | ONetwork* net = ONetwork::instance(); | 13 | ONetwork* net = ONetwork::instance(); |
12 | 14 | ||
13 | ONetwork::InterfaceIterator it = net->iterator(); | 15 | ONetwork::InterfaceIterator it = net->iterator(); |
14 | 16 | ||
15 | while ( it.current() ) | 17 | while ( it.current() ) |
16 | { | 18 | { |
17 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); | 19 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); |
18 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); | 20 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); |
19 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); | 21 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); |
20 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); | 22 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); |
21 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); | 23 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); |
22 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); | 24 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); |
23 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); | 25 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); |
24 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); | 26 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); |
25 | if ( it.current()->isWireless() ) | 27 | if ( it.current()->isWireless() ) |
26 | { | 28 | { |
27 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); | 29 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); |
28 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); | 30 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); |
29 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); | 31 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); |
30 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); | 32 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); |
31 | 33 | ||
32 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) | 34 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) |
33 | //{ | 35 | //{ |
34 | //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); | 36 | //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); |
35 | //} | 37 | //} |
36 | 38 | ||
37 | /* | 39 | /* |
38 | 40 | ||
39 | // nickname | 41 | // nickname |
40 | qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); | 42 | qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); |
41 | iface->setNickName( "MyNickName" ); | 43 | iface->setNickName( "MyNickName" ); |
42 | if ( iface->nickName() != "MyNickName" ) | 44 | if ( iface->nickName() != "MyNickName" ) |
43 | qDebug( "DEMO: Warning! Can't change nickname" ); | 45 | qDebug( "DEMO: Warning! Can't change nickname" ); |
44 | else | 46 | else |
45 | qDebug( "DEMO: Nickname change successful." ); | 47 | qDebug( "DEMO: Nickname change successful." ); |
46 | 48 | ||
47 | /* | 49 | /* |
48 | 50 | ||
49 | // operation mode | 51 | // operation mode |
50 | qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); | 52 | qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); |
51 | iface->setMode( "adhoc" ); | 53 | iface->setMode( "adhoc" ); |
52 | if ( iface->mode() != "adhoc" ) | 54 | if ( iface->mode() != "adhoc" ) |
53 | qDebug( "DEMO: Warning! Can't change operation mode" ); | 55 | qDebug( "DEMO: Warning! Can't change operation mode" ); |
54 | else | 56 | else |
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 | |||
@@ -1,26 +1,29 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "olistviewdemo.h" | 16 | #include "olistviewdemo.h" |
17 | #include <opie2/oapplication.h> | 17 | #include <opie2/oapplication.h> |
18 | 18 | ||
19 | using namespace Opie::Ui; | ||
20 | using namespace Opie::Core; | ||
21 | |||
19 | int main( int argc, char **argv ) | 22 | int main( int argc, char **argv ) |
20 | { | 23 | { |
21 | OApplication a( argc, argv, "OListViewDemo" ); | 24 | OApplication a( argc, argv, "OListViewDemo" ); |
22 | OListViewDemo e; | 25 | OListViewDemo e; |
23 | a.showMainWidget(&e); | 26 | a.showMainWidget(&e); |
24 | return a.exec(); | 27 | return a.exec(); |
25 | } | 28 | } |
26 | 29 | ||
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 | |||
@@ -1,80 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer |
5 | <mickey@tm.informatik.uni-frankfurt.de> | 5 | <mickey@tm.informatik.uni-frankfurt.de> |
6 | =. | 6 | =. |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include "olistviewdemo.h" | 33 | #include "olistviewdemo.h" |
34 | #include <opie2/olistview.h> | 34 | #include <opie2/olistview.h> |
35 | 35 | ||
36 | #include <qstring.h> | 36 | #include <qstring.h> |
37 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | 39 | ||
40 | using namespace Opie::Ui; | ||
41 | |||
40 | OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) | 42 | OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) |
41 | :QVBox( parent, name, f ) | 43 | :QVBox( parent, name, f ) |
42 | { | 44 | { |
43 | lv = new ONamedListView( this ); | 45 | lv = new ONamedListView( this ); |
44 | lv->setRootIsDecorated( true ); | 46 | lv->setRootIsDecorated( true ); |
45 | lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); | 47 | lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); |
46 | 48 | ||
47 | ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 49 | ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
48 | item->setText( "Column2", "ModifiedText" ); | 50 | item->setText( "Column2", "ModifiedText" ); |
49 | item->setText( "Column5", "ThisColumnDoesNotExits" ); | 51 | item->setText( "Column5", "ThisColumnDoesNotExits" ); |
50 | 52 | ||
51 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 53 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
52 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 54 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
53 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); | 55 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); |
54 | item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); | 56 | item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); |
55 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 57 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
56 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); | 58 | new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); |
57 | 59 | ||
58 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 60 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
59 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 61 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
60 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); | 62 | new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); |
61 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); | 63 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); |
62 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); | 64 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); |
63 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); | 65 | item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); |
64 | 66 | ||
65 | if ( lv->find( 3, "Mickey", 3 ) ) | 67 | if ( lv->find( 3, "Mickey", 3 ) ) |
66 | qDebug( "found Mickey :-)" ); | 68 | qDebug( "found Mickey :-)" ); |
67 | else | 69 | else |
68 | qDebug( "did not found Mickey :-(" ); | 70 | qDebug( "did not found Mickey :-(" ); |
69 | 71 | ||
70 | if ( lv->find( 3, "Minni", 0 ) ) | 72 | if ( lv->find( 3, "Minni", 0 ) ) |
71 | qDebug( "found Minni :-)" ); | 73 | qDebug( "found Minni :-)" ); |
72 | else | 74 | else |
73 | qDebug( "did not found Minni :-(" ); | 75 | qDebug( "did not found Minni :-(" ); |
74 | 76 | ||
75 | } | 77 | } |
76 | 78 | ||
77 | OListViewDemo::~OListViewDemo() | 79 | OListViewDemo::~OListViewDemo() |
78 | { | 80 | { |
79 | } | 81 | } |
80 | 82 | ||
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 | |||
@@ -1,51 +1,51 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OLISTVIEWDEMO_H | 32 | #ifndef OLISTVIEWDEMO_H |
33 | #define OLISTVIEWDEMO_H | 33 | #define OLISTVIEWDEMO_H |
34 | 34 | ||
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <opie2/olistview.h> | 36 | #include <opie2/olistview.h> |
37 | 37 | ||
38 | class OListViewDemo: public QVBox | 38 | class OListViewDemo: public QVBox |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 43 | OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
44 | virtual ~OListViewDemo(); | 44 | virtual ~OListViewDemo(); |
45 | 45 | ||
46 | private: | 46 | private: |
47 | ONamedListView* lv; | 47 | Opie::Ui::ONamedListView* lv; |
48 | 48 | ||
49 | }; | 49 | }; |
50 | 50 | ||
51 | #endif | 51 | #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,32 +1,33 @@ | |||
1 | #include "osplitter_example.h" | 1 | #include "osplitter_example.h" |
2 | 2 | ||
3 | /* OPIE */ | 3 | /* OPIE */ |
4 | 4 | ||
5 | #include <opie2/osplitter.h> | 5 | #include <opie2/osplitter.h> |
6 | #include <opie2/ofileselector.h> | ||
6 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
7 | #include <opie2/oapplicationfactory.h> | 8 | #include <opie2/oapplicationfactory.h> |
8 | 9 | ||
9 | /* QT*/ | 10 | /* QT*/ |
10 | #include <qdir.h> | 11 | #include <qdir.h> |
11 | #include <qlayout.h> | 12 | #include <qlayout.h> |
12 | 13 | ||
13 | using namespace Opie; | 14 | using namespace Opie::Ui; |
14 | 15 | ||
15 | OPIE_EXPORT_APP( OApplicationFactory<OSplitterExample> ) | 16 | OPIE_EXPORT_APP( OApplicationFactory<OSplitterExample> ) |
16 | 17 | ||
17 | OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f ) | 18 | OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f ) |
18 | : QWidget( w, n, f ){ | 19 | : QWidget( w, n, f ){ |
19 | QVBoxLayout * lay = new QVBoxLayout(this); | 20 | QVBoxLayout * lay = new QVBoxLayout(this); |
20 | OSplitter * splitter = new OSplitter( Horizontal, this ); | 21 | OSplitter * splitter = new OSplitter( Horizontal, this ); |
21 | lay->addWidget( splitter ); | 22 | lay->addWidget( splitter ); |
22 | 23 | ||
23 | OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector, | 24 | OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector, |
24 | OFileSelector::Normal, QDir::homeDirPath(), | 25 | OFileSelector::Normal, QDir::homeDirPath(), |
25 | QString::null ); | 26 | QString::null ); |
26 | splitter->addWidget( selector, "zoom", tr("Selector 1") ); | 27 | splitter->addWidget( selector, "zoom", tr("Selector 1") ); |
27 | 28 | ||
28 | selector = new OFileSelector( splitter, OFileSelector::FileSelector, OFileSelector::Normal, | 29 | selector = new OFileSelector( splitter, OFileSelector::FileSelector, OFileSelector::Normal, |
29 | QDir::homeDirPath(), QString::null ); | 30 | QDir::homeDirPath(), QString::null ); |
30 | splitter->addWidget( selector, "zoom", tr("Selector 2") ); | 31 | splitter->addWidget( selector, "zoom", tr("Selector 2") ); |
31 | 32 | ||
32 | } | 33 | } |
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 @@ | |||
1 | /* | 1 | /* |
2 | * May be used, copied and modified wihtout any limitation | 2 | * May be used, copied and modified wihtout any limitation |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef OSPlitter_EXAMPLE_H | 5 | #ifndef OSPlitter_EXAMPLE_H |
6 | #define OSPlitter_EXAMPLE_H | 6 | #define OSPlitter_EXAMPLE_H |
7 | 7 | ||
8 | #include <qvbox.h> | 8 | #include <qvbox.h> |
9 | #include <opie2/ofileselector.h> | ||
10 | 9 | ||
11 | class OSplitterExample : public QWidget { | 10 | class OSplitterExample : public QWidget { |
12 | Q_OBJECT | 11 | Q_OBJECT |
13 | public: | 12 | public: |
14 | static QString appName() { return QString::fromLatin1("osplitter_example"); } | 13 | static QString appName() { return QString::fromLatin1("osplitter_example"); } |
15 | OSplitterExample( QWidget *parent, const char* name, WFlags fl ); | 14 | OSplitterExample( QWidget *parent, const char* name, WFlags fl ); |
16 | 15 | ||
17 | }; | 16 | }; |
18 | 17 | ||
19 | 18 | ||
20 | #endif | 19 | #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,79 +1,81 @@ | |||
1 | 1 | ||
2 | #include <qstring.h> | 2 | #include <qstring.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qheader.h> | 4 | #include <qheader.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | 6 | ||
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | #include <opie2/oapplicationfactory.h> | 9 | #include <opie2/oapplicationfactory.h> |
10 | #include "osplitter_mail.h" | 10 | #include "osplitter_mail.h" |
11 | 11 | ||
12 | using namespace Opie::Ui; | ||
13 | |||
12 | OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) | 14 | OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) |
13 | 15 | ||
14 | class Folder { | 16 | class Folder { |
15 | int dummy; | 17 | int dummy; |
16 | }; | 18 | }; |
17 | 19 | ||
18 | // ----------------------------------------------------------------- | 20 | // ----------------------------------------------------------------- |
19 | 21 | ||
20 | ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) | 22 | ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) |
21 | : QWidget( p, name, fl ) { | 23 | : QWidget( p, name, fl ) { |
22 | qApp->installEventFilter( this ); | 24 | qApp->installEventFilter( this ); |
23 | m_lstFolders.setAutoDelete( true ); | 25 | m_lstFolders.setAutoDelete( true ); |
24 | QHBoxLayout *lay = new QHBoxLayout(this); | 26 | QHBoxLayout *lay = new QHBoxLayout(this); |
25 | 27 | ||
26 | m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); | 28 | m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); |
27 | lay->addWidget( m_splitter ); | 29 | lay->addWidget( m_splitter ); |
28 | connect(m_splitter, SIGNAL(sizeChange(bool,const QSize&) ), | 30 | connect(m_splitter, SIGNAL(sizeChanged(bool,Orientation) ), |
29 | this, SLOT(slotSizeChange(bool,const QSize&) ) ); | 31 | this, SLOT(slotSizeChange(bool,Orientation) ) ); |
30 | 32 | ||
31 | m_overview = new QListView( m_splitter ); | 33 | m_overview = new QListView( m_splitter ); |
32 | m_overview->header()->setClickEnabled( FALSE ); | 34 | m_overview->header()->setClickEnabled( FALSE ); |
33 | m_overview->addColumn( tr("Folder") ); | 35 | m_overview->addColumn( tr("Folder") ); |
34 | m_overview->setMaximumWidth( 200 ); | 36 | // m_overview->setMaximumWidth( 200 ); |
35 | m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); | 37 | m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); |
36 | m_splitter->setSizeChange( 300 ); | 38 | m_splitter->setSizeChange( 300 ); |
37 | 39 | ||
38 | /* OSplitter starts with the small mode */ | 40 | /* OSplitter starts with the small mode */ |
39 | m_messages = 0; | 41 | m_messages = 0; |
40 | m_message = m_attach = 0; | 42 | m_message = m_attach = 0; |
41 | 43 | ||
42 | splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); | 44 | splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); |
43 | splitti->setSizeChange( 300 ); | 45 | splitti->setSizeChange( 300 ); |
44 | splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); | 46 | splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); |
45 | 47 | ||
46 | QLabel *lbl = new QLabel(splitti); | 48 | QLabel *lbl = new QLabel(splitti); |
47 | lbl->setTextFormat ( Qt::RichText ); | 49 | lbl->setTextFormat ( Qt::RichText ); |
48 | lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); | 50 | lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); |
49 | 51 | ||
50 | m_messages = new QListView( splitti ); | 52 | m_messages = new QListView( splitti ); |
51 | m_messages->addColumn(" Messages "); | 53 | m_messages->addColumn(" Messages "); |
52 | 54 | ||
53 | folder1 = new QListView( splitti ); | 55 | folder1 = new QListView( splitti ); |
54 | folder1->addColumn( "Messages 2 " ); | 56 | folder1->addColumn( "Messages 2 " ); |
55 | 57 | ||
56 | splitti->addWidget(m_messages, "mail", tr("Mails") ); | 58 | splitti->addWidget(m_messages, "mail", tr("Mails") ); |
57 | splitti->addWidget(folder1, "folder", tr("Folder") ); | 59 | splitti->addWidget(folder1, "folder", tr("Folder") ); |
58 | splitti->addWidget( lbl, "logo", tr("Label") ); | 60 | splitti->addWidget( lbl, "logo", tr("Label") ); |
59 | m_message = lbl; | 61 | m_message = lbl; |
60 | 62 | ||
61 | m_splitter->addWidget( splitti ); | 63 | m_splitter->addWidget( splitti ); |
62 | 64 | ||
63 | } | 65 | } |
64 | 66 | ||
65 | 67 | ||
66 | ListViews::~ListViews() { | 68 | ListViews::~ListViews() { |
67 | 69 | ||
68 | } | 70 | } |
69 | 71 | ||
70 | 72 | ||
71 | bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { | 73 | bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { |
72 | if (!obj->isWidgetType() ) | 74 | if (!obj->isWidgetType() ) |
73 | return false; | 75 | return false; |
74 | if ( ev->type() == QEvent::MouseButtonRelease ) { | 76 | if ( ev->type() == QEvent::MouseButtonRelease ) { |
75 | qWarning(" name %s, class %s", obj->name(), obj->className() ); | 77 | qWarning(" name %s, class %s", obj->name(), obj->className() ); |
76 | } | 78 | } |
77 | 79 | ||
78 | return false; | 80 | return false; |
79 | } | 81 | } |
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 | |||
@@ -1,53 +1,51 @@ | |||
1 | /* | 1 | /* |
2 | * You may use, modify and distribute this code without any limitation | 2 | * You may use, modify and distribute this code without any limitation |
3 | */ | 3 | */ |
4 | 4 | ||
5 | /* | 5 | /* |
6 | * Header file for a more complete email client like | 6 | * Header file for a more complete email client like |
7 | * layout | 7 | * layout |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H | 10 | #ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H |
11 | #define OPIE_SPLITTER_MAIL_EXAMPLE_H | 11 | #define OPIE_SPLITTER_MAIL_EXAMPLE_H |
12 | 12 | ||
13 | #include <qwidget.h> | 13 | #include <qwidget.h> |
14 | #include <qlist.h> | 14 | #include <qlist.h> |
15 | #include <qlistview.h> | 15 | #include <qlistview.h> |
16 | 16 | ||
17 | #include <opie2/osplitter.h> | 17 | #include <opie2/osplitter.h> |
18 | 18 | ||
19 | using Opie::OSplitter; | ||
20 | 19 | ||
21 | class Folder; | 20 | class Folder; |
22 | class QLabel; | 21 | class QLabel; |
23 | 22 | ||
24 | class OSplitter; | ||
25 | class ListViews : public QWidget { | 23 | class ListViews : public QWidget { |
26 | Q_OBJECT | 24 | Q_OBJECT |
27 | public: | 25 | public: |
28 | static QString appName() { return QString::fromLatin1("osplitter-mail"); } | 26 | static QString appName() { return QString::fromLatin1("osplitter-mail"); } |
29 | ListViews( QWidget* parent, const char * name, WFlags fl ); | 27 | ListViews( QWidget* parent, const char * name, WFlags fl ); |
30 | ~ListViews(); | 28 | ~ListViews(); |
31 | 29 | ||
32 | bool eventFilter( QObject* , QEvent* ); | 30 | bool eventFilter( QObject* , QEvent* ); |
33 | private: | 31 | private: |
34 | void initFolders(); | 32 | void initFolders(); |
35 | void initFolder( Folder *folder, unsigned int &count ); | 33 | void initFolder( Folder *folder, unsigned int &count ); |
36 | 34 | ||
37 | QListView *m_messages, *m_overview; | 35 | QListView *m_messages, *m_overview; |
38 | QLabel *m_message, *m_attach; | 36 | QLabel *m_message, *m_attach; |
39 | QList<QListView> m_folders; // used in tab mode | 37 | QList<QListView> m_folders; // used in tab mode |
40 | QList<Folder> m_lstFolders; | 38 | QList<Folder> m_lstFolders; |
41 | bool m_mode : 1; // bitfield | 39 | bool m_mode : 1; // bitfield |
42 | OSplitter *m_splitter; | 40 | Opie::Ui::OSplitter *m_splitter; |
43 | OSplitter *splitti; | 41 | Opie::Ui::OSplitter *splitti; |
44 | QListView *folder1; | 42 | QListView *folder1; |
45 | #if 0 | 43 | #if 0 |
46 | //private slots: | 44 | //private slots: |
47 | // void slotFolderChanged( QListViewItem* ); | 45 | // void slotFolderChanged( QListViewItem* ); |
48 | // void slotMessageChanged(); | 46 | // void slotMessageChanged(); |
49 | // void slotSizeChange( bool, const QSize& ); | 47 | // void slotSizeChange( bool, const QSize& ); |
50 | #endif | 48 | #endif |
51 | }; | 49 | }; |
52 | 50 | ||
53 | #endif | 51 | #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 | |||
@@ -1,29 +1,32 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "opieuidemo.h" | 16 | #include "opieuidemo.h" |
17 | 17 | ||
18 | #include <opie2/oapplication.h> | 18 | #include <opie2/oapplication.h> |
19 | 19 | ||
20 | using namespace Opie::Core; | ||
21 | using namespace Opie::Ui; | ||
22 | |||
20 | int main( int argc, char **argv ) | 23 | int main( int argc, char **argv ) |
21 | { | 24 | { |
22 | OApplication a( argc, argv, "Opie UI Demo" ); | 25 | OApplication a( argc, argv, "Opie UI Demo" ); |
23 | qDebug( "." ); | 26 | qDebug( "." ); |
24 | OpieUIDemo e; | 27 | OpieUIDemo e; |
25 | qDebug( "." ); | 28 | qDebug( "." ); |
26 | a.showMainWidget(&e); | 29 | a.showMainWidget(&e); |
27 | qDebug( "." ); | 30 | qDebug( "." ); |
28 | return a.exec(); | 31 | return a.exec(); |
29 | } | 32 | } |
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 | |||
@@ -1,101 +1,99 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | // Qt | 16 | // Qt |
17 | 17 | ||
18 | #include <qcolor.h> | 18 | #include <qcolor.h> |
19 | #include <qpopupmenu.h> | 19 | #include <qpopupmenu.h> |
20 | #include <qmenubar.h> | 20 | #include <qmenubar.h> |
21 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
22 | #include <qvbox.h> | 22 | #include <qvbox.h> |
23 | #include <qstring.h> | 23 | #include <qstring.h> |
24 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
25 | 25 | ||
26 | // Qtopia | 26 | // Qtopia |
27 | 27 | ||
28 | #ifdef QWS | ||
29 | #include <qpe/qpeapplication.h> | 28 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/global.h> | 29 | #include <qpe/global.h> |
31 | #endif | ||
32 | 30 | ||
33 | // Opie | 31 | // Opie |
34 | 32 | ||
35 | #ifdef QWS | ||
36 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
37 | using namespace Opie; | ||
38 | #endif | ||
39 | 34 | ||
40 | #include <opie2/ocompletionbox.h> | 35 | #include <opie2/ocompletionbox.h> |
41 | #include <opie2/olineedit.h> | 36 | #include <opie2/olineedit.h> |
42 | #include <opie2/ocombobox.h> | 37 | #include <opie2/ocombobox.h> |
43 | #include <opie2/oeditlistbox.h> | 38 | #include <opie2/oeditlistbox.h> |
44 | #include <opie2/oselector.h> | 39 | #include <opie2/oselector.h> |
45 | #include <opie2/opopupmenu.h> | 40 | #include <opie2/opopupmenu.h> |
46 | 41 | ||
47 | #include <qtabwidget.h> | 42 | #include <qtabwidget.h> |
48 | #include "oversatileviewdemo.h" | 43 | #include "oversatileviewdemo.h" |
49 | 44 | ||
50 | // Local | 45 | // Local |
51 | 46 | ||
52 | #include "opieuidemo.h" | 47 | #include "opieuidemo.h" |
53 | 48 | ||
49 | using namespace Opie::Core; | ||
50 | using namespace Opie::Ui; | ||
51 | |||
54 | enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; | 52 | enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; |
55 | 53 | ||
56 | OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) | 54 | OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) |
57 | : QMainWindow( parent, name, fl ) | 55 | : QMainWindow( parent, name, fl ) |
58 | { | 56 | { |
59 | 57 | ||
60 | QMenuBar* mbar = this->menuBar(); | 58 | QMenuBar* mbar = this->menuBar(); |
61 | OPopupMenu* demo = new OPopupMenu( this ); | 59 | OPopupMenu* demo = new OPopupMenu( this ); |
62 | demo->setTitle( "Title" ); | 60 | demo->setTitle( "Title" ); |
63 | demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox ); | 61 | demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox ); |
64 | demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit ); | 62 | demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit ); |
65 | demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); | 63 | demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); |
66 | demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); | 64 | demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); |
67 | demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); | 65 | demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); |
68 | mbar->insertItem( "Demonstrate", demo ); | 66 | mbar->insertItem( "Demonstrate", demo ); |
69 | 67 | ||
70 | build(); | 68 | build(); |
71 | 69 | ||
72 | } | 70 | } |
73 | 71 | ||
74 | OpieUIDemo::~OpieUIDemo() | 72 | OpieUIDemo::~OpieUIDemo() |
75 | { | 73 | { |
76 | } | 74 | } |
77 | 75 | ||
78 | void OpieUIDemo::build() | 76 | void OpieUIDemo::build() |
79 | { | 77 | { |
80 | main = new QTabWidget( this, "tabwidget" ); | 78 | main = new QTabWidget( this, "tabwidget" ); |
81 | setCentralWidget( main ); | 79 | setCentralWidget( main ); |
82 | main->show(); | 80 | main->show(); |
83 | 81 | ||
84 | main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); | 82 | main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); |
85 | } | 83 | } |
86 | 84 | ||
87 | 85 | ||
88 | void OpieUIDemo::demo( int d ) | 86 | void OpieUIDemo::demo( int d ) |
89 | { | 87 | { |
90 | switch (d) | 88 | switch (d) |
91 | { | 89 | { |
92 | case ocompletionbox: demoOCompletionBox(); break; | 90 | case ocompletionbox: demoOCompletionBox(); break; |
93 | case olineedit: demoOLineEdit(); break; | 91 | case olineedit: demoOLineEdit(); break; |
94 | case ocombobox: demoOComboBox(); break; | 92 | case ocombobox: demoOComboBox(); break; |
95 | case oeditlistbox: demoOEditListBox(); break; | 93 | case oeditlistbox: demoOEditListBox(); break; |
96 | case oselector: demoOSelector(); break; | 94 | case oselector: demoOSelector(); break; |
97 | 95 | ||
98 | } | 96 | } |
99 | 97 | ||
100 | } | 98 | } |
101 | 99 | ||
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 | |||
@@ -1,56 +1,60 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef OPIEUIDEMO_H | 16 | #ifndef OPIEUIDEMO_H |
17 | #define OPIEUIDEMO_H | 17 | #define OPIEUIDEMO_H |
18 | 18 | ||
19 | #include <qmainwindow.h> | 19 | #include <qmainwindow.h> |
20 | 20 | ||
21 | namespace Opie { | ||
22 | namespace Ui { | ||
21 | class OVersatileView; | 23 | class OVersatileView; |
24 | } | ||
25 | } | ||
22 | class QTabWidget; | 26 | class QTabWidget; |
23 | class QVBox; | 27 | class QVBox; |
24 | 28 | ||
25 | class OpieUIDemo : public QMainWindow { | 29 | class OpieUIDemo : public QMainWindow { |
26 | Q_OBJECT | 30 | Q_OBJECT |
27 | 31 | ||
28 | public: | 32 | public: |
29 | 33 | ||
30 | OpieUIDemo( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel ); | 34 | OpieUIDemo( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel ); |
31 | ~OpieUIDemo(); | 35 | ~OpieUIDemo(); |
32 | 36 | ||
33 | void demoOCompletionBox(); | 37 | void demoOCompletionBox(); |
34 | void demoOLineEdit(); | 38 | void demoOLineEdit(); |
35 | void demoOComboBox(); | 39 | void demoOComboBox(); |
36 | void demoOEditListBox(); | 40 | void demoOEditListBox(); |
37 | void demoOSelector(); | 41 | void demoOSelector(); |
38 | 42 | ||
39 | public slots: | 43 | public slots: |
40 | void demo( int ); | 44 | void demo( int ); |
41 | void messageBox( const QString& text ); | 45 | void messageBox( const QString& text ); |
42 | 46 | ||
43 | protected: | 47 | protected: |
44 | void build(); | 48 | void build(); |
45 | void buildVV( QVBox* b ); | 49 | void buildVV( QVBox* b ); |
46 | 50 | ||
47 | private: | 51 | private: |
48 | QTabWidget* main; | 52 | QTabWidget* main; |
49 | 53 | ||
50 | OVersatileView* vv; | 54 | Opie::Ui::OVersatileView* vv; |
51 | 55 | ||
52 | }; | 56 | }; |
53 | 57 | ||
54 | 58 | ||
55 | 59 | ||
56 | #endif | 60 | #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 | |||
@@ -1,88 +1,90 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer |
5 | <mickey@tm.informatik.uni-frankfurt.de> | 5 | <mickey@tm.informatik.uni-frankfurt.de> |
6 | =. | 6 | =. |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include "oversatileviewdemo.h" | 33 | #include "oversatileviewdemo.h" |
34 | #include <opie2/oversatileview.h> | 34 | #include <opie2/oversatileview.h> |
35 | #include <opie2/oversatileviewitem.h> | 35 | #include <opie2/oversatileviewitem.h> |
36 | 36 | ||
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | #include <qpixmap.h> | 38 | #include <qpixmap.h> |
39 | #include <qlistview.h> | 39 | #include <qlistview.h> |
40 | 40 | ||
41 | using namespace Opie::Ui; | ||
42 | |||
41 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) | 43 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) |
42 | :QVBox( parent, name, f ) | 44 | :QVBox( parent, name, f ) |
43 | { | 45 | { |
44 | vv = new OVersatileView( this ); | 46 | vv = new OVersatileView( this ); |
45 | 47 | ||
46 | vv->addColumn( "First" ); | 48 | vv->addColumn( "First" ); |
47 | vv->addColumn( "2nd" ); | 49 | vv->addColumn( "2nd" ); |
48 | vv->addColumn( "IIIrd" ); | 50 | vv->addColumn( "IIIrd" ); |
49 | 51 | ||
50 | QString counter; | 52 | QString counter; |
51 | 53 | ||
52 | QPixmap leaf( "leaf.png" ); | 54 | QPixmap leaf( "leaf.png" ); |
53 | QPixmap opened( "folder_opened.png" ); | 55 | QPixmap opened( "folder_opened.png" ); |
54 | QPixmap closed( "folder_closed.png" ); | 56 | QPixmap closed( "folder_closed.png" ); |
55 | 57 | ||
56 | QPixmap leaf32( "leaf32.png" ); | 58 | QPixmap leaf32( "leaf32.png" ); |
57 | QPixmap opened32( "folder_opened32.png" ); | 59 | QPixmap opened32( "folder_opened32.png" ); |
58 | QPixmap closed32( "folder_closed32.png" ); | 60 | QPixmap closed32( "folder_closed32.png" ); |
59 | 61 | ||
60 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); | 62 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); |
61 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); | 63 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); |
62 | 64 | ||
63 | OVersatileViewItem* item; | 65 | OVersatileViewItem* item; |
64 | OVersatileViewItem* item2; | 66 | OVersatileViewItem* item2; |
65 | 67 | ||
66 | for ( int i = 0; i < 5; ++i ) | 68 | for ( int i = 0; i < 5; ++i ) |
67 | { | 69 | { |
68 | counter.sprintf( "%d", i ); | 70 | counter.sprintf( "%d", i ); |
69 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); | 71 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); |
70 | item->setRenameEnabled( true ); | 72 | item->setRenameEnabled( true ); |
71 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); | 73 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); |
72 | item2->setRenameEnabled( true ); | 74 | item2->setRenameEnabled( true ); |
73 | 75 | ||
74 | } | 76 | } |
75 | 77 | ||
76 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); | 78 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); |
77 | connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); | 79 | connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); |
78 | connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); | 80 | connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); |
79 | connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); | 81 | connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); |
80 | connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); | 82 | connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); |
81 | 83 | ||
82 | connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); | 84 | connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); |
83 | connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); | 85 | connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); |
84 | 86 | ||
85 | connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); | 87 | connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); |
86 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); | 88 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); |
87 | 89 | ||
88 | connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); | 90 | connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); |
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 | |||
@@ -1,73 +1,77 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OVERSATILEVIEWDEMO_H | 32 | #ifndef OVERSATILEVIEWDEMO_H |
33 | #define OVERSATILEVIEWDEMO_H | 33 | #define OVERSATILEVIEWDEMO_H |
34 | 34 | ||
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | 36 | ||
37 | namespace Opie { | ||
38 | namespace Ui { | ||
37 | class OVersatileView; | 39 | class OVersatileView; |
38 | class OVersatileViewItem; | 40 | class OVersatileViewItem; |
41 | } | ||
42 | } | ||
39 | 43 | ||
40 | class OVersatileViewDemo: public QVBox | 44 | class OVersatileViewDemo: public QVBox |
41 | { | 45 | { |
42 | Q_OBJECT | 46 | Q_OBJECT |
43 | 47 | ||
44 | public: | 48 | public: |
45 | OVersatileViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 49 | OVersatileViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
46 | virtual ~OVersatileViewDemo(); | 50 | virtual ~OVersatileViewDemo(); |
47 | 51 | ||
48 | public slots: | 52 | public slots: |
49 | void selectionChanged(); | 53 | void selectionChanged(); |
50 | void selectionChanged( OVersatileViewItem * ); | 54 | void selectionChanged( Opie::Ui::OVersatileViewItem * ); |
51 | void currentChanged( OVersatileViewItem * ); | 55 | void currentChanged( Opie::Ui::OVersatileViewItem * ); |
52 | void clicked( OVersatileViewItem * ); | 56 | void clicked( Opie::Ui::OVersatileViewItem * ); |
53 | void pressed( OVersatileViewItem * ); | 57 | void pressed( OPie::Ui::OVersatileViewItem * ); |
54 | 58 | ||
55 | void doubleClicked( OVersatileViewItem *item ); | 59 | void doubleClicked( Opie::Ui::OVersatileViewItem *item ); |
56 | void returnPressed( OVersatileViewItem *item ); | 60 | void returnPressed( Opie::Ui::OVersatileViewItem *item ); |
57 | 61 | ||
58 | void onItem( OVersatileViewItem *item ); | 62 | void onItem( Opie::Ui::OVersatileViewItem *item ); |
59 | void onViewport(); | 63 | void onViewport(); |
60 | 64 | ||
61 | void expanded( OVersatileViewItem *item ); | 65 | void expanded( Opie::Ui::OVersatileViewItem *item ); |
62 | void collapsed( OVersatileViewItem *item ); | 66 | void collapsed( Opie::Ui::OVersatileViewItem *item ); |
63 | 67 | ||
64 | void moved(); | 68 | void moved(); |
65 | 69 | ||
66 | void contextMenuRequested( OVersatileViewItem *item, const QPoint&, int col ); | 70 | void contextMenuRequested( Opie::Ui::OVersatileViewItem *item, const QPoint&, int col ); |
67 | 71 | ||
68 | private: | 72 | private: |
69 | OVersatileView* vv; | 73 | Opie::Ui::OVersatileView* vv; |
70 | 74 | ||
71 | }; | 75 | }; |
72 | 76 | ||
73 | #endif | 77 | #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 | |||
@@ -1,70 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | * You may use, modify and distribute this example without any limitation | 2 | * You may use, modify and distribute this example without any limitation |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include "owidgetstack_example.h" | 5 | #include "owidgetstack_example.h" |
6 | 6 | ||
7 | /* OPIE */ | 7 | /* OPIE */ |
8 | #include <opie2/oapplicationfactory.h> | 8 | #include <opie2/oapplicationfactory.h> |
9 | #include <opie2/owidgetstack.h> | 9 | #include <opie2/owidgetstack.h> |
10 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
11 | 11 | ||
12 | /* QT */ | 12 | /* QT */ |
13 | #include <qaction.h> | 13 | #include <qaction.h> |
14 | #include <qtoolbar.h> | 14 | #include <qtoolbar.h> |
15 | #include <qpopupmenu.h> | 15 | #include <qpopupmenu.h> |
16 | #include <qmenubar.h> | 16 | #include <qmenubar.h> |
17 | #include <qlayout.h> | 17 | #include <qlayout.h> |
18 | #include <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qpushbutton.h> | 19 | #include <qpushbutton.h> |
20 | #include <qsignalmapper.h> | 20 | #include <qsignalmapper.h> |
21 | 21 | ||
22 | using namespace Opie; | 22 | using namespace Opie::Ui; |
23 | 23 | ||
24 | OPIE_EXPORT_APP( OApplicationFactory<StackExample> ) | 24 | OPIE_EXPORT_APP( OApplicationFactory<StackExample> ) |
25 | 25 | ||
26 | StackExample::StackExample( QWidget* parent, const char* name, WFlags fl ) | 26 | StackExample::StackExample( QWidget* parent, const char* name, WFlags fl ) |
27 | : QMainWindow( parent, name, fl ) | 27 | : QMainWindow( parent, name, fl ) |
28 | { | 28 | { |
29 | m_stack = new OWidgetStack( this ); | 29 | m_stack = new OWidgetStack( this ); |
30 | setCentralWidget( m_stack ); | 30 | setCentralWidget( m_stack ); |
31 | 31 | ||
32 | /* nice Signal Mapper ;) */ | 32 | /* nice Signal Mapper ;) */ |
33 | QSignalMapper *sm = new QSignalMapper(this); | 33 | QSignalMapper *sm = new QSignalMapper(this); |
34 | connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) ); | 34 | connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) ); |
35 | 35 | ||
36 | /* toolbar first but this should be known from the other examples */ | 36 | /* toolbar first but this should be known from the other examples */ |
37 | setToolBarsMovable( false ); | 37 | setToolBarsMovable( false ); |
38 | 38 | ||
39 | /* only a menubar here */ | 39 | /* only a menubar here */ |
40 | QToolBar* holder = new QToolBar( this ); | 40 | QToolBar* holder = new QToolBar( this ); |
41 | holder->setHorizontalStretchable( true ); | 41 | holder->setHorizontalStretchable( true ); |
42 | 42 | ||
43 | QMenuBar *bar = new QMenuBar( holder ); | 43 | QMenuBar *bar = new QMenuBar( holder ); |
44 | QPopupMenu *menu = new QPopupMenu( this ); | 44 | QPopupMenu *menu = new QPopupMenu( this ); |
45 | 45 | ||
46 | QAction* a = new QAction( tr("Show MainWidget"), Resource::loadPixmap("zoom"), | 46 | QAction* a = new QAction( tr("Show MainWidget"), Resource::loadPixmap("zoom"), |
47 | QString::null, 0, this, 0 ); | 47 | QString::null, 0, this, 0 ); |
48 | sm->setMapping(a, 1 ); | 48 | sm->setMapping(a, 1 ); |
49 | connect(a, SIGNAL(activated() ), | 49 | connect(a, SIGNAL(activated() ), |
50 | sm, SLOT(map() ) ); | 50 | sm, SLOT(map() ) ); |
51 | a->addTo( menu ); | 51 | a->addTo( menu ); |
52 | 52 | ||
53 | a = new QAction( tr("Show Details Small"), Resource::loadPixmap("zoom"), | 53 | a = new QAction( tr("Show Details Small"), Resource::loadPixmap("zoom"), |
54 | QString::null, 0, this, 0 ); | 54 | QString::null, 0, this, 0 ); |
55 | sm->setMapping(a, 2 ); | 55 | sm->setMapping(a, 2 ); |
56 | connect(a, SIGNAL(activated() ), | 56 | connect(a, SIGNAL(activated() ), |
57 | sm, SLOT(map() ) ); | 57 | sm, SLOT(map() ) ); |
58 | a->addTo( menu ); | 58 | a->addTo( menu ); |
59 | 59 | ||
60 | a = new QAction( tr("Show Details More"), Resource::loadPixmap("zoom"), | 60 | a = new QAction( tr("Show Details More"), Resource::loadPixmap("zoom"), |
61 | QString::null, 0, this, 0 ); | 61 | QString::null, 0, this, 0 ); |
62 | sm->setMapping(a, 3 ); | 62 | sm->setMapping(a, 3 ); |
63 | connect(a, SIGNAL(activated() ), | 63 | connect(a, SIGNAL(activated() ), |
64 | sm, SLOT(map() ) ); | 64 | sm, SLOT(map() ) ); |
65 | a->addTo( menu ); | 65 | a->addTo( menu ); |
66 | 66 | ||
67 | a = new QAction( tr("Show Details All"), Resource::loadPixmap("zoom"), | 67 | a = new QAction( tr("Show Details All"), Resource::loadPixmap("zoom"), |
68 | QString::null, 0, this, 0 ); | 68 | QString::null, 0, this, 0 ); |
69 | sm->setMapping(a, 4 ); | 69 | sm->setMapping(a, 4 ); |
70 | connect(a, SIGNAL(activated() ), | 70 | connect(a, SIGNAL(activated() ), |
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 @@ | |||
1 | /* | 1 | /* |
2 | * You may use, modify and distribute this example without any limitation | 2 | * You may use, modify and distribute this example without any limitation |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef O_STACK_EXAMPLE_SIMPLE_H | 5 | #ifndef O_STACK_EXAMPLE_SIMPLE_H |
6 | #define O_STACK_EXAMPLE_SIMPLE_H | 6 | #define O_STACK_EXAMPLE_SIMPLE_H |
7 | 7 | ||
8 | #include <qmainwindow.h> | 8 | #include <qmainwindow.h> |
9 | #include <opie2/owidgetstack.h> | 9 | #include <opie2/owidgetstack.h> |
10 | 10 | ||
11 | using namespace Opie; | ||
12 | 11 | ||
13 | class StackExample : public QMainWindow { | 12 | class StackExample : public QMainWindow { |
14 | Q_OBJECT | 13 | Q_OBJECT |
15 | public: | 14 | public: |
16 | StackExample( QWidget* paren, const char* name, WFlags fl ); | 15 | StackExample( QWidget* paren, const char* name, WFlags fl ); |
17 | ~StackExample(); | 16 | ~StackExample(); |
18 | static QString appName() { return QString::fromLatin1("owidgetstack-example"); } | 17 | static QString appName() { return QString::fromLatin1("owidgetstack-example"); } |
19 | 18 | ||
20 | protected: | 19 | protected: |
21 | void closeEvent( QCloseEvent* e ); | 20 | void closeEvent( QCloseEvent* e ); |
22 | private: | 21 | private: |
23 | OWidgetStack* m_stack; | 22 | Opie::Ui::OWidgetStack* m_stack; |
24 | QWidget* m_main; | 23 | QWidget* m_main; |
25 | 24 | ||
26 | }; | 25 | }; |
27 | 26 | ||
28 | #endif | 27 | #endif |