//
//     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>
%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


public:
    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);

public:

//  Subclasses of KSycocaEntry

%ConvertToSubClassCode

    sipClass = NULL;

    if (dynamic_cast<KProtocolInfo*>(sipCpp))
        sipClass = sipClass_KProtocolInfo;
    else if (dynamic_cast<KService*>(sipCpp))
        sipClass = sipClass_KService;
    else if (dynamic_cast<KServiceGroup*>(sipCpp))
        sipClass = sipClass_KServiceGroup;
    else if (dynamic_cast<KServiceType*>(sipCpp))
        {
            sipClass = sipClass_KServiceType;
            if (dynamic_cast<KMimeType*>(sipCpp))
                sipClass = sipClass_KMimeType;
        }
%End

};   // KProtocolInfo




