You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
409 lines
11 KiB
409 lines
11 KiB
//
|
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
|
// may also apply
|
|
|
|
|
|
// Generated by preSip
|
|
// module tdecore version KDE 3.5.3
|
|
|
|
|
|
// This software is free software; you can redistribute it and/or
|
|
// modify it under the terms of the GNU General Public License as
|
|
// published by the Free Software Foundation; either version 2 of
|
|
// the License, or (at your option) any later version.
|
|
//
|
|
// This software is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public
|
|
// License along with this library; see the file COPYING.
|
|
// If not, write to the Free Software Foundation, Inc.,
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
class KURL
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kurl.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
|
|
enum AdjustementFlags
|
|
{
|
|
NoAdjustements,
|
|
StripFileProtocol
|
|
};
|
|
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
|
|
enum URIMode
|
|
{
|
|
Auto,
|
|
Invalid,
|
|
RawURI,
|
|
URL,
|
|
Mailto
|
|
};
|
|
|
|
%End
|
|
|
|
KURL ();
|
|
KURL (const QString&, int = 0);
|
|
KURL (const char*, int = 0);
|
|
KURL (const QCString&, int = 0);
|
|
KURL (const KURL&);
|
|
KURL (const QUrl&);
|
|
KURL (const KURL&, const QString&, int = 0);
|
|
QString protocol () const;
|
|
void setProtocol (const QString&);
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
int uriMode () const;
|
|
%End
|
|
|
|
QString user () const;
|
|
void setUser (const QString&);
|
|
bool hasUser () const;
|
|
QString pass () /PyName=pass_/;
|
|
void setPass (const QString&);
|
|
bool hasPass () const;
|
|
QString host () const;
|
|
void setHost (const QString&);
|
|
bool hasHost () const;
|
|
ushort port () const;
|
|
void setPort (ushort);
|
|
QString path () const;
|
|
QString path (int) const;
|
|
void setPath (const QString&);
|
|
bool hasPath () const;
|
|
void cleanPath (bool = 0);
|
|
void adjustPath (int);
|
|
void setEncodedPathAndQuery (const QString&, int = 0);
|
|
void setEncodedPath (const QString&, int = 0);
|
|
QString encodedPathAndQuery (int = 0, bool = 0, int = 0) const;
|
|
void setQuery (const QString&, int = 0);
|
|
QString query () const;
|
|
QString ref () const;
|
|
void setRef (const QString&);
|
|
bool hasRef () const;
|
|
QString htmlRef () const;
|
|
QString encodedHtmlRef () const;
|
|
void setHTMLRef (const QString&);
|
|
bool hasHTMLRef () const;
|
|
bool isValid () const;
|
|
bool isMalformed () const;
|
|
bool isLocalFile () const;
|
|
void setFileEncoding (const QString&);
|
|
QString fileEncoding () const;
|
|
bool hasSubURL () const;
|
|
void addPath (const QString&);
|
|
QString queryItem (const QString&) const;
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
QString queryItem (const QString&, int) const;
|
|
%End
|
|
|
|
|
|
%If ( KDE_3_1_0 - )
|
|
|
|
enum QueryItemsOptions
|
|
{
|
|
CaseInsensitiveKeys
|
|
};
|
|
|
|
QMap<QString,QString> queryItems (int = 0) const;
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
QMap<QString,QString> queryItems (int, int) const;
|
|
%End
|
|
|
|
void addQueryItem (const QString&, const QString&, int = 0);
|
|
void removeQueryItem (const QString&);
|
|
%End
|
|
|
|
void setFileName (const QString&);
|
|
QString fileName (bool = 1) const;
|
|
QString directory (bool = 1, bool = 1) const;
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
void setDirectory (const QString&);
|
|
%End
|
|
|
|
bool cd (const QString&);
|
|
QString url (int = 0, int = 0) const;
|
|
QString prettyURL (int = 0) const;
|
|
QString prettyURL (int, KURL::AdjustementFlags) const;
|
|
|
|
%If ( KDE_3_4_0 - )
|
|
QString pathOrURL () const;
|
|
%End
|
|
|
|
|
|
%If ( KDE_3_0_1 - )
|
|
QString htmlURL () const;
|
|
%End
|
|
|
|
bool isEmpty () const;
|
|
KURL upURL () const;
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
bool operator < (const KURL&) const;
|
|
%End
|
|
|
|
|
|
%If ( KDE_3_1_4 - )
|
|
bool operator == (const KURL&) const;
|
|
bool operator == (const QString&) const;
|
|
bool operator != (const KURL&) const;
|
|
bool operator != (const QString&) const;
|
|
%End
|
|
|
|
bool cmp (const KURL&, bool = 0) const;
|
|
|
|
%If ( KDE_3_1_0 - )
|
|
bool equals (const KURL&, bool = 0) const;
|
|
%End
|
|
|
|
bool isParentOf (const KURL&) const;
|
|
static KURL::List split (const QString&);
|
|
static KURL::List split (const KURL&);
|
|
static KURL join (const KURL::List&);
|
|
|
|
%If ( KDE_3_1_0 - )
|
|
static KURL fromPathOrURL (const QString&);
|
|
%End
|
|
|
|
static QString encode_string (const QString&, int = 0);
|
|
static QString encode_string_no_slash (const QString&, int = 0);
|
|
static QString decode_string (const QString&, int = 0);
|
|
static bool isRelativeURL (const QString&);
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
static QString relativeURL (const KURL&, const KURL&, int = 0);
|
|
static QString relativePath (const QString&, const QString&, bool* = 0);
|
|
static KURL::URIMode uriModeForProtocol (const QString&);
|
|
%End
|
|
|
|
QString filename (bool = 1) const;
|
|
|
|
protected:
|
|
void reset ();
|
|
|
|
%If ( KDE_3_2_0 - )
|
|
void parseURL (const QString&, int = 0);
|
|
void parseRawURI (const QString&, int = 0);
|
|
void parseMailto (const QString&, int = 0);
|
|
%End
|
|
|
|
void parse (const QString&, int = 0);
|
|
|
|
public:
|
|
//force
|
|
|
|
class List
|
|
{
|
|
|
|
public:
|
|
List ();
|
|
List (const QStringList&);
|
|
QStringList toStringList () const;
|
|
bool isEmpty () const;
|
|
void append (const KURL&);
|
|
void prepend (const KURL&);
|
|
void remove (const KURL&);
|
|
const KURL& first () const;
|
|
const KURL& last () const;
|
|
int findIndex (const KURL&) const;
|
|
uint contains (const KURL&) const;
|
|
uint count () const;
|
|
void clear ();
|
|
int __len__ () /NonLazy/;
|
|
%MethodCode
|
|
//returns (int)
|
|
Py_BEGIN_ALLOW_THREADS
|
|
sipRes = sipCpp -> count();
|
|
Py_END_ALLOW_THREADS
|
|
%End
|
|
|
|
void __setitem__ (int, const KURL&);
|
|
%MethodCode
|
|
//takes index | (int) | value | (KURL)
|
|
int len;
|
|
|
|
len = sipCpp -> count();
|
|
|
|
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
(*sipCpp)[a0] = *a1;
|
|
%End
|
|
|
|
void __setitem__ (SIP_PYSLICE, const KURL::List&);
|
|
%MethodCode
|
|
//takes range | (a Python slice) | urlList | (KURL.List)
|
|
|
|
int len;
|
|
SIP_SSIZE_T start, stop, step, slicelength;
|
|
|
|
len = sipCpp -> count();
|
|
|
|
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
{
|
|
int vlen = a1 -> count();
|
|
if (vlen != slicelength)
|
|
{
|
|
sipBadLengthForSlice(vlen,slicelength);
|
|
sipIsErr = 1;
|
|
}
|
|
else
|
|
{
|
|
KURL::List::ConstIterator it = a1 -> begin();
|
|
for (int i = 0; i < slicelength; ++i)
|
|
{
|
|
(*sipCpp)[start] = *it;
|
|
start += step;
|
|
++it;
|
|
}
|
|
}
|
|
}
|
|
%End
|
|
|
|
void __delitem__ (int);
|
|
%MethodCode
|
|
//takes index | (int)
|
|
int len;
|
|
|
|
len = sipCpp -> count();
|
|
|
|
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
sipCpp -> remove(sipCpp -> at(a0));
|
|
%End
|
|
|
|
void __delitem__ (SIP_PYSLICE);
|
|
%MethodCode
|
|
//takes range | (a Python slice)
|
|
int len;
|
|
SIP_SSIZE_T start, stop, step, slicelength;
|
|
|
|
len = sipCpp -> count();
|
|
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
for (int i = 0; i < slicelength; ++i)
|
|
{
|
|
sipCpp -> remove(sipCpp -> at(start));
|
|
start += step - 1;
|
|
}
|
|
%End
|
|
|
|
KURL operator [] (int);
|
|
%MethodCode
|
|
//returns (KURL)
|
|
//takes index | (int)
|
|
int len;
|
|
|
|
len = sipCpp -> count();
|
|
|
|
if ((a0 = sipConvertFromSequenceIndex(a0,len)) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
sipRes = new KURL((*sipCpp)[a0]);
|
|
%End
|
|
|
|
KURL::List operator [] (SIP_PYSLICE);
|
|
%MethodCode
|
|
//returns (KURL.List)
|
|
//takes range | (a Python slice)
|
|
int len;
|
|
SIP_SSIZE_T start, stop, step, slicelength;
|
|
|
|
len = sipCpp -> count();
|
|
|
|
if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
|
|
sipIsErr = 1;
|
|
else
|
|
{
|
|
sipRes = new KURL::List();
|
|
|
|
for (int i = 0; i < slicelength; ++i)
|
|
{
|
|
(*sipRes) += (*sipCpp)[start];
|
|
start += step;
|
|
}
|
|
}
|
|
%End
|
|
|
|
KURL::List operator + (const KURL::List&);
|
|
%MethodCode
|
|
//returns (KURL.List)
|
|
//takes listToAdd | (KURL.List)
|
|
Py_BEGIN_ALLOW_THREADS
|
|
// sipRes = new KURL::List((const KURL::List&)((*sipCpp) + *a0));
|
|
sipRes = new KURL::List (*sipCpp);
|
|
(*sipRes) += (*a0);
|
|
Py_END_ALLOW_THREADS
|
|
%End
|
|
|
|
KURL::List& operator += (const KURL::List&);
|
|
KURL::List operator * (int);
|
|
%MethodCode
|
|
sipRes = new KURL::List();
|
|
|
|
for (int i = 0; i < a0; ++i)
|
|
(*sipRes) += (*sipCpp);
|
|
%End
|
|
|
|
KURL::List& operator *= (int);
|
|
%MethodCode
|
|
//returns (KURL.List)
|
|
//takes val | (int)
|
|
KURL::List orig(*sipCpp);
|
|
|
|
sipCpp -> clear();
|
|
|
|
for (int i = 0; i < a0; ++i)
|
|
(*sipCpp) += orig;
|
|
%End
|
|
|
|
bool operator == (const KURL::List&);
|
|
bool operator != (const KURL::List&);
|
|
int __contains__ (KURL) /NonLazy/;
|
|
%MethodCode
|
|
//returns (bool)
|
|
//takes a0 | (KURL)
|
|
|
|
QString s = a0->url ();
|
|
sipRes = 0;
|
|
KURL::List::Iterator it;
|
|
for (it = sipCpp->begin (); (it != sipCpp->end ()) && (sipRes == 0); it++)
|
|
if (s == (*it).url ())
|
|
sipRes = 1;
|
|
%End
|
|
|
|
|
|
}; // class List
|
|
|
|
|
|
public:
|
|
//end
|
|
|
|
}; // class KURL
|
|
|
|
bool urlcmp (const QString&, const QString&);
|
|
bool urlcmp (const QString&, const QString&, bool, bool);
|
|
|
|
%If ( KDE_3_1_4 - )
|
|
//igx QDataStream& operator << (QDataStream&, const KURL&);
|
|
//igx QDataStream& operator >> (QDataStream&, KURL&);
|
|
%End
|