kandy
mobilegui.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MOBILEGUI_H
00025 #define MOBILEGUI_H
00026
00027 #include <kandyiface.h>
00028
00029 #include "mobilegui_base.h"
00030 #include "kandyprefs.h"
00031 #include "tqvaluevector.h"
00032
00033
00034 class CommandScheduler;
00035 class ATCommand;
00036 class AddressSyncer;
00037
00038
00039 class MobileGui : public MobileGui_base, virtual public KandyIface
00040 {
00041 Q_OBJECT
00042 TQ_OBJECT
00043
00044 public:
00045 MobileGui( CommandScheduler *, KandyPrefs *kprefs, TQWidget* parent=0,
00046 const char* name=0, WFlags fl=0 );
00047 ~MobileGui();
00048
00049 void exit();
00050
00051 signals:
00052 void sendCommand( const TQString & );
00053 void phonebookRead();
00054
00055 void statusMessage( const TQString & );
00056 void transienStatusMessage( const TQString & );
00057 void connectModem();
00058 void disconnectModem();
00059
00060 public slots:
00061 void readModelInformation();
00062 void readPhonebook();
00063 void savePhonebook();
00064 void refreshStatus();
00065 void writePhonebook();
00066 void readKabc();
00067 void writeKabc();
00068 void setClock();
00069 void mergePhonebooks();
00070 void syncPhonebooks();
00071 void termAddOutput( const char *line );
00072 void toggleConnection();
00073 void deleteMobPhonebook();
00074
00075 protected slots:
00076 void processResult( ATCommand * );
00077
00078 private:
00079
00080 CommandScheduler *mScheduler;
00081 AddressSyncer *mSyncer;
00082 KandyPrefs *mPrefs;
00083 TQWidget *mparent;
00084
00085
00086 TQString quote( const TQString & );
00087 TQString dequote( const TQString & );
00088 void formatPBName( TQString *, TQString );
00089 TQString noSpaces( const TQString & );
00090 int firstFreeIndex();
00091 TQString string2GSM( const TQString & );
00092 TQString GSM2String( const TQString & );
00093 TQString decodeSuffix( const TQString & );
00094 TQString stripWhiteSpaces( const TQString & );
00095
00096
00097 void updateKabBook();
00098 void updateMobileBook();
00099 void disconnectGUI();
00100
00101
00102 TQString mMobManufacturer;
00103 TQString mMobModel;
00104 unsigned int mPBStartIndex;
00105 unsigned int mPBLength;
00106 unsigned int mPBNameLength;
00107 TQValueVector<bool> mPBIndexOccupied;
00108 bool mMobHasFD;
00109 bool mMobHasLD;
00110 bool mMobHasME;
00111 bool mMobHasMT;
00112 bool mMobHasTA;
00113 bool mMobHasOW;
00114 bool mMobHasMC;
00115 bool mMobHasRC;
00116
00117
00118 TQString mLastWriteId;
00119 bool mComingFromToggleConnection;
00120 bool mComingFromReadPhonebook;
00121 bool mComingFromSyncPhonebooks;
00122 bool mComingFromExit;
00123 void writePhonebookPostProcessing();
00124
00125
00126 enum ABState { UNLOADED, LOADED, MODIFIED };
00127 ABState mKabState, mMobState;
00128 void setKabState( ABState );
00129 void warnKabState( ABState );
00130 void setMobState( ABState );
00131 bool warnMobState( ABState );
00132
00133
00134 void fillPhonebook( ATCommand * );
00135 };
00136
00137 #endif // MOBILEGUI_H
|