Eneboo - Documentación para desarrolladores
src/qt/src/kernel/qurlinfo.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qurlinfo.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QUrlInfo 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 QURLINFO_H
00039 #define QURLINFO_H
00040 
00041 #ifndef QT_H
00042 #include "qdatetime.h"
00043 #include "qstring.h"
00044 #if defined(QT_ABI_QT4)
00045 #include "qiodevice.h"
00046 #endif
00047 #endif // QT_H
00048 
00049 class QUrlOperator;
00050 class QUrl;
00051 class QUrlInfoPrivate;
00052 
00053 class Q_EXPORT QUrlInfo
00054 {
00055 public:
00056     enum PermissionSpec {
00057         ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100,
00058         ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010,
00059         ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 };
00060 
00061     QUrlInfo();
00062     QUrlInfo( const QUrlOperator &path, const QString &file );
00063     QUrlInfo( const QUrlInfo &ui );
00064 #if (QT_VERSION-0 >= 0x040000)
00065 #error "QUrlInfo::QUrlInfo() should accept QIODevice::Offset instead of uint"
00066 #elif defined(QT_ABI_QT4)
00067     QUrlInfo( const QString &name, int permissions, const QString &owner,
00068               const QString &group, QIODevice::Offset size, const QDateTime &lastModified,
00069               const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink,
00070               bool isWritable, bool isReadable, bool isExecutable );
00071     QUrlInfo( const QUrl &url, int permissions, const QString &owner,
00072               const QString &group, QIODevice::Offset size, const QDateTime &lastModified,
00073               const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink,
00074               bool isWritable, bool isReadable, bool isExecutable );
00075 #else
00076     QUrlInfo( const QString &name, int permissions, const QString &owner,
00077               const QString &group, uint size, const QDateTime &lastModified,
00078               const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink,
00079               bool isWritable, bool isReadable, bool isExecutable );
00080     QUrlInfo( const QUrl &url, int permissions, const QString &owner,
00081               const QString &group, uint size, const QDateTime &lastModified,
00082               const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink,
00083               bool isWritable, bool isReadable, bool isExecutable );
00084 #endif
00085     QUrlInfo &operator=( const QUrlInfo &ui );
00086     virtual ~QUrlInfo();
00087 
00088     virtual void setName( const QString &name );
00089     virtual void setDir( bool b );
00090     virtual void setFile( bool b );
00091     virtual void setSymLink( bool b );
00092     virtual void setOwner( const QString &s );
00093     virtual void setGroup( const QString &s );
00094 #if (QT_VERSION-0 >= 0x040000)
00095 #error "QUrlInfo::setSize() should accept QIODevice::Offset instead of uint"
00096 #elif defined(QT_ABI_QT4)
00097     virtual void setSize( QIODevice::Offset size );
00098 #else
00099     virtual void setSize( uint size );
00100 #endif
00101     virtual void setWritable( bool b );
00102     virtual void setReadable( bool b );
00103     virtual void setPermissions( int p );
00104     virtual void setLastModified( const QDateTime &dt );
00105 
00106     bool isValid() const;
00107 
00108     QString name() const;
00109     int permissions() const;
00110     QString owner() const;
00111     QString group() const;
00112 #if (QT_VERSION-0 >= 0x040000)
00113 #error "QUrlInfo::size() should return QIODevice::Offset instead of uint"
00114 #elif defined(QT_ABI_QT4)
00115     QIODevice::Offset size() const;
00116 #else
00117     uint size() const;
00118 #endif
00119     QDateTime lastModified() const;
00120     QDateTime lastRead() const;
00121     bool isDir() const;
00122     bool isFile() const;
00123     bool isSymLink() const;
00124     bool isWritable() const;
00125     bool isReadable() const;
00126     bool isExecutable() const;
00127 
00128     static bool greaterThan( const QUrlInfo &i1, const QUrlInfo &i2,
00129                              int sortBy );
00130     static bool lessThan( const QUrlInfo &i1, const QUrlInfo &i2,
00131                           int sortBy );
00132     static bool equal( const QUrlInfo &i1, const QUrlInfo &i2,
00133                        int sortBy );
00134 
00135     bool operator==( const QUrlInfo &i ) const;
00136 private:
00137     QUrlInfoPrivate *d;
00138 
00139 };
00140 
00141 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'