Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

obexsend.h

Go to the documentation of this file.
00001 #ifndef OPIE_OBEX_SEND_WIDGET_H
00002 #define OPIE_OBEX_SEND_WIDGET_H
00003 
00004 //  7-Jul-2005 mbh@sdgsystems.com: replace hand coded form with one
00005 //             generated via QT2 Designer.  The new form supports
00006 //             selection of target devices, as opposed to sending to 
00007 //             all.
00008 
00009 #include <qstring.h>
00010 #include <qstringlist.h>
00011 #include <qmap.h>
00012 #include "obexsendbase.h"
00013 
00014 class QLabel;
00015 class QVBoxLayout;
00022 namespace OpieObex {
00023     class Obex;
00024     class BtObex;
00025 
00026     struct Pair {
00027         Pair(const QString& first = QString::null,
00028              const QString& second = QString::null)
00029             : m_first(first), m_second(second ) {
00030         }
00031         QString first()const{ return m_first; }
00032         QString second()const { return m_second; }
00033     private:
00034         QString m_first;
00035         QString m_second;
00036     };
00037     class SendWidget : public obexSendBase {
00038         Q_OBJECT
00039     public:
00040         SendWidget( QWidget* parent = 0, const char* name = 0);
00041         ~SendWidget();
00042 
00043         QString file()const;
00044 
00045     protected:
00046         void closeEvent( QCloseEvent* );
00047 
00048     public slots:
00049         void send( const QString& file, const QString& desc );
00050 
00051     signals:
00052         void done();
00053 
00054     protected slots:
00055         virtual void userDone();
00056         virtual void send_to_receivers();
00057         virtual void scan_for_receivers();
00058         virtual void toggle_receiver(QListViewItem* item);
00059 
00060     private slots: // QCOP slots
00061         /* IrDa Names*/
00062         void slotIrDaDevices( const QStringList& );
00063         /* Bt Names + BD-Addr */
00064         void slotBTDevices( const QMap<QString, QString>& );
00065         void slotSelectedDevice( int id, int dev );
00066 
00067         void dispatchIrda( const QCString& str, const QByteArray& ar );
00068 
00069         void slotIrError( int );
00070         void slotIrSent(bool);
00071         void slotIrTry(unsigned int );
00072         void slotStartIrda();
00073 
00074         void dispatchBt( const QCString& str, const QByteArray& ar );
00075         void slotBtError( int );
00076         void slotBtSent(bool);
00077         void slotBtTry(unsigned int );
00078         void slotStartBt();
00079 
00080     private:
00081         void initUI();
00082         int addReceiver(const char *r, const char *icon);
00083         void setReceiverStatus( int id, const QString& status );
00084         bool receiverSelected(int id);
00085 
00086         int m_start;
00087         QMap<int, QString> m_irDa;
00088         QMap<int, QString>::Iterator m_irDaIt;
00089         QMap<int, Pair > m_bt;
00090         QMap<int, Pair>::Iterator m_btIt;
00091         QMap<int, QListViewItem *> receivers;
00092         QString m_file;
00093         Obex* m_obex;
00094         BtObex* m_btobex;
00095     };
00096 }
00097 
00098 #endif

Generated on Sat Nov 5 16:15:45 2005 for OPIE by  doxygen 1.4.2