Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qurl.h 3.3.8 edited Jan 11 14:38 $ 00003 ** 00004 ** Definition of QUrl 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 QURL_H 00039 #define QURL_H 00040 00041 #ifndef QT_H 00042 #include "qstring.h" 00043 #endif // QT_H 00044 00045 #ifndef QT_NO_URL 00046 00047 class QUrlPrivate; 00048 00049 class Q_EXPORT QUrl 00050 { 00051 public: 00052 QUrl(); 00053 QUrl( const QString& url ); 00054 QUrl( const QUrl& url ); 00055 QUrl( const QUrl& url, const QString& relUrl, bool checkSlash = FALSE ); 00056 virtual ~QUrl(); 00057 00058 QString protocol() const; 00059 virtual void setProtocol( const QString& protocol ); 00060 00061 QString user() const; 00062 virtual void setUser( const QString& user ); 00063 bool hasUser() const; 00064 00065 QString password() const; 00066 virtual void setPassword( const QString& pass ); 00067 bool hasPassword() const; 00068 00069 QString host() const; 00070 virtual void setHost( const QString& user ); 00071 bool hasHost() const; 00072 00073 int port() const; 00074 virtual void setPort( int port ); 00075 bool hasPort() const; 00076 00077 QString path( bool correct = TRUE ) const; 00078 virtual void setPath( const QString& path ); 00079 bool hasPath() const; 00080 00081 virtual void setEncodedPathAndQuery( const QString& enc ); 00082 QString encodedPathAndQuery(); 00083 00084 virtual void setQuery( const QString& txt ); 00085 QString query() const; 00086 00087 QString ref() const; 00088 virtual void setRef( const QString& txt ); 00089 bool hasRef() const; 00090 00091 bool isValid() const; 00092 bool isLocalFile() const; 00093 00094 virtual void addPath( const QString& path ); 00095 virtual void setFileName( const QString& txt ); 00096 00097 QString fileName() const; 00098 QString dirPath() const; 00099 00100 QUrl& operator=( const QUrl& url ); 00101 QUrl& operator=( const QString& url ); 00102 00103 bool operator==( const QUrl& url ) const; 00104 bool operator==( const QString& url ) const; 00105 00106 static void decode( QString& url ); 00107 static void encode( QString& url ); 00108 00109 operator QString() const; 00110 virtual QString toString( bool encodedPath = FALSE, bool forcePrependProtocol = TRUE ) const; 00111 00112 virtual bool cdUp(); 00113 00114 static bool isRelativeUrl( const QString &url ); 00115 00116 protected: 00117 virtual void reset(); 00118 virtual bool parse( const QString& url ); 00119 00120 private: 00121 QUrlPrivate *d; 00122 00123 }; 00124 00125 #endif //QT_NO_URL 00126 00127 #endif