00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef POPACCOUNT_HH
00022 #define POPACCOUNT_HH
00023
00024 #include <string>
00025 #include "Account.hh"
00026 #include "Preferences.hh"
00027 #include "Feedback.hh"
00028
00029 #define MAX_BYTES 512
00030
00031 namespace pop {
00032
00033 class PopAccount: public acc::Account {
00034 private:
00035
00036 string server;
00037 string user;
00038 string pass;
00039 int port;
00040 int mySocket;
00041 pref::Preferences* prefs;
00042 fb::Feedback* report;
00043
00044
00045 int login();
00046 int logout();
00047 int connectSocket();
00048 int disconnectSocket();
00049 int deleteMessage(int);
00050 int sendCommand(string);
00051 string receiveResult(string serverCommand = "irrelevant");
00052 string getWord(const string, int);
00053 bool serverResult(const string);
00054 bool isHeaderEnd(const string);
00055
00056 public:
00057 PopAccount(string, string, string, int, pref::Preferences*);
00058 ~PopAccount();
00059 int check();
00060 };
00061
00062
00063 class IOException { };
00064 class ConnectionTimeOut { };
00065 class UnknownError { };
00066 }
00067
00068 #endif