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
00043 public:
00044 MobileGui( CommandScheduler *, KandyPrefs *kprefs, TQWidget* parent=0,
00045 const char* name=0, WFlags fl=0 );
00046 ~MobileGui();
00047
00048 void exit();
00049
00050 signals:
00051 void sendCommand( const TQString & );
00052 void phonebookRead();
00053
00054 void statusMessage( const TQString & );
00055 void transientStatusMessage( const TQString & );
00056 void connectModem();
00057 void disconnectModem();
00058
00059 public slots:
00060 void readModelInformation();
00061 void readPhonebook();
00062 void savePhonebook();
00063 void refreshStatus();
00064 void writePhonebook();
00065 void readKabc();
00066 void writeKabc();
00067 void setClock();
00068 void mergePhonebooks();
00069 void syncPhonebooks();
00070 void termAddOutput( const char *line );
00071 void toggleConnection();
00072 void deleteMobPhonebook();
00073
00074 protected slots:
00075 void processResult( ATCommand * );
00076
00077 private:
00078
00079 CommandScheduler *mScheduler;
00080 AddressSyncer *mSyncer;
00081 KandyPrefs *mPrefs;
00082 TQWidget *mparent;
00083
00084
00085 TQString quote( const TQString & );
00086 TQString dequote( const TQString & );
00087 void formatPBName( TQString *, TQString );
00088 TQString noSpaces( const TQString & );
00089 int firstFreeIndex();
00090 TQString string2GSM( const TQString & );
00091 TQString GSM2String( const TQString & );
00092 TQString decodeSuffix( const TQString & );
00093 TQString stripWhiteSpaces( const TQString & );
00094
00095
00096 void updateKabBook();
00097 void updateMobileBook();
00098 void disconnectGUI();
00099
00100
00101 TQString mMobManufacturer;
00102 TQString mMobModel;
00103 unsigned int mPBStartIndex;
00104 unsigned int mPBLength;
00105 unsigned int mPBNameLength;
00106 TQValueVector<bool> mPBIndexOccupied;
00107 bool mMobHasFD;
00108 bool mMobHasLD;
00109 bool mMobHasME;
00110 bool mMobHasMT;
00111 bool mMobHasTA;
00112 bool mMobHasOW;
00113 bool mMobHasMC;
00114 bool mMobHasRC;
00115
00116
00117 TQString mLastWriteId;
00118 bool mComingFromToggleConnection;
00119 bool mComingFromReadPhonebook;
00120 bool mComingFromSyncPhonebooks;
00121 bool mComingFromExit;
00122 void writePhonebookPostProcessing();
00123
00124
00125 enum ABState { UNLOADED, LOADED, MODIFIED };
00126 ABState mKabState, mMobState;
00127 void setKabState( ABState );
00128 void warnKabState( ABState );
00129 void setMobState( ABState );
00130 bool warnMobState( ABState );
00131
00132
00133 void fillPhonebook( ATCommand * );
00134 };
00135
00136 #endif // MOBILEGUI_H
|