1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
|
// qurl.sip generated by MetaSIP on Sun Jun 24 12:29:12 2012
//
// This file is part of the QtCore Python extension module.
//
// Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt.
//
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file. Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
//
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%ModuleCode
#include <qurl.h>
%End
class QUrl
{
%TypeHeaderCode
#include <qurl.h>
%End
%TypeCode
#include <QHash>
%End
public:
enum ParsingMode
{
TolerantMode,
StrictMode,
};
QUrl();
%If (Qt_5_0_0 -)
QUrl(const QString &url, QUrl::ParsingMode mode = QUrl::TolerantMode);
%End
%If (- Qt_5_0_0)
QUrl(const QString &url);
%End
%If (- Qt_5_0_0)
QUrl(const QString &url, QUrl::ParsingMode mode);
%End
QUrl(const QUrl ©);
~QUrl();
long __hash__() const;
%MethodCode
if (sipIsAPIEnabled("QUrl", 2, 0))
{
#if QT_VERSION >= 0x040700
sipRes = qHash(*sipCpp);
#else
sipRes = qHash(sipCpp->toString());
#endif
}
else
{
// Mimic Python's default behavour.
sipRes = _Py_HashPointer(sipSelf);
}
%End
SIP_PYOBJECT __repr__() const /DocType="str"/;
%MethodCode
PyObject *uni = qpycore_PyObject_FromQString(sipCpp->toString());
if (uni)
{
#if PY_MAJOR_VERSION >= 3
sipRes = PyUnicode_FromFormat("PyQt4.QtCore.QUrl(%R)", uni);
#else
sipRes = PyString_FromFormat("PyQt4.QtCore.QUrl(");
PyString_ConcatAndDel(&sipRes, PyObject_Repr(uni));
PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
#endif
Py_DECREF(uni);
}
%End
enum FormattingOption
{
None,
RemoveScheme,
RemovePassword,
RemoveUserInfo,
RemovePort,
RemoveAuthority,
RemovePath,
RemoveQuery,
RemoveFragment,
StripTrailingSlash,
};
typedef QFlags<QUrl::FormattingOption> FormattingOptions;
%If (Qt_5_0_0 -)
void setUrl(const QString &url, QUrl::ParsingMode mode = QUrl::TolerantMode);
%End
%If (- Qt_5_0_0)
void setUrl(const QString &url);
%End
%If (- Qt_5_0_0)
void setUrl(const QString &url, QUrl::ParsingMode mode);
%End
%If (Qt_5_0_0 -)
void setEncodedUrl(const QByteArray &u, QUrl::ParsingMode mode = QUrl::TolerantMode);
%End
%If (- Qt_5_0_0)
void setEncodedUrl(const QByteArray &url);
%End
%If (- Qt_5_0_0)
void setEncodedUrl(const QByteArray &url, QUrl::ParsingMode mode);
%End
bool isValid() const;
bool isEmpty() const;
void clear();
void setScheme(const QString &scheme);
QString scheme() const;
void setAuthority(const QString &authority);
QString authority() const;
void setUserInfo(const QString &userInfo);
QString userInfo() const;
void setUserName(const QString &userName);
QString userName() const;
void setPassword(const QString &password);
QString password() const;
void setHost(const QString &host);
QString host() const;
void setPort(int port);
%If (Qt_5_0_0 -)
int port(int defaultPort = -1) const;
%End
%If (- Qt_5_0_0)
int port() const;
%End
%If (- Qt_5_0_0)
int port(int defaultPort) const;
%End
void setPath(const QString &path);
QString path() const;
void setEncodedQuery(const QByteArray &query);
QByteArray encodedQuery() const;
void setQueryDelimiters(char valueDelimiter, char pairDelimiter);
char queryValueDelimiter() const;
char queryPairDelimiter() const;
void setQueryItems(const QList<QPair<QString, QString>> &query);
void addQueryItem(const QString &key, const QString &value);
QList<QPair<QString, QString>> queryItems() const;
bool hasQueryItem(const QString &key) const;
QString queryItemValue(const QString &key) const;
QStringList allQueryItemValues(const QString &key) const;
void removeQueryItem(const QString &key);
void removeAllQueryItems(const QString &key);
void setFragment(const QString &fragment);
QString fragment() const;
QUrl resolved(const QUrl &relative) const;
bool isRelative() const;
bool isParentOf(const QUrl &url) const;
static QUrl fromLocalFile(const QString &localfile);
QString toLocalFile() const;
QString toString(QFlags<QUrl::FormattingOption> options = None) const;
QByteArray toEncoded(QFlags<QUrl::FormattingOption> options = None) const;
%If (Qt_5_0_0 -)
static QUrl fromEncoded(const QByteArray &u, QUrl::ParsingMode mode = QUrl::TolerantMode);
%End
%If (- Qt_5_0_0)
static QUrl fromEncoded(const QByteArray &url);
%End
%If (- Qt_5_0_0)
static QUrl fromEncoded(const QByteArray &url, QUrl::ParsingMode mode);
%End
void detach();
bool isDetached() const;
bool operator<(const QUrl &url) const;
bool operator==(const QUrl &url) const;
bool operator!=(const QUrl &url) const;
static QString fromPercentEncoding(const QByteArray &);
static QByteArray toPercentEncoding(const QString &input, const QByteArray &exclude = QByteArray(), const QByteArray &include = QByteArray());
static QString fromPunycode(const QByteArray &);
static QByteArray toPunycode(const QString &);
%If (Qt_4_2_0 -)
bool hasQuery() const;
%End
%If (Qt_4_2_0 -)
bool hasFragment() const;
%End
%If (Qt_4_2_0 -)
QString errorString() const;
%End
%If (Qt_4_2_0 -)
static QString fromAce(const QByteArray &);
%End
%If (Qt_4_2_0 -)
static QByteArray toAce(const QString &);
%End
%If (Qt_4_2_0 -)
static QStringList idnWhitelist();
%End
%If (Qt_4_2_0 -)
static void setIdnWhitelist(const QStringList &);
%End
%If (Qt_4_4_0 -)
void setEncodedUserName(const QByteArray &userName);
%End
%If (Qt_4_4_0 -)
QByteArray encodedUserName() const;
%End
%If (Qt_4_4_0 -)
void setEncodedPassword(const QByteArray &password);
%End
%If (Qt_4_4_0 -)
QByteArray encodedPassword() const;
%End
%If (Qt_4_4_0 -)
void setEncodedHost(const QByteArray &host);
%End
%If (Qt_4_4_0 -)
QByteArray encodedHost() const;
%End
%If (Qt_4_4_0 -)
void setEncodedPath(const QByteArray &path);
%End
%If (Qt_4_4_0 -)
QByteArray encodedPath() const;
%End
%If (Qt_4_4_0 -)
void setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray>> &query);
%End
%If (Qt_4_4_0 -)
void addEncodedQueryItem(const QByteArray &key, const QByteArray &value);
%End
%If (Qt_4_4_0 -)
QList<QPair<QByteArray, QByteArray>> encodedQueryItems() const;
%End
%If (Qt_4_4_0 -)
bool hasEncodedQueryItem(const QByteArray &key) const;
%End
%If (Qt_4_4_0 -)
QByteArray encodedQueryItemValue(const QByteArray &key) const;
%End
%If (Qt_4_4_0 -)
QList<QByteArray> allEncodedQueryItemValues(const QByteArray &key) const;
%End
%If (Qt_4_4_0 -)
void removeEncodedQueryItem(const QByteArray &key);
%End
%If (Qt_4_4_0 -)
void removeAllEncodedQueryItems(const QByteArray &key);
%End
%If (Qt_4_4_0 -)
void setEncodedFragment(const QByteArray &fragment);
%End
%If (Qt_4_4_0 -)
QByteArray encodedFragment() const;
%End
%If (Qt_4_6_0 -)
static QUrl fromUserInput(const QString &userInput);
%End
%If (Qt_4_8_0 -)
void swap(QUrl &other);
%End
%If (Qt_4_8_0 -)
QString topLevelDomain() const;
%End
%If (Qt_4_8_0 -)
bool isLocalFile() const;
%End
%If (Qt_5_0_0 -)
QString url(QFlags<QUrl::FormattingOption> options = None) const;
%End
%If (Qt_5_0_0 -)
QString toDisplayString(QFlags<QUrl::FormattingOption> options = None) const;
%End
};
QFlags<QUrl::FormattingOption> operator|(QUrl::FormattingOption f1, QFlags<QUrl::FormattingOption> f2);
QDataStream &operator<<(QDataStream &, const QUrl & /Constrained/);
QDataStream &operator>>(QDataStream &, QUrl & /Constrained/);
%If (Qt_4_3_0 -)
void qSwap(QUrl &value1, QUrl &value2);
%End
|