00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LISTE_SIGNET_H
00009 #define LISTE_SIGNET_H
00010
00011 #include <QtCore>
00012 #include <QtGui>
00013 #include <QtNetwork>
00014
00015 #define NB_PARAM 8
00016
00017
00019
00023
00024
00025 class ListeSignet
00026 {
00027 private:
00028
00031 QString list;
00032
00034 int DebutItem(int nb);
00035
00038 QString Crypte(const QString &str, int code);
00039
00040 public:
00042 ListeSignet();
00043
00048 bool CreerFichier();
00049
00051 int NbItem();
00052
00056 int IdentifiantToItem(const QString &Identifiant);
00057
00060 QString RecupIdentifiant(int nb);
00061
00064 inline QString RecupLogin(int nb)
00065 {
00066 return list.section('\n', NB_PARAM * nb + 1, NB_PARAM * nb + 1);
00067 }
00068
00071 inline QString RecupHote(int nb)
00072 {
00073 return list.section('\n', NB_PARAM * nb + 2, NB_PARAM * nb + 2);
00074 }
00075
00078 inline QString RecupMotDePasse(int nb)
00079 {
00080 return Crypte(list.section('\n', NB_PARAM * nb + 3, NB_PARAM * nb + 3), -1);
00081 }
00082
00085 inline int RecupPort(int nb)
00086 {
00087 return list.section('\n', NB_PARAM * nb + 4, NB_PARAM * nb + 4).toInt();
00088 }
00089
00092 inline QString RecupTransferMode(int nb)
00093 {
00094 return list.section('\n', NB_PARAM * nb + 5, NB_PARAM * nb + 5);
00095 }
00096
00099 inline QString RecupProxyName(int nb)
00100 {
00101 return list.section('\n', NB_PARAM * nb + 6, NB_PARAM * nb + 6);
00102 }
00103
00106 inline int RecupProxyPort(int nb)
00107 {
00108 return list.section('\n', NB_PARAM * nb + 7, NB_PARAM * nb + 7).toInt();
00109 }
00110
00112 void Ajouter(const QString &Identifiant, const QString &Login,
00113 const QString &MotDePasse, const QString &Hote, int Port,
00114 const QString &TransferMode, const QString &ProxyName,
00115 int ProxyPort );
00116
00118 void Supprimer(int nb);
00119
00121 void ModifItem(int nb, const QString &Identifiant, const QString &Login,
00122 const QString &MotDePasse, const QString &Hote, int Port,
00123 const QString &TransferMode, const QString &ProxyName,
00124 int ProxyPort );
00125 };
00126
00127 #endif