Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PopAccount.hh

Go to the documentation of this file.
00001 // PopAccount.hh - source file for the mailfilter program
00002 // Copyright (c) 2000 - 2004  Andreas Bauer <baueran@in.tum.de>
00003 //
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 2 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00017 // USA.
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   // The Windows users don't know snprintf, so here's a work-around for that function
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     // Variables from account
00063     pref::Preferences* prefs;
00064 
00065     // Methods
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   // Exceptions
00081   class UnknownError {};
00082 
00083 
00084 }
00085 
00086 #endif

Generated on Sat Feb 14 18:53:12 2004 for mailfilter by doxygen 1.3.5