00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef POPACCOUNT_HH
00020
#define POPACCOUNT_HH
00021
00022
#ifndef SINGLE_LINE
00023 #define SINGLE_LINE true
00024 #define MULTI_LINE false
00025
#endif
00026
00027
#include <vector>
00028
#include <string>
00029
extern "C" {
00030
#include <stdio.h>
00031 }
00032
#ifndef HAVE_SNPRINTF
00033
#include <stdarg.h>
00034
#endif
00035
#include "Account.hh"
00036
#include "Header.hh"
00037
#include "Preferences.hh"
00038
#include "SocketConnection.hh"
00039
00040
using namespace std;
00041
00042
namespace acc {
00043
00044
00045
00046
#ifndef HAVE_SNPRINTF
00047 int snprintf(
char *str, size_t size,
const char *format, ...) {
00048
int i;
00049 va_list args;
00050 va_start(args, format);
00051 i = vsnprintf(str, size, format, args);
00052 va_end(args);
00053
return i;
00054 }
00055
#else
00056
extern int snprintf(
char *str, size_t size,
const char *format, ...);
00057
#endif
00058
00059
00060 class PopAccount:
public Account {
00061
private:
00062
00063
pref::Preferences* prefs;
00064
00065
00066
int loginHost(
void);
00067
bool logoutHost(
void);
00068
int removeMessage(
int);
00069
bool successful(
const string&);
00070
void getHash(
char*,
char*,
char*);
00071 string getWord(
const string&,
int);
00072
00073
public:
00074
PopAccount(
const string&,
const string&,
const string&,
int,
int,
pref::Preferences*,
fb::Feedback*);
00075
~PopAccount();
00076
int check();
00077 };
00078
00079
00080
00081 class UnknownError {};
00082
00083
00084 }
00085
00086
#endif