summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obex.cpp187
-rw-r--r--core/obex/obex.h84
-rw-r--r--core/obex/obex.pro7
-rw-r--r--core/obex/obexsend.cpp234
-rw-r--r--core/obex/obexsend.h98
-rw-r--r--core/obex/obexsendbase.cpp299
-rw-r--r--core/obex/obexsendbase.h54
7 files changed, 960 insertions, 3 deletions
diff --git a/core/obex/obex.cpp b/core/obex/obex.cpp
new file mode 100644
index 0000000..36634ec
--- a/dev/null
+++ b/core/obex/obex.cpp
@@ -0,0 +1,187 @@
+
+#include "obex.h"
+
+/* OPIE */
+#include <opie2/oprocess.h>
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qfileinfo.h>
+
+
+
+using namespace OpieObex;
+
+using namespace Opie::Core;
+/* TRANSLATOR OpieObex::Obex */
+
+Obex::Obex( QObject *parent, const char* name )
+ : QObject(parent, name )
+{
+ m_rec = 0;
+ m_send=0;
+ m_count = 0;
+ m_receive = false;
+ connect( this, SIGNAL(error(int) ), // for recovering to receive
+ SLOT(slotError() ) );
+ connect( this, SIGNAL(sent(bool) ),
+ SLOT(slotError() ) );
+};
+Obex::~Obex() {
+ delete m_rec;
+ delete m_send;
+}
+void Obex::receive() {
+ m_receive = true;
+ m_outp = QString::null;
+ m_rec = new OProcess();
+ *m_rec << "irobex_palm3";
+ // connect to the necessary slots
+ connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ),
+ this, SLOT(slotExited(Opie::Core::OProcess*) ) );
+
+ connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
+ this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
+
+ if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
+ emit done( false );
+ delete m_rec;
+ m_rec = 0;
+ }
+}
+
+void Obex::send( const QString& fileName) { // if currently receiving stop it send receive
+ m_count = 0;
+ m_file = fileName;
+ if (m_rec != 0 ) {
+ if (m_rec->isRunning() ) {
+ emit error(-1 );
+ delete m_rec;
+ m_rec = 0;
+
+ }else{
+ emit error( -1 ); // we did not delete yet but it's not running slotExited is pending
+ return;
+ }
+ }
+ sendNow();
+}
+void Obex::sendNow(){
+ if ( m_count >= 25 ) { // could not send
+ emit error(-1 );
+ emit sent(false);
+ return;
+ }
+ // OProcess inititialisation
+ m_send = new OProcess();
+ m_send->setWorkingDirectory( QFileInfo(m_file).dirPath(true) );
+
+ *m_send << "irobex_palm3";
+ *m_send << QFile::encodeName(QFileInfo(m_file).fileName());
+
+ // connect to slots Exited and and StdOut
+ connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ),
+ this, SLOT(slotExited(Opie::Core::OProcess*)) );
+ connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )),
+ this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
+
+ // now start it
+ if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) {
+ m_count = 25;
+ emit error(-1 );
+ delete m_send;
+ m_send=0;
+ }
+ // end
+ m_count++;
+ emit currentTry( m_count );
+}
+
+void Obex::slotExited(OProcess* proc ){
+ if (proc == m_rec ) // receive process
+ received();
+ else if ( proc == m_send )
+ sendEnd();
+
+}
+void Obex::slotStdOut(OProcess* proc, char* buf, int len){
+ if ( proc == m_rec ) { // only receive
+ QByteArray ar( len );
+ memcpy( ar.data(), buf, len );
+ m_outp.append( ar );
+ }
+}
+
+void Obex::received() {
+ if (m_rec->normalExit() ) {
+ if ( m_rec->exitStatus() == 0 ) { // we got one
+ QString filename = parseOut();
+ emit receivedFile( filename );
+ }
+ }else{
+ emit done(false);
+ };
+ delete m_rec;
+ m_rec = 0;
+ receive();
+}
+
+void Obex::sendEnd() {
+ if (m_send->normalExit() ) {
+ if ( m_send->exitStatus() == 0 ) {
+ delete m_send;
+ m_send=0;
+ emit sent(true);
+ }else if (m_send->exitStatus() == 255 ) { // it failed maybe the other side wasn't ready
+ // let's try it again
+ delete m_send;
+ m_send = 0;
+ sendNow();
+ }
+ }else {
+ emit error( -1 );
+ delete m_send;
+ m_send = 0;
+ }
+}
+QString Obex::parseOut( ){
+ QString path;
+ QStringList list = QStringList::split("\n", m_outp);
+ QStringList::Iterator it;
+ for (it = list.begin(); it != list.end(); ++it ) {
+ if ( (*it).startsWith("Wrote" ) ) {
+ int pos = (*it).findRev('(' );
+ if ( pos > 0 ) {
+
+ path = (*it).remove( pos, (*it).length() - pos );
+ path = path.mid(6 );
+ path = path.stripWhiteSpace();
+ }
+ }
+ }
+ return path;
+}
+/**
+ * when sent is done slotError is called we will start receive again
+ */
+void Obex::slotError() {
+ if ( m_receive )
+ receive();
+};
+void Obex::setReceiveEnabled( bool receive ) {
+ if ( !receive ) { //
+ m_receive = false;
+ shutDownReceive();
+ }
+}
+
+void Obex::shutDownReceive() {
+ if (m_rec != 0 ) {
+ if (m_rec->isRunning() ) {
+ emit error(-1 );
+ delete m_rec;
+ m_rec = 0;
+ }
+ }
+
+}
diff --git a/core/obex/obex.h b/core/obex/obex.h
new file mode 100644
index 0000000..5993976
--- a/dev/null
+++ b/core/obex/obex.h
@@ -0,0 +1,84 @@
+
+
+#ifndef OpieObex_H
+#define OpieObex_H
+
+#include <qobject.h>
+
+namespace Opie {namespace Core {class OProcess;}}
+class QCopChannel;
+namespace OpieObex {
+ class Obex : public QObject {
+ Q_OBJECT
+ public:
+ /**
+ * Obex c'tor look
+ */
+ Obex( QObject *parent, const char* name);
+ /**
+ * d'tor
+ */
+ ~Obex();
+
+ /**
+ * Starting listening to irda after enabled by the applet
+ * a signal gets emitted when received a file
+ */
+ void receive();
+ void send( const QString& );
+ void setReceiveEnabled( bool = false );
+ signals:
+
+ /**
+ * a signal
+ * @param path The path to the received file
+ */
+ void receivedFile( const QString& path);
+ /**
+ * error signal if the program couldn't be started or the
+ * the connection timed out
+ */
+ void error( int );
+ /**
+ * The current try to receive data
+ */
+ void currentTry(unsigned int);
+ /**
+ * signal sent The file got beamed to the remote location
+ */
+ void sent(bool);
+ void done(bool);
+
+ private:
+ uint m_count;
+ QString m_file;
+ QString m_outp;
+ Opie::Core::OProcess *m_send;
+ Opie::Core::OProcess *m_rec;
+ bool m_receive : 1;
+ void shutDownReceive();
+
+private slots:
+
+ /**
+ * send over palm obex
+ */
+
+ //void send(const QString&);
+
+ // the process exited
+ void slotExited(Opie::Core::OProcess* proc) ;
+ void slotStdOut(Opie::Core::OProcess*, char*, int);
+ void slotError();
+
+ private:
+ void sendNow();
+ QString parseOut();
+ void received();
+ void sendEnd();
+
+ };
+};
+
+
+#endif
diff --git a/core/obex/obex.pro b/core/obex/obex.pro
index 1f4f486..d6b527c 100644
--- a/core/obex/obex.pro
+++ b/core/obex/obex.pro
@@ -1,12 +1,13 @@
TEMPLATE = lib
CONFIG += qt warn_on
-HEADERS = btobex.h obexhandler.h receiver.h obeximpl.h
-SOURCES = btobex.cpp obexhandler.cpp receiver.cpp obeximpl.cpp
+HEADERS = obex.h btobex.h obexhandler.h obexsend.h receiver.h obeximpl.h
+SOURCES = obex.cpp btobex.cpp obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp
TARGET = opieobex
DESTDIR = $(OPIEDIR)/plugins/obex
INTERFACES = obexsendbase.ui
INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/core/launcher
-LIBS += -lqpe -lopiecore2
+DEPENDPATH +=
+LIBS += -lqpe -lopiecore2
VERSION = 0.0.3
include( $(OPIEDIR)/include.pro )
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
new file mode 100644
index 0000000..a80a48b
--- a/dev/null
+++ b/core/obex/obexsend.cpp
@@ -0,0 +1,234 @@
+// 7-Jul-2005 mbh@sdgsystems.com: replace hand coded form with one
+// generated via QT2 Designer. The new form supports
+// selection of target devices, as opposed to sending to
+// all.
+
+#include "obex.h"
+#include "btobex.h"
+#include "obexsend.h"
+using namespace OpieObex;
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/resource.h>
+
+using namespace Opie::Core;
+
+/* QT */
+#include <qlabel.h>
+#include <qpixmap.h>
+#include <qlistview.h>
+#include <qtimer.h>
+
+/* TRANSLATOR OpieObex::SendWidget */
+
+SendWidget::SendWidget( QWidget* parent, const char* name )
+ : obexSendBase( parent, name ) {
+ initUI();
+}
+SendWidget::~SendWidget() {
+}
+void SendWidget::initUI() {
+ m_obex = new Obex(this, "obex");
+ connect(m_obex, SIGNAL(error(int) ),
+ this, SLOT(slotIrError(int) ) );
+ connect(m_obex, SIGNAL(sent(bool) ),
+ this, SLOT(slotIrSent(bool) ) );
+ connect(m_obex, SIGNAL(currentTry(unsigned int) ),
+ this, SLOT(slotIrTry(unsigned int) ) );
+
+ QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this );
+ connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT(dispatchIrda(const QCString&,const QByteArray&) ) );
+
+ m_btobex = new BtObex(this, "btobex");
+ connect(m_btobex, SIGNAL(error(int) ),
+ this, SLOT(slotBtError(int) ) );
+ connect(m_btobex, SIGNAL(sent(bool) ),
+ this, SLOT(slotBtSent(bool) ) );
+ connect(m_btobex, SIGNAL(currentTry(unsigned int) ),
+ this, SLOT(slotBtTry(unsigned int) ) );
+
+ chan = new QCopChannel("QPE/BluetoothBack", this );
+ connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) );
+
+}
+
+/*
+ * in send we'll first set everything up
+ * and then wait for a list of devices.
+ */
+void SendWidget::send( const QString& file, const QString& desc ) {
+ m_file = file;
+ m_irDa.clear();
+ m_start = 0;
+
+ fileToSend->setText(desc.isEmpty() ? file : desc );
+ scan_for_receivers();
+}
+
+int SendWidget::addReceiver(const char *r, const char *icon)
+{
+ QListViewItem * item = new QListViewItem( receiverList, 0 );
+ item->setText( 0, r);
+ item->setPixmap( 1, Resource::loadPixmap( icon ) );
+
+ int id=receivers.count();
+ receivers[id]=item;
+ return id;
+}
+
+bool SendWidget::receiverSelected(int id)
+{
+ return receivers[id]->pixmap(2);
+}
+
+void SendWidget::setReceiverStatus( int id, const QString& status ) {
+ if ( !receivers.contains(id) ) return;
+ receivers[id]->setText(3, status );
+}
+
+void SendWidget::slotIrDaDevices( const QStringList& list) {
+ for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ int id = addReceiver(*it, "obex/irda.png");
+ m_irDa.insert( id, (*it) );
+ }
+ irdaStatus->setText( tr("ready."));
+ m_irDaIt = m_irDa.begin();
+
+}
+
+void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
+ for(QMap<QString, QString>::ConstIterator it = str.begin(); it != str.end(); ++it ) {
+ int id = addReceiver(it.key(), "obex/bt.png");
+ m_bt.insert( id, Pair( it.key(), it.data() ) );
+ }
+ btStatus->setText(tr("ready."));
+ m_btIt = m_bt.begin();
+
+}
+void SendWidget::slotSelectedDevice( int, int ) {
+/* if ( name == m_irDeSearch ) {
+ for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it )
+ m_devBox->removeDevice( it.key() );
+
+ QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
+ }*/
+}
+void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) {
+ if ( str == "devices(QStringList)" ) {
+ QDataStream stream( ar, IO_ReadOnly );
+ QStringList list;
+ stream >> list;
+ slotIrDaDevices( list );
+ }
+}
+void SendWidget::slotIrError( int ) {
+ irdaStatus->setText(tr("error :("));
+}
+void SendWidget::slotIrSent( bool b) {
+ QString text = b ? tr("Sent") : tr("Failure");
+ setReceiverStatus( m_irDaIt.key(), text );
+ ++m_irDaIt;
+ slotStartIrda();
+}
+void SendWidget::slotIrTry(unsigned int trI) {
+ setReceiverStatus(m_irDaIt.key(), tr("Try %1").arg( QString::number( trI ) ));
+}
+void SendWidget::slotStartIrda() {
+ if (m_irDaIt == m_irDa.end() ) {
+ irdaStatus->setText(tr("complete."));
+ return;
+ }
+ setReceiverStatus( m_irDaIt.key(), tr("Start sending") );
+ m_obex->send( m_file );
+}
+
+void SendWidget::dispatchBt( const QCString& str, const QByteArray& ar ) {
+ if ( str == "devices(QStringMap)" ) {
+ QDataStream stream( ar, IO_ReadOnly );
+ QMap<QString, QString> btmap;
+ stream >> btmap;
+ slotBTDevices( btmap );
+ }
+}
+void SendWidget::slotBtError( int ) {
+ btStatus->setText(tr("error :("));
+}
+void SendWidget::slotBtSent( bool b) {
+ QString text = b ? tr("Sent") : tr("Failure");
+ setReceiverStatus( m_btIt.key(), text );
+ ++m_btIt;
+ slotStartBt();
+}
+void SendWidget::slotBtTry(unsigned int trI) {
+ setReceiverStatus( m_btIt.key(), tr("Try %1").arg( QString::number( trI ) ) );
+}
+void SendWidget::slotStartBt() {
+ // skip past unselected receivers
+ while((m_btIt != m_bt.end()) && !receiverSelected(m_btIt.key()))
+ ++m_btIt;
+ if (m_btIt == m_bt.end() ) {
+ btStatus->setText(tr("complete."));
+ return;
+ }
+ setReceiverStatus( m_btIt.key(), tr("Start sending") );
+ m_btobex->send( m_file, m_btIt.data().second() );
+}
+
+void SendWidget::send_to_receivers() {
+ slotStartIrda();
+ slotStartBt();
+}
+
+void SendWidget::scan_for_receivers() {
+
+ bool enable_irda=false;
+ bool enable_bt=false;
+
+ if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) {
+ irdaStatus->setText(tr("not enabled."));
+ enable_irda=true;
+ } else
+ irdaStatus->setText(tr("searching..."));
+
+ if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) {
+ btStatus->setText(tr("not enabled."));
+ enable_bt=true;
+ } else
+ btStatus->setText(tr("searching..."));
+
+ if (enable_irda)
+ QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()");
+ if (enable_bt)
+ QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()");
+
+ QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
+ QCopEnvelope e3("QPE/Bluetooth", "listDevices()");
+
+}
+
+void SendWidget::toggle_receiver(QListViewItem* item)
+{
+ // toggle the state of an individual receiver.
+ if(item->pixmap(2))
+ item->setPixmap(2,QPixmap());
+ else
+ item->setPixmap(2,Resource::loadPixmap("backup/check.png"));
+}
+
+
+void SendWidget::closeEvent( QCloseEvent* e) {
+ e->accept(); // make sure
+ QTimer::singleShot(0, this, SLOT(userDone() ) );
+}
+void SendWidget::userDone() {
+ QCopEnvelope e0("QPE/IrDaApplet", "disableIrda()");
+ QCopEnvelope e1("QPE/Bluetooth", "disableBluetooth()");
+ emit done();
+}
+QString SendWidget::file()const {
+ return m_file;
+}
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h
new file mode 100644
index 0000000..030e180
--- a/dev/null
+++ b/core/obex/obexsend.h
@@ -0,0 +1,98 @@
+#ifndef OPIE_OBEX_SEND_WIDGET_H
+#define OPIE_OBEX_SEND_WIDGET_H
+
+// 7-Jul-2005 mbh@sdgsystems.com: replace hand coded form with one
+// generated via QT2 Designer. The new form supports
+// selection of target devices, as opposed to sending to
+// all.
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include "obexsendbase.h"
+
+class QLabel;
+class QVBoxLayout;
+/**
+ * This is the new sending widget for Obex
+ * It will attemp to smart and be able to send
+ * it to multiple (selected) devices.
+ * It'll support BT + IrDa
+ */
+namespace OpieObex {
+ class Obex;
+ class BtObex;
+
+ struct Pair {
+ Pair(const QString& first = QString::null,
+ const QString& second = QString::null)
+ : m_first(first), m_second(second ) {
+ }
+ QString first()const{ return m_first; }
+ QString second()const { return m_second; }
+ private:
+ QString m_first;
+ QString m_second;
+ };
+ class SendWidget : public obexSendBase {
+ Q_OBJECT
+ public:
+ SendWidget( QWidget* parent = 0, const char* name = 0);
+ ~SendWidget();
+
+ QString file()const;
+
+ protected:
+ void closeEvent( QCloseEvent* );
+
+ public slots:
+ void send( const QString& file, const QString& desc );
+
+ signals:
+ void done();
+
+ protected slots:
+ virtual void userDone();
+ virtual void send_to_receivers();
+ virtual void scan_for_receivers();
+ virtual void toggle_receiver(QListViewItem* item);
+
+ private slots: // QCOP slots
+ /* IrDa Names*/
+ void slotIrDaDevices( const QStringList& );
+ /* Bt Names + BD-Addr */
+ void slotBTDevices( const QMap<QString, QString>& );
+ void slotSelectedDevice( int id, int dev );
+
+ void dispatchIrda( const QCString& str, const QByteArray& ar );
+
+ void slotIrError( int );
+ void slotIrSent(bool);
+ void slotIrTry(unsigned int );
+ void slotStartIrda();
+
+ void dispatchBt( const QCString& str, const QByteArray& ar );
+ void slotBtError( int );
+ void slotBtSent(bool);
+ void slotBtTry(unsigned int );
+ void slotStartBt();
+
+ private:
+ void initUI();
+ int addReceiver(const char *r, const char *icon);
+ void setReceiverStatus( int id, const QString& status );
+ bool receiverSelected(int id);
+
+ int m_start;
+ QMap<int, QString> m_irDa;
+ QMap<int, QString>::Iterator m_irDaIt;
+ QMap<int, Pair > m_bt;
+ QMap<int, Pair>::Iterator m_btIt;
+ QMap<int, QListViewItem *> receivers;
+ QString m_file;
+ Obex* m_obex;
+ BtObex* m_btobex;
+ };
+}
+
+#endif
diff --git a/core/obex/obexsendbase.cpp b/core/obex/obexsendbase.cpp
new file mode 100644
index 0000000..ae6443c
--- a/dev/null
+++ b/core/obex/obexsendbase.cpp
@@ -0,0 +1,299 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'obexsendbase.ui'
+**
+** Created: Fri Aug 5 00:20:45 2005
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "obexsendbase.h"
+
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlistview.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qimage.h>
+#include <qpixmap.h>
+
+static const char* const image0_data[] = {
+"14 14 4 1",
+". c None",
+"b c #000000",
+"a c #c00000",
+"# c #ff0000",
+"..............",
+"...#a.........",
+"....###.......",
+"......a##.....",
+"..#a....a#....",
+"...##a...a#...",
+".....##...#...",
+"..#a..a#..a#..",
+"...##..#a..#..",
+"....a#..#..#a.",
+".bb..#a.#a..#.",
+".bbb..#..#....",
+".bbb..........",
+".............."};
+
+static const char* const image1_data[] = {
+"14 18 107 2",
+"Qt c None",
+".8 c #000000",
+"#t c #000102",
+"#K c #000104",
+"#D c #00040c",
+"#O c #00050f",
+"#N c #000d24",
+"#M c #000f2a",
+"#L c #001130",
+"#j c #00163d",
+"#J c #001c52",
+"#s c #002770",
+"#C c #002772",
+".F c #002d7f",
+"#c c #00338f",
+"#I c #003699",
+"#B c #0038a3",
+"#E c #003aa5",
+"#A c #003cac",
+"#r c #003cad",
+"## c #003da7",
+".4 c #003da9",
+"#h c #003ead",
+"#q c #003eb0",
+".7 c #003fb1",
+".N c #003fb3",
+".V c #0040b2",
+"#z c #0042b9",
+".5 c #0042ba",
+".U c #0043bb",
+"#a c #0043bd",
+"#F c #0043c0",
+".W c #0044be",
+"#w c #0044c4",
+"#H c #0045c6",
+"#m c #0046c7",
+".L c #0048ca",
+".M c #0049ce",
+"#i c #0049d1",
+"#v c #004ad6",
+".6 c #004bd6",
+".X c #004cd8",
+"#G c #004cd9",
+"#b c #004cda",
+"#l c #004cdb",
+".B c #004edf",
+".D c #004fe1",
+".C c #0050e4",
+".E c #0052e9",
+"#p c #013eab",
+".Y c #0141b7",
+".w c #014dda",
+"#u c #014ede",
+"#k c #0150e3",
+".i c #0151e4",
+".p c #0153ea",
+".h c #0156f2",
+".b c #0156f3",
+".9 c #0256f1",
+".g c #0256f2",
+"#e c #054dd2",
+".a c #0558f2",
+".2 c #0659f3",
+".Z c #075af2",
+".S c #075af3",
+".1 c #0b5df3",
+".# c #0d5ff3",
+".R c #0e60f4",
+".x c #105fef",
+".0 c #1061f2",
+".O c #1263f4",
+".G c #1464f1",
+".c c #1563ed",
+".3 c #1652bc",
+".K c #165ad7",
+".q c #1764ec",
+".j c #1865ec",
+".d c #1d69ee",
+"#y c #1e59c6",
+".J c #206df6",
+".Q c #226ff6",
+".T c #2365dd",
+".y c #256fef",
+".P c #2672f6",
+"#x c #2967d8",
+"#d c #296ded",
+".k c #2a74f1",
+".r c #2b75f2",
+".H c #2d77f5",
+".I c #347df9",
+".l c #357ef7",
+".z c #3780f8",
+".t c #3f84f9",
+"#o c #4876c8",
+".s c #498af8",
+".e c #4c88f5",
+".o c #4c88f6",
+"#g c #4e79c5",
+".v c #4f8af7",
+"#n c #5086e9",
+"#f c #5087eb",
+".f c #5890f7",
+"#. c #5c90f1",
+".u c #5d95f8",
+".m c #5e95f8",
+".A c #6b9df8",
+".n c #ffffff",
+"QtQtQtQtQtQtQtQtQtQtQtQtQtQt",
+"QtQtQtQtQt.#.a.bQtQtQtQtQtQt",
+"QtQtQt.c.d.e.f.g.h.iQtQtQtQt",
+"QtQt.j.k.l.m.n.o.b.b.pQtQtQt",
+"Qt.q.r.s.t.u.n.n.v.b.h.wQtQt",
+".x.y.z.n.n.A.n.B.n.C.D.E.FQt",
+".G.H.I.J.n.n.n.n.K.L.M.B.NQt",
+".O.P.Q.R.S.n.n.T.U.V.W.X.YQt",
+".Z.0.1.2.n.n.n.n.3.4.5.6.7.8",
+".h.9.b.n.n#..n.B.n###a#b#cQt",
+"Qt.b.b#d#e#f.n.n#g#h#a#i#jQt",
+"Qt#k.b#l#m#n.n#o#p#q#r#s#tQt",
+"QtQt#u#v#w#x#y#z#A#B#C#DQtQt",
+"QtQtQt#E#F.B#G#H#I#J#KQtQtQt",
+"QtQtQtQtQt#L#M#N#O.8QtQtQtQt",
+"QtQtQtQtQtQtQtQtQtQtQtQtQtQt",
+"QtQtQtQtQtQtQtQtQtQtQtQtQtQt",
+"QtQtQtQtQtQtQtQtQtQtQtQtQtQt"};
+
+
+/*
+ * Constructs a obexSendBase which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+obexSendBase::obexSendBase( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ QPixmap image0( ( const char** ) image0_data );
+ QPixmap image1( ( const char** ) image1_data );
+ if ( !name )
+ setName( "obexSendBase" );
+ resize( 363, 221 );
+ setCaption( tr( "Send via OBEX" ) );
+ obexSendBaseLayout = new QVBoxLayout( this );
+ obexSendBaseLayout->setSpacing( 6 );
+ obexSendBaseLayout->setMargin( 11 );
+
+ Layout1 = new QHBoxLayout;
+ Layout1->setSpacing( 6 );
+ Layout1->setMargin( 0 );
+
+ sendLabel = new QLabel( this, "sendLabel" );
+ sendLabel->setText( tr( "Sending:" ) );
+ Layout1->addWidget( sendLabel );
+
+ fileToSend = new QLabel( this, "fileToSend" );
+ fileToSend->setText( tr( "Unknown" ) );
+ Layout1->addWidget( fileToSend );
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout1->addItem( spacer );
+ obexSendBaseLayout->addLayout( Layout1 );
+
+ Layout4 = new QHBoxLayout;
+ Layout4->setSpacing( 6 );
+ Layout4->setMargin( 0 );
+
+ irdaLabel = new QLabel( this, "irdaLabel" );
+ irdaLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, irdaLabel->sizePolicy().hasHeightForWidth() ) );
+ irdaLabel->setText( tr( "" ) );
+ irdaLabel->setPixmap( image0 );
+ Layout4->addWidget( irdaLabel );
+
+ irdaStatus = new QLabel( this, "irdaStatus" );
+ irdaStatus->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, irdaStatus->sizePolicy().hasHeightForWidth() ) );
+ irdaStatus->setText( tr( "Unknown" ) );
+ Layout4->addWidget( irdaStatus );
+
+ btLabel = new QLabel( this, "btLabel" );
+ btLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, btLabel->sizePolicy().hasHeightForWidth() ) );
+ btLabel->setText( tr( "" ) );
+ btLabel->setPixmap( image1 );
+ Layout4->addWidget( btLabel );
+
+ btStatus = new QLabel( this, "btStatus" );
+ btStatus->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, btStatus->sizePolicy().hasHeightForWidth() ) );
+ btStatus->setText( tr( "Unknown" ) );
+ Layout4->addWidget( btStatus );
+ obexSendBaseLayout->addLayout( Layout4 );
+
+ receiverList = new QListView( this, "receiverList" );
+ receiverList->addColumn( tr( "Receiver" ) );
+ receiverList->header()->setClickEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->header()->setResizeEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->addColumn( tr( "T" ) );
+ receiverList->header()->setClickEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->header()->setResizeEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->addColumn( tr( "S" ) );
+ receiverList->header()->setClickEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->header()->setResizeEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->addColumn( tr( "Status" ) );
+ receiverList->header()->setClickEnabled( FALSE, receiverList->header()->count() - 1 );
+ receiverList->header()->setResizeEnabled( FALSE, receiverList->header()->count() - 1 );
+ obexSendBaseLayout->addWidget( receiverList );
+
+ Layout3 = new QHBoxLayout;
+ Layout3->setSpacing( 6 );
+ Layout3->setMargin( 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout3->addItem( spacer_2 );
+
+ scanButton = new QPushButton( this, "scanButton" );
+ scanButton->setText( tr( "Scan" ) );
+ Layout3->addWidget( scanButton );
+
+ sendButton = new QPushButton( this, "sendButton" );
+ sendButton->setText( tr( "Send" ) );
+ Layout3->addWidget( sendButton );
+
+ doneButton = new QPushButton( this, "doneButton" );
+ doneButton->setText( tr( "Done" ) );
+ Layout3->addWidget( doneButton );
+ obexSendBaseLayout->addLayout( Layout3 );
+
+ // signals and slots connections
+ connect( scanButton, SIGNAL( clicked() ), this, SLOT( scan_for_receivers() ) );
+ connect( sendButton, SIGNAL( clicked() ), this, SLOT( send_to_receivers() ) );
+ connect( doneButton, SIGNAL( clicked() ), this, SLOT( userDone() ) );
+ connect( receiverList, SIGNAL( clicked(QListViewItem*) ), this, SLOT( toggle_receiver(QListViewItem *) ) );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+obexSendBase::~obexSendBase()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+void obexSendBase::scan_for_receivers()
+{
+ qWarning( "obexSendBase::scan_for_receivers(): Not implemented yet!" );
+}
+
+void obexSendBase::send_to_receivers()
+{
+ qWarning( "obexSendBase::send_to_receivers(): Not implemented yet!" );
+}
+
+void obexSendBase::toggle_receiver(QListViewItem *)
+{
+ qWarning( "obexSendBase::toggle_receiver(QListViewItem *): Not implemented yet!" );
+}
+
+void obexSendBase::userDone()
+{
+ qWarning( "obexSendBase::userDone(): Not implemented yet!" );
+}
+
diff --git a/core/obex/obexsendbase.h b/core/obex/obexsendbase.h
new file mode 100644
index 0000000..7ffd2b5
--- a/dev/null
+++ b/core/obex/obexsendbase.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'obexsendbase.ui'
+**
+** Created: Fri Aug 5 00:14:51 2005
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef OBEXSENDBASE_H
+#define OBEXSENDBASE_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QLabel;
+class QListView;
+class QListViewItem;
+class QPushButton;
+
+class obexSendBase : public QWidget
+{
+ Q_OBJECT
+
+public:
+ obexSendBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~obexSendBase();
+
+ QLabel* sendLabel;
+ QLabel* fileToSend;
+ QLabel* irdaLabel;
+ QLabel* irdaStatus;
+ QLabel* btLabel;
+ QLabel* btStatus;
+ QListView* receiverList;
+ QPushButton* scanButton;
+ QPushButton* sendButton;
+ QPushButton* doneButton;
+
+protected slots:
+ virtual void scan_for_receivers();
+ virtual void send_to_receivers();
+ virtual void toggle_receiver(QListViewItem *);
+ virtual void userDone();
+
+protected:
+ QVBoxLayout* obexSendBaseLayout;
+ QHBoxLayout* Layout1;
+ QHBoxLayout* Layout4;
+ QHBoxLayout* Layout3;
+};
+
+#endif // OBEXSENDBASE_H