Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_IMAP_DS.h

00001 /*
00002 * $Id: Fl_IMAP_DS.h,v 1.3 2003/02/22 19:53:49 parshin Exp $
00003 *
00004 * Extended Fast Light Toolkit (EFLTK)
00005 * Copyright (C) 2002-2003 by EDE-Team
00006 * WWW: http://www.sourceforge.net/projects/ede
00007 *
00008 * Fast Light Toolkit (FLTK)
00009 * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010 * WWW: http://www.fltk.org
00011 *
00012 * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013 * version 2. See COPYING for details.
00014 *
00015 * Author : Alexey Parshin
00016 * Email  : alexey@fltk.net
00017 *
00018 * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019 *
00020 */
00021 
00022 #ifndef _FL_IMAP_DS_H_
00023 #define _FL_IMAP_DS_H_
00024 
00025 #include <efltk/Fl_Memory_DS.h>
00026 #include <efltk/net/Fl_IMAP_Connect.h>
00027 
00028 typedef void (*Fl_Progress_Callback)(int total,int progress);
00029 
00030 class Fl_IMAP_DS : public Fl_Memory_DS  {
00031 public:
00032     // ctor, dtor 
00033     Fl_IMAP_DS() : Fl_Memory_DS(), m_showpolicy(0), m_fetchbody(false), m_callback(NULL) { m_msgid = 0; }
00034     virtual ~Fl_IMAP_DS() { close(); }
00035 
00036     enum {
00037         SHOW_ALL = 0,
00038         HIDE_MESSAGES = 1,
00039         HIDE_FOLDERS = 2,
00040         NO_SORT = 4
00041     };
00042 
00043     char showpolicy() const         { return m_showpolicy; }
00044     void showpolicy(char type)      { m_showpolicy = type; }
00045 
00046     void host(Fl_String host_name)  { m_imap.host(host_name); }
00047     Fl_String host() const          { return m_imap.host(); }
00048 
00049     void user(Fl_String usr)        { m_user = usr; }    
00050     Fl_String user() const          { return m_user; }    
00051     void password(Fl_String pwd)    { m_password = pwd; }    
00052     Fl_String password() const      { return m_password; }    
00053 
00054     void folder(const char *d)      { m_folder = d; }
00055     void folder(const Fl_String &d) { m_folder = d; }
00056     const Fl_String &folder() const { return m_folder; }
00057 
00058     void message(int msgid)         { m_msgid = msgid; }
00059     int message()   const                   { return m_msgid; }
00060 
00061     void fetch_body(bool fb)         { m_fetchbody = fb; }
00062     bool fetch_body() const          { return m_fetchbody; }
00063 
00064     // dataset navigation
00065     virtual bool              open();
00066 
00067     void callback(Fl_Progress_Callback cb) { m_callback = cb; }
00068 private:
00069     Fl_IMAP_Connect     m_imap;    
00070     Fl_String           m_folder;
00071     char                m_showpolicy;
00072     Fl_String           m_user;
00073     Fl_String           m_password;
00074     bool                m_fetchbody;
00075     Fl_Progress_Callback m_callback;
00076     int                     m_msgid;
00077 };
00078 
00079 #endif

Generated on Thu Jul 31 15:33:44 2003 for eFLTK by doxygen1.2.15