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

Account.hh

Go to the documentation of this file.
00001 // Account.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 ACCOUNT_HH
00020 #define ACCOUNT_HH
00021 
00022 #define POP3 0
00023 #define IMAP 1
00024 #define APOP 2
00025 
00026 #include <string>
00027 #include <vector>
00028 #include "Header.hh"
00029 #include "Feedback.hh"
00030 #include "Connection.hh"
00031 #include "SocketConnection.hh"
00032 
00033 using namespace std;
00034 
00035 namespace acc {
00036 
00037   class Account {
00038   public:
00039     fb::Feedback* report;
00040     string server;
00041     int port;
00042     string user;
00043     string pass;
00044     int protocol;
00045     vector<string> msgIDs;
00046 
00047     // Add more defines for other kinds of connection interfaces, for example:
00048     //   #ifdef _WIN32
00049     //      conn::WinSockConnection host;
00050     //   #endif
00051     // You get the idea...
00052 #ifndef _WIN32
00053     conn::SocketConnection host;
00054 #else
00055     conn::WinSockConnection host;
00056 #endif
00057     
00058     virtual int loginHost(void) = 0;                                 // Returns error code why login failed, or 0 on success
00059     virtual bool logoutHost(void) = 0;                               // Returns FALSE if logout fails
00060     virtual int removeMessage(int) = 0;                              // Delete a message on the e-mail server
00061 
00062     // Networking functions/wrappers
00063     int sendHost(const string&);
00064     string receiveHost(const bool);
00065     int connectHost(const string&, int, int);
00066     int disconnectHost(void);
00067 
00068   public:
00069     Account(fb::Feedback*);
00070     virtual ~Account() = 0;
00071     virtual int check(void) = 0;
00072     const vector<string>& getMessageIDs(void);                       // Get all message IDs of already parsed message headers
00073     void addMessageIDs(const vector<string>&);                       // Add IDs to the pile of already parsed message headers
00074   };
00075 
00076 }
00077 
00078 #endif

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