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

Fl_FTP_DS.h

00001 /*
00002 * $Id: Fl_FTP_DS.h,v 1.1 2003/02/19 07:08:41 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_FTP_DS_H_
00023 #define _FL_FTP_DS_H_
00024 
00025 #include <efltk/Fl_Memory_DS.h>
00026 #include <efltk/net/Fl_FTP_Connect.h>
00027 
00028 typedef void (*Fl_Progress_Callback)(int total,int progress);
00029 
00030 class Fl_FTP_DS : public Fl_Memory_DS  {
00031 public:
00032     // ctor, dtor 
00033     Fl_FTP_DS() : Fl_Memory_DS(), m_port(21), m_showpolicy(0), m_fetchbody(false), m_callback(NULL) { }
00034     virtual ~Fl_FTP_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_host = host_name; }
00047     Fl_String host() const              { return m_host; }
00048 
00049     void port(int p)                    { m_port = p; }
00050     int port() const                    { return m_port; }
00051 
00052     void user(Fl_String usr)            { m_user = usr; }    
00053     Fl_String user() const              { return m_user; }    
00054     void password(Fl_String pwd)        { m_password = pwd; }    
00055     Fl_String password() const          { return m_password; }    
00056 
00057     void folder(const char *d)      { m_folder = d; }
00058     void folder(const Fl_String &d)     { m_folder = d; }
00059     const Fl_String &folder() const     { return m_folder; }
00060 
00061     // dataset navigation
00062     virtual bool              open();
00063 
00064     void callback(Fl_Progress_Callback cb) { m_callback = cb; }
00065 private:
00066     Fl_FTP_Connect          m_ftp;    
00067     Fl_String               m_host;
00068     int                     m_port;
00069     Fl_String               m_folder;
00070     char                    m_showpolicy;
00071     Fl_String               m_user;
00072     Fl_String               m_password;
00073     bool                    m_fetchbody;
00074     Fl_Progress_Callback m_callback;
00075 };
00076 
00077 #endif

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