/include/ftpview.h

00001 /****************************************************************************
00002 ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
00003 ** Copyright (C) 2002-2003 Eric Andresen.
00004 ** ftpview.h
00005 ** Taken from Qt examples, and modified.
00006 ** $Id: ftpview.h,v 1.10 2003/09/11 06:53:21 ndiin Exp $
00007 *****************************************************************************/
00008 
00009 #ifndef FTPVIEW_H
00010 #define FTPVIEW_H
00011 
00012 #include <qlistview.h>
00013 #include <qurlinfo.h>
00014 
00015 class QPopupMenu;
00016 
00020 class FtpViewItem : public QListViewItem
00021 {
00022 public:
00024     FtpViewItem( QListView *parent, const QUrlInfo &i );
00025 
00031     int compare( QListViewItem * i, int col, bool ascending ) const;
00033     QString text( int c ) const;
00035     const QPixmap* pixmap( int c ) const;
00037     QUrlInfo entryInfo() const {
00038       return info;
00039     }
00040 
00041 private:
00042     QUrlInfo info;
00043 };
00044 
00048 class FtpView : public QListView
00049 {
00050     Q_OBJECT
00051 
00052 public:
00054     FtpView( QWidget *parent, int id );
00056     virtual ~FtpView();
00058     QValueList<QUrlInfo> selectedItems() const;
00060     void setPath(QString path);
00061 
00062 public slots:
00064     void slotInsertEntries( int, const QValueList<QUrlInfo> &info );
00066     void slotInsertEntries( const QValueList<QUrlInfo> &info );
00068     void clear();
00069 
00070 signals:
00072     void itemSelected( const int, const QString, const QUrlInfo & );
00074     void transferItem( const int, const QString, const QUrlInfo & );
00076     void removeItem( const int, const QString, const QUrlInfo & );
00078     void abortRequested( const int );
00080     void listRequested( const int );
00082     void rawRequested( const int );
00083 
00084 private slots:
00085     void slotSelected( QListViewItem *item );
00086     void slotMenuItemActivated(int);
00087     void slotContextMenuRequested( QListViewItem *, const QPoint&, int );
00088 
00089 private:
00090     QPopupMenu *popup;
00091     bool hasdotdot;
00092     QString _path;
00093     int _id;
00094 
00095     enum MenuIds {
00096       Transfer=0,
00097       Delete,
00098       Abort,
00099       List,
00100       Raw
00101     };
00102 };
00103 
00104 #endif

Generated on Wed Oct 22 20:32:04 2003 for nvemftp by doxygen1.3