00001 #ifndef OPIE_OBEX_RECEIVER_H 00002 #define OPIE_OBEX_RECEIVER_H 00003 00004 #include <qobject.h> 00005 #include <qvbox.h> 00006 #include <qstring.h> 00007 00008 class QLabel; 00009 class QTextView; 00010 namespace OpieObex { 00011 class Obex; 00012 class OtherHandler; 00013 class Receiver : public QObject { 00014 Q_OBJECT 00015 public: 00016 enum { Datebook , AddressBook, Other }; 00017 Receiver(); 00018 ~Receiver(); 00019 00020 private: 00021 void handleAddr(const QString& ); 00022 void handleDateTodo(const QString& ); 00023 void handleOther(const QString& ); 00024 /* will alter the file name */ 00025 int checkFile( QString& file ); 00026 bool testDateTodo(const QString& file); 00027 bool testAddressbook(const QString& file); 00028 /* called by checkFile */ 00029 void tidyUp( QString& file, const QString& ending ); 00030 00031 private slots: 00032 void slotReceived( const QString& ); 00033 00034 private: 00035 Obex* m_obex; 00036 }; 00037 00038 class OtherHandler : public QVBox { 00039 Q_OBJECT 00040 public: 00041 OtherHandler(); 00042 ~OtherHandler(); 00043 00044 void handle( const QString& file ); 00045 private slots: 00046 void accept(); 00047 void deny(); 00048 private: 00049 QString targetName( const QString& file ); 00050 void copy( const QString& src, const QString& dest ); 00051 QLabel* m_na; 00052 QTextView* m_view; 00053 QString m_file; 00054 }; 00055 } 00056 00057 00058 #endif
1.4.2