Eneboo - Documentación para desarrolladores
src/qt/include/qurloperator.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qurloperator.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QUrlOperator class
00005 **
00006 ** Created : 950429
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QURLOPERATOR_H
00039 #define QURLOPERATOR_H
00040 
00041 #ifndef QT_H
00042 #include "qobject.h"
00043 #include "qurl.h"
00044 #include "qptrlist.h"
00045 #include "qnetworkprotocol.h"
00046 #include "qstringlist.h" // QString->QStringList conversion
00047 #endif // QT_H
00048 
00049 #ifndef QT_NO_NETWORKPROTOCOL
00050 
00051 class QUrlInfo;
00052 class QUrlOperatorPrivate;
00053 
00054 class Q_EXPORT QUrlOperator : public QObject, public QUrl
00055 {
00056     friend class QNetworkProtocol;
00057 
00058     Q_OBJECT
00059 
00060 public:
00061     QUrlOperator();
00062     QUrlOperator( const QString &urL );
00063     QUrlOperator( const QUrlOperator& url );
00064     QUrlOperator( const QUrlOperator& url, const QString& relUrl, bool checkSlash = FALSE );
00065     virtual ~QUrlOperator();
00066 
00067     virtual void setPath( const QString& path );
00068     virtual bool cdUp();
00069 
00070     virtual const QNetworkOperation *listChildren();
00071     virtual const QNetworkOperation *mkdir( const QString &dirname );
00072     virtual const QNetworkOperation *remove( const QString &filename );
00073     virtual const QNetworkOperation *rename( const QString &oldname, const QString &newname );
00074     virtual const QNetworkOperation *get( const QString &location = QString::null );
00075     virtual const QNetworkOperation *put( const QByteArray &data, const QString &location = QString::null  );
00076     virtual QPtrList<QNetworkOperation> copy( const QString &from, const QString &to, bool move = FALSE, bool toPath = TRUE );
00077     virtual void copy( const QStringList &files, const QString &dest, bool move = FALSE );
00078     virtual bool isDir( bool *ok = 0 );
00079 
00080     virtual void setNameFilter( const QString &nameFilter );
00081     QString nameFilter() const;
00082 
00083     virtual QUrlInfo info( const QString &entry ) const;
00084 
00085     QUrlOperator& operator=( const QUrlOperator &url );
00086     QUrlOperator& operator=( const QString &url );
00087 
00088     virtual void stop();
00089 
00090 signals:
00091     void newChildren( const QValueList<QUrlInfo> &, QNetworkOperation *res );
00092     void finished( QNetworkOperation *res );
00093     void start( QNetworkOperation *res );
00094     void createdDirectory( const QUrlInfo &, QNetworkOperation *res );
00095     void removed( QNetworkOperation *res );
00096     void itemChanged( QNetworkOperation *res );
00097     void data( const QByteArray &, QNetworkOperation *res );
00098     void dataTransferProgress( int bytesDone, int bytesTotal, QNetworkOperation *res );
00099     void startedNextCopy( const QPtrList<QNetworkOperation> &lst );
00100     void connectionStateChanged( int state, const QString &data );
00101 
00102 protected:
00103     void reset();
00104     bool parse( const QString& url );
00105     virtual bool checkValid();
00106     virtual void clearEntries();
00107     void getNetworkProtocol();
00108     void deleteNetworkProtocol();
00109 
00110 private slots:
00111     const QNetworkOperation *startOperation( QNetworkOperation *op );
00112     void copyGotData( const QByteArray &data, QNetworkOperation *op );
00113     void continueCopy( QNetworkOperation *op );
00114     void finishedCopy();
00115     void addEntry( const QValueList<QUrlInfo> &i );
00116     void slotItemChanged( QNetworkOperation *op );
00117 
00118 private:
00119     void deleteOperation( QNetworkOperation *op );
00120 
00121     QUrlOperatorPrivate *d;
00122 };
00123 
00124 #endif // QT_NO_NETWORKPROTOCOL
00125 
00126 #endif // QURLOPERATOR_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'