//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 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 program.  If not, see <http://www.gnu.org/licenses/>.



%ModuleHeaderCode
//ctscc
#include <kmimetype.h>
#include <kprotocolinfo.h>
#include <kservice.h>
#include <kservicegroup.h>
#include <kservicetype.h>
#include <ksycocaentry.h>
%End

class KProtocolInfo : KSycocaEntry
{
%TypeHeaderCode
#include <kprotocolinfo.h>
%End


public:
//ig    typedef KSharedPtr<KProtocolInfo> Ptr;


//ig    typedef QList<KProtocolInfo::Ptr> List;


    static QStringList      protocols ();
    static bool             isKnownProtocol (const KUrl& url);
    static bool             isKnownProtocol (const QString& protocol);
    static QString          exec (const QString& protocol) /PyName=exec_/;

    enum Type
    {
        T_STREAM,
        T_FILESYSTEM,
        T_NONE,
        T_ERROR
    };


    class ExtraField
    {


    public:
        enum Type
        {
            String,
            DateTime,
            Invalid
        };

                                ExtraField ();
                                ExtraField (const QString& _name, KProtocolInfo::ExtraField::Type _type);
        QString name;
        KProtocolInfo::ExtraField::Type type;
    };
// ExtraField


    typedef QList<KProtocolInfo::ExtraField> ExtraFieldList;

    static KProtocolInfo::ExtraFieldList  extraFields (const KUrl& url);
    static bool             isHelperProtocol (const KUrl& url);
    static bool             isHelperProtocol (const QString& protocol);
    static bool             isFilterProtocol (const KUrl& url);
    static bool             isFilterProtocol (const QString& protocol);
    static QString          icon (const QString& protocol);
    static QString          config (const QString& protocol);
    static int              maxSlaves (const QString& protocol);
    static bool             determineMimetypeFromExtension (const QString& protocol);
    static QString          docPath (const QString& protocol);
    static QString          protocolClass (const QString& protocol);
    static bool             showFilePreview (const QString& protocol);
    static QStringList      capabilities (const QString& protocol);
    static QString          proxiedBy (const QString& protocol);
                            KProtocolInfo (QDataStream& _str, int offset);

    enum FileNameUsedForCopying
    {
        Name,
        FromUrl
    };

    bool                    supportsListing () const;
    QString                 defaultMimeType () const;

    QStringList             archiveMimeTypes () const;


protected:
    bool                    canRenameFromFile () const;
    bool                    canRenameToFile () const;
    bool                    canDeleteRecursive () const;
    KProtocolInfo::FileNameUsedForCopying  fileNameUsedForCopying () const;

private:
                            KProtocolInfo (const QString& path);
//force
                            KProtocolInfo (const KProtocolInfo& other);

//  Subclasses of KSycocaEntry

//end
%ConvertToSubClassCode
    // CTSCC for subclasses of 'KSycocaEntry'
    sipType = NULL;

    if (dynamic_cast<KProtocolInfo*>(sipCpp))
        sipType = sipType_KProtocolInfo;
    else if (dynamic_cast<KService*>(sipCpp))
        sipType = sipType_KService;
    else if (dynamic_cast<KServiceGroup*>(sipCpp))
        sipType = sipType_KServiceGroup;
    else if (dynamic_cast<KServiceType*>(sipCpp))
        {
        sipType = sipType_KServiceType;
        if (dynamic_cast<KMimeType*>(sipCpp))
            sipType = sipType_KMimeType;
        }
%End

public:
    ~KProtocolInfo ();
    static int              maxSlavesPerHost (const QString& protocol);
};
// KProtocolInfo




QDataStream&            operator >> (QDataStream& s, KProtocolInfo::ExtraField& field);
QDataStream&            operator << (QDataStream& s, const KProtocolInfo::ExtraField& field);
