"Fossies" - the Fresh Open Source Software Archive

Member "postal-0.76/client.h" (9 Dec 2006, 1675 Bytes) of package /linux/privat/postal-0.76.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "client.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef CLIENT_H
    2 #define CLIENT_H
    3 
    4 #include <string>
    5 #include "tcp.h"
    6 
    7 class clientResults;
    8 class UserList;
    9 class Mutex;
   10 
   11 class client : public tcp
   12 {
   13 public:
   14   client(int *exitCount, const char *addr, const char *ourAddr, UserList &ul
   15        , int processes, int msgsPerConnection, Logit *log
   16 #ifdef USE_SSL
   17     , int ssl
   18 #endif
   19     , TRISTATE qmail_pop, int imap, int downloadPercent, int deletePercent
   20     , Logit *debug);
   21   client(int threadNum, const client *parent);
   22 
   23   virtual ~client();
   24 
   25   // Connect returns 0 for connect, 1 for can't connect, and 2 for serious
   26   // errors.
   27   int Connect(const string &user, const string &pass);
   28   virtual int disconnect();
   29   int list();
   30   int getMsg(int num, const string &user, bool log = false);
   31   void getUser(string &user, string &pass);
   32 
   33 private:
   34   int connectPOP(const string &user, const string &pass);
   35   int connectIMAP(const string &user, const string &pass);
   36   virtual int action(PVOID);
   37   virtual Thread *newThread(int threadNum);
   38 
   39   virtual int pollRead();
   40   virtual int WriteWork(PVOID buf, int size, int timeout);
   41 
   42   virtual ERROR_TYPE readCommandResp(bool important = true);
   43 
   44   bool checkUser(const char *user);
   45   void error();
   46   virtual void sentData(int);
   47   virtual void receivedData(int bytes);
   48   virtual ERROR_TYPE sendCommandString(const string &s, bool important = true);
   49 
   50   UserList &m_ul;
   51   int m_maxNameLen;
   52   char *m_namesBuf;
   53   Mutex *m_sem;
   54   clientResults *m_res;
   55   int m_msgsPerConnection;
   56   int m_useIMAP;
   57   bool m_isIMAP;
   58   int m_imapID;
   59   char m_imapIDtxt[9];
   60   TRISTATE m_qmail_pop;
   61   int m_downloadPercent, m_deletePercent;
   62 
   63   client(const client&);
   64   client & operator=(const client&);
   65 };
   66 
   67 #endif