2
// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
3
// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
7
// PyKDE4 module kdecore version KDE 3.92.0
10
// This file is part of PyKDE4.
12
// PyKDE4 is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU Lesser General Public License as
14
// published by the Free Software Foundation; either version 2.1 of
15
// the License, or (at your option) any later version.
17
// PyKDE4 is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
// GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program. If not, see <http://www.gnu.org/licenses/>.
39
typedef QMap<QString, QString> MetaDataMap;
54
List (const QStringList&);
55
QStringList toStringList () const;
56
//ig operator QVariant () const;
57
void populateMimeData (QMimeData*, const KUrl::MetaDataMap& = KUrl::MetaDataMap (), KUrl::MimeDataFlags = KUrl::DefaultMimeDataFlags ) const;
58
static bool canDecode (const QMimeData*);
59
static QStringList mimeDataTypes ();
60
static KUrl::List fromMimeData (const QMimeData*, KUrl::MetaDataMap* = 0);
64
int __len__ () /NonLazy/;
67
Py_BEGIN_ALLOW_THREADS
68
sipRes = sipCpp -> count();
72
void __setitem__ (int, const KUrl&);
74
//takes index | (int) | value | (KUrl)
77
len = sipCpp -> count();
79
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
85
void __setitem__ (SIP_PYSLICE, const KUrl::List&);
87
//takes range | (a Python slice) | urlList | (KUrl.List)
89
int len, start, stop, step, slicelength;
91
len = sipCpp -> count();
93
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
97
int vlen = a1 -> count();
98
if (vlen != slicelength)
100
sipBadLengthForSlice(vlen,slicelength);
105
KUrl::List::ConstIterator it = a1 -> begin();
106
for (int i = 0; i < slicelength; ++i)
108
(*sipCpp)[start] = *it;
116
void __delitem__ (int);
118
//takes index | (int)
121
len = sipCpp -> count();
123
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
126
sipCpp -> removeAt(a0);
129
void __delitem__ (SIP_PYSLICE);
131
//takes range | (a Python slice)
132
int len, start, stop, step, slicelength;
134
len = sipCpp -> count();
135
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
138
for (int i = 0; i < slicelength; ++i)
140
sipCpp -> removeAt(start);
145
KUrl operator [] (int);
148
//takes index | (int)
151
len = sipCpp -> count();
153
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
156
sipRes = new KUrl((*sipCpp)[a0]);
159
KUrl::List operator [] (SIP_PYSLICE);
161
//returns (KUrl.List)
162
//takes range | (a Python slice)
163
int len, start, stop, step, slicelength;
165
len = sipCpp -> count();
167
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
171
sipRes = new KUrl::List();
173
for (int i = 0; i < slicelength; ++i)
175
(*sipRes) += (*sipCpp)[start];
181
KUrl::List operator + (const KUrl::List&);
183
//returns (KUrl.List)
184
//takes listToAdd | (KUrl.List)
185
Py_BEGIN_ALLOW_THREADS
186
// sipRes = new KUrl::List((const KUrl::List&)((*sipCpp) + *a0));
187
sipRes = new KUrl::List (*sipCpp);
192
KUrl::List& operator += (const KUrl::List&);
193
KUrl::List operator * (int);
195
sipRes = new KUrl::List();
197
for (int i = 0; i < a0; ++i)
198
(*sipRes) += (*sipCpp);
201
KUrl::List& operator *= (int);
203
//returns (KUrl.List)
205
KUrl::List orig(*sipCpp);
209
for (int i = 0; i < a0; ++i)
213
bool operator == (const KUrl::List&);
214
bool operator != (const KUrl::List&);
215
int __contains__ (KUrl) /NonLazy/;
220
QString s = a0->url ();
222
KUrl::List::Iterator it;
223
for (it = sipCpp->begin (); (it != sipCpp->end ()) && (sipRes == 0); it++)
224
if (s == (*it).url ())
236
KUrl (const QString&);
238
KUrl (const QByteArray&);
241
KUrl (const KUrl&, const QString&);
242
QString protocol () const;
243
void setProtocol (const QString&);
244
QString user () const;
245
void setUser (const QString&);
246
bool hasUser () const;
247
QString pass () const;
248
void setPass (const QString&);
249
bool hasPass () const;
250
bool hasHost () const;
252
enum AdjustPathOption
259
QString path (KUrl::AdjustPathOption) const;
260
QString toLocalFile (KUrl::AdjustPathOption = KUrl::LeaveTrailingSlash ) const;
261
void setPath (const QString&);
262
bool hasPath () const;
266
SimplifyDirSeparators,
270
typedef QFlags<KUrl::CleanPathOption> CleanPathOptions;
271
void cleanPath (const KUrl::CleanPathOption& = KUrl::SimplifyDirSeparators );
272
void adjustPath (KUrl::AdjustPathOption);
273
void setEncodedPathAndQuery (const QString&);
275
enum EncodedPathAndQueryOption
281
typedef QFlags<KUrl::EncodedPathAndQueryOption> EncodedPathAndQueryOptions;
282
QString encodedPathAndQuery (KUrl::AdjustPathOption = KUrl::LeaveTrailingSlash , const KUrl::EncodedPathAndQueryOptions& = KUrl::PermitEmptyPath ) const;
283
void setQuery (const QString&);
284
QString query () const;
285
QString ref () const;
286
void setRef (const QString&);
287
bool hasRef () const;
288
QString htmlRef () const;
289
QString encodedHtmlRef () const;
290
void setHTMLRef (const QString&);
291
bool hasHTMLRef () const;
292
bool isLocalFile () const;
293
void setFileEncoding (const QString&);
294
QString fileEncoding () const;
295
bool hasSubUrl () const;
296
void addPath (const QString&);
298
enum QueryItemsOption
303
typedef QFlags<KUrl::QueryItemsOption> QueryItemsOptions;
304
QMap<QString, QString> queryItems (const KUrl::QueryItemsOptions& = 0) const;
305
QString queryItem (const QString&) const;
306
void addQueryItem (const QString&, const QString&);
307
void setFileName (const QString&);
316
typedef QFlags<KUrl::DirectoryOption> DirectoryOptions;
317
QString fileName (const KUrl::DirectoryOptions& = KUrl::IgnoreTrailingSlash ) const;
318
QString directory (const KUrl::DirectoryOptions& = KUrl::IgnoreTrailingSlash ) const;
319
void setDirectory (const QString&);
320
bool cd (const QString&);
321
QString url (KUrl::AdjustPathOption = KUrl::LeaveTrailingSlash ) const;
322
QString prettyUrl (KUrl::AdjustPathOption = KUrl::LeaveTrailingSlash ) const;
323
QString pathOrUrl () const;
324
QString toMimeDataString () const;
326
bool operator == (const KUrl&) const;
327
bool operator == (const QString&) const;
328
bool operator != (const KUrl&) const;
329
bool operator != (const QString&) const;
330
//ig operator QVariant () const;
331
bool cmp (const KUrl&, bool = 0) const;
335
CompareWithoutTrailingSlash,
336
CompareWithoutFragment
339
typedef QFlags<KUrl::EqualsOption> EqualsOptions;
340
bool equals (const KUrl&, const KUrl::EqualsOptions& = 0) const;
341
bool isParentOf (const KUrl&) const;
342
static List split (const QString&);
343
static List split (const KUrl&);
344
static KUrl join (const List&);
345
static KUrl fromPath (const QString&);
346
static KUrl fromPathOrUrl (const QString&);
347
static KUrl fromMimeDataByteArray (const QByteArray&);
348
void populateMimeData (QMimeData*, const KUrl::MetaDataMap& = KUrl::MetaDataMap (), KUrl::MimeDataFlags = KUrl::DefaultMimeDataFlags ) const;
349
static QString encode_string (const QString&);
350
static QString encode_string_no_slash (const QString&);
351
static QString decode_string (const QString&);
352
static bool isRelativeUrl (const QString&);
353
static QString relativeUrl (const KUrl&, const KUrl&);
354
static QString relativePath (const QString&, const QString&, bool* /Out/);
357
//igx operator QString () const;
359
// Subclasses for QUrl
362
%ConvertToSubClassCode
364
if (dynamic_cast<KUrl*>(sipCpp))
365
sipClass = sipClass_KUrl;
373
bool urlcmp (const QString&, const QString&);
374
bool urlcmp (const QString&, const QString&, const KUrl::EqualsOptions&);
375
uint qHash (const QString&);