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.
288 lines
8.2 KiB
288 lines
8.2 KiB
14 years ago
|
//
|
||
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
||
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
||
|
// may also apply
|
||
|
|
||
|
|
||
|
// Generated by preSip
|
||
12 years ago
|
// module tdeio version KDE 3.5.3
|
||
14 years ago
|
|
||
|
|
||
|
// 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 KProtocolInfo : KSycocaEntry
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kprotocolinfo.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
typedef TDESharedPtr<KProtocolInfo> Ptr;
|
||
14 years ago
|
|
||
|
public:
|
||
13 years ago
|
KProtocolInfo (const TQString&);
|
||
14 years ago
|
virtual bool isValid () const;
|
||
13 years ago
|
virtual TQString name () const;
|
||
|
static TQStringList protocols ();
|
||
14 years ago
|
static bool isKnownProtocol (const KURL&);
|
||
13 years ago
|
static bool isKnownProtocol (const TQString&);
|
||
|
static TQString exec (const TQString&) /PyName=exec_/;
|
||
14 years ago
|
|
||
|
enum Type
|
||
|
{
|
||
|
T_STREAM,
|
||
|
T_FILESYSTEM,
|
||
|
T_NONE,
|
||
|
T_ERROR
|
||
|
};
|
||
|
|
||
|
static KProtocolInfo::Type inputType (const KURL&);
|
||
|
static KProtocolInfo::Type outputType (const KURL&);
|
||
13 years ago
|
static TQStringList listing (const KURL&);
|
||
14 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
|
||
|
class ExtraField
|
||
|
{
|
||
|
|
||
|
public:
|
||
|
ExtraField ();
|
||
13 years ago
|
ExtraField (const TQString&, const TQString&);
|
||
|
TQString name;
|
||
|
TQString type;
|
||
14 years ago
|
|
||
|
}; // class ExtraField
|
||
|
|
||
|
|
||
|
public:
|
||
|
%End
|
||
|
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
typedef TQValueList<KProtocolInfo::ExtraField> ExtraFieldList;
|
||
14 years ago
|
static KProtocolInfo::ExtraFieldList extraFields (const KURL&);
|
||
|
%End
|
||
|
|
||
|
static bool isSourceProtocol (const KURL&);
|
||
|
static bool isHelperProtocol (const KURL&);
|
||
13 years ago
|
static bool isHelperProtocol (const TQString&);
|
||
14 years ago
|
static bool isFilterProtocol (const KURL&);
|
||
13 years ago
|
static bool isFilterProtocol (const TQString&);
|
||
14 years ago
|
static bool supportsListing (const KURL&);
|
||
|
static bool supportsReading (const KURL&);
|
||
|
static bool supportsWriting (const KURL&);
|
||
|
static bool supportsMakeDir (const KURL&);
|
||
|
static bool supportsDeleting (const KURL&);
|
||
|
static bool supportsLinking (const KURL&);
|
||
|
static bool supportsMoving (const KURL&);
|
||
|
static bool canCopyFromFile (const KURL&);
|
||
|
static bool canCopyToFile (const KURL&);
|
||
|
|
||
|
%If ( KDE_3_4_0 - )
|
||
|
static bool canRenameFromFile (const KURL&);
|
||
|
static bool canRenameToFile (const KURL&);
|
||
|
static bool canDeleteRecursive (const KURL&);
|
||
|
|
||
|
enum FileNameUsedForCopying
|
||
|
{
|
||
|
Name,
|
||
|
FromURL
|
||
|
};
|
||
|
|
||
|
static KProtocolInfo::FileNameUsedForCopying fileNameUsedForCopying (const KURL&);
|
||
|
%End
|
||
|
|
||
13 years ago
|
static TQString defaultMimetype (const KURL&);
|
||
|
static TQString icon (const TQString&);
|
||
|
static TQString config (const TQString&);
|
||
|
static int maxSlaves (const TQString&);
|
||
|
static bool determineMimetypeFromExtension (const TQString&);
|
||
14 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
static TQString docPath (const TQString&);
|
||
|
static TQString protocolClass (const TQString&);
|
||
|
static bool showFilePreview (const TQString&);
|
||
|
static KURL::URIMode uriParseMode (const TQString&);
|
||
14 years ago
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
13 years ago
|
static TQStringList capabilities (const TQString&);
|
||
|
static TQString proxiedBy (const TQString&);
|
||
14 years ago
|
%End
|
||
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
KProtocolInfo (TQDataStream&, int);
|
||
|
virtual void load (TQDataStream&);
|
||
|
virtual void save (TQDataStream&);
|
||
|
static Type inputType (const TQString&);
|
||
|
static Type outputType (const TQString&);
|
||
|
static TQStringList listing (const TQString&);
|
||
|
static bool isSourceProtocol (const TQString&);
|
||
|
static bool supportsListing (const TQString&);
|
||
|
static bool supportsReading (const TQString&);
|
||
|
static bool supportsWriting (const TQString&);
|
||
|
static bool supportsMakeDir (const TQString&);
|
||
|
static bool supportsDeleting (const TQString&);
|
||
|
static bool supportsLinking (const TQString&);
|
||
|
static bool supportsMoving (const TQString&);
|
||
|
static bool canCopyFromFile (const TQString&);
|
||
|
static bool canCopyToFile (const TQString&);
|
||
|
static TQString defaultMimetype (const TQString&);
|
||
14 years ago
|
|
||
|
protected:
|
||
|
|
||
|
%If ( KDE_3_5_1 - )
|
||
|
bool canRenameFromFile () const;
|
||
|
bool canRenameToFile () const;
|
||
|
bool canDeleteRecursive () const;
|
||
|
KProtocolInfo::FileNameUsedForCopying fileNameUsedForCopying () const;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%If ( KDE_3_4_0 - )
|
||
|
static KProtocolInfo* findProtocol (const KURL&);
|
||
|
%End
|
||
|
|
||
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
}; // class KProtocolInfo
|
||
|
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
//igx TQDataStream& operator >> (TQDataStream&, KProtocolInfo::ExtraField&);
|
||
|
//igx TQDataStream& operator << (TQDataStream&, const KProtocolInfo::ExtraField&);
|
||
14 years ago
|
%End
|
||
|
|
||
|
|
||
|
%MappedType KProtocolInfo::Ptr
|
||
|
//converts KProtocolInfo
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ksharedptr.h>
|
||
|
#include <kprotocolinfo.h>
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python instance
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return NULL;
|
||
|
|
||
12 years ago
|
TDESharedPtr<KProtocolInfo> *cPtr = new TDESharedPtr<KProtocolInfo>(*(TDESharedPtr<KProtocolInfo> *)sipCpp);
|
||
14 years ago
|
KProtocolInfo *cpp = cPtr->data ();
|
||
|
PyObject *obj = sipConvertFromInstance (cpp, sipClass_KProtocolInfo, sipTransferObj);
|
||
|
|
||
|
return obj;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python instance to a Ptr on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return sipCanConvertToType(sipPy, sipType_KProtocolInfo, SIP_NO_CONVERTORS);
|
||
|
|
||
|
int iserr = 0;
|
||
|
KProtocolInfo *cpp = (KProtocolInfo *)sipConvertToType(sipPy, sipType_KProtocolInfo, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
12 years ago
|
*sipCppPtr = new TDESharedPtr<KProtocolInfo> (cpp);
|
||
14 years ago
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|
||
|
%If (KDE_3_2_0 - )
|
||
13 years ago
|
%MappedType TQValueList<KProtocolInfo::ExtraField>
|
||
14 years ago
|
//converts a Python list of KProtocolInfo::ExtraField
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqvaluelist.h>
|
||
14 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
// Create the list
|
||
|
PyObject *pylist;
|
||
|
if ((pylist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
13 years ago
|
TQValueList<KProtocolInfo::ExtraField> *cpplist = (TQValueList<KProtocolInfo::ExtraField> *)sipCpp;
|
||
14 years ago
|
PyObject *inst;
|
||
|
|
||
|
// Get it.
|
||
13 years ago
|
TQValueList<KProtocolInfo::ExtraField>::Iterator it;
|
||
14 years ago
|
for( it = cpplist->begin(); it != cpplist->end(); ++it )
|
||
|
{
|
||
|
if (((inst = sipConvertFromNewType(new KProtocolInfo::ExtraField(*it), sipType_KProtocolInfo_ExtraField, sipTransferObj)) == NULL)
|
||
|
|| PyList_Append (pylist, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (pylist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return pylist;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQValueList<KProtocolInfo::ExtraField> *cpplist = new TQValueList<KProtocolInfo::ExtraField>;
|
||
14 years ago
|
|
||
|
PyObject *elem;
|
||
|
KProtocolInfo::ExtraField *cpp;
|
||
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
cpp = (KProtocolInfo::ExtraField *)sipForceConvertToType(elem, sipType_KProtocolInfo_ExtraField, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (*cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
%End
|
||
|
|
||
|
|