//
//     Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2006 Jim Bublitz and/or Phil Thompson
//     may also apply


//                 Generated by preSip
//            module kdecore  version KDE 3.91.0


// 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.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.



class KTimeZones
{
%TypeHeaderCode
#include <ktimezone.h>
%End

public:
                         KTimeZones ();
    const KTimeZone*     zone (const QString&) const;
    typedef QMap<QString, const KTimeZone*> ZoneMap;
    const KTimeZones::ZoneMap zones () const;
    bool                 add (KTimeZone*);
    bool                 addConst (const KTimeZone*);
    const KTimeZone*     detach (const KTimeZone*);
    const KTimeZone*     detach (const QString&);
    void                 clear ();
    static const KTimeZone* utc ();

private:
                         KTimeZones (const KTimeZones&);

};  // class KTimeZones




class KTimeZone
{
%TypeHeaderCode
#include <ktimezone.h>
%End

public:

    class Phase
    {

    public:
                             Phase ();
                             Phase (int, const QByteArray&, bool, const QString& = QString ());
                             Phase (int, const QList<QByteArray>&, bool, const QString& = QString ());
                             Phase (const KTimeZone::Phase&);
        bool                 operator == (const KTimeZone::Phase&) const;
        bool                 operator != (const KTimeZone::Phase&) const;
        int                  utcOffset () const;
        QList<QByteArray>    abbreviations () const;
        bool                 isDst () const;
        QString              comment () const;

    };  // class Phase


public:

    class Transition
    {

    public:
                             Transition ();
                             Transition (const QDateTime&, const KTimeZone::Phase&);
                             Transition (const KTimeZone::Transition&);
        QDateTime            time () const;
        KTimeZone::Phase     phase () const;
        bool                 operator < (const KTimeZone::Transition&) const;

    };  // class Transition


public:

    class LeapSeconds
    {

    public:
                             LeapSeconds ();
                             LeapSeconds (const QDateTime&, int, const QString& = QString ());
                             LeapSeconds (const KTimeZone::LeapSeconds&);
        bool                 operator < (const KTimeZone::LeapSeconds&) const;
        bool                 isValid () const;
        QDateTime            dateTime () const;
        int                  leapSeconds () const;
        QString              comment () const;

    };  // class LeapSeconds


public:
                         KTimeZone (const QString& = QLatin1String ("UTC" ));
                         KTimeZone (const KTimeZone&);
    QString              name () const;
    QString              countryCode () const;
    float                latitude () const;
    float                longitude () const;
    QString              comment () const;
    QList<QByteArray>    abbreviations () const;
    QByteArray           abbreviation (const QDateTime&) const;
    QList<int>           utcOffsets () const;
    QDateTime            convert (const KTimeZone*, const QDateTime&) const;
    QDateTime            toUtc (const QDateTime&) const;
    QDateTime            toZoneTime (const QDateTime&, bool* /Out/ = 0) const;
    int                  currentOffset (Qt::TimeSpec = Qt::UTC) const;
    virtual int          offsetAtZoneTime (const QDateTime&, int* /Out/ = 0) const;
    virtual int          offsetAtUtc (const QDateTime&) const;
    virtual int          offset (time_t) const;
    virtual bool         isDstAtUtc (const QDateTime&) const;
    virtual bool         isDst (time_t) const;
    QList<KTimeZone::Phase> phases () const;
    virtual bool         hasTransitions () const;
    QList<KTimeZone::Transition> transitions (const QDateTime& = QDateTime (), const QDateTime& = QDateTime ()) const;

//ig     const KTimeZone::Transition* transition (const QDateTime&, const KTimeZone::Transition** = 0, bool* = 0) const;

    int                  transitionIndex (const QDateTime&, int* /Out/ = 0, bool* /Out/ = 0) const;
    QList<QDateTime>     transitionTimes (const KTimeZone::Phase&, const QDateTime& = QDateTime (), const QDateTime& = QDateTime ()) const;
    QList<KTimeZone::LeapSeconds> leapSecondChanges () const;
    KTimeZoneSource*     source () const;
    bool                 parse () const;
    const KTimeZoneData* data (bool = 0) const;
    static QDateTime     fromTime_t (time_t);
    static time_t        toTime_t (const QDateTime&);
    static const int     InvalidOffset;
    static const time_t  InvalidTime_t;
    static const float   UNKNOWN;

protected:
                         KTimeZone (KTimeZoneSource*, const QString&, const QString& = QString (), float = UNKNOWN, float = UNKNOWN, const QString& = QString ());
    void                 setData (KTimeZoneData*);

};  // class KTimeZone




class KTimeZoneSource
{
%TypeHeaderCode
#include <ktimezone.h>
%End

public:
                         KTimeZoneSource ();
    virtual KTimeZoneData* parse (const KTimeZone*) const;

};  // class KTimeZoneSource




class KTimeZoneData
{
%TypeHeaderCode
#include <ktimezone.h>
%End

public:
                         KTimeZoneData ();
                         KTimeZoneData (const KTimeZoneData&);
    virtual KTimeZoneData* clone ();
    virtual QList<QByteArray> abbreviations () const;
    virtual QByteArray   abbreviation (const QDateTime&) const;
    virtual QList<int>   utcOffsets () const;
    int                  previousUtcOffset () const;
    QList<KTimeZone::Phase> phases () const;
    virtual bool         hasTransitions () const;
    QList<KTimeZone::Transition> transitions (const QDateTime& = QDateTime (), const QDateTime& = QDateTime ()) const;

//ig     const KTimeZone::Transition* transition (const QDateTime&, const KTimeZone::Transition** = 0, bool* = 0) const;
    
    int                  transitionIndex (const QDateTime&, int* /Out/ = 0, bool* /Out/ = 0) const;
    QList<QDateTime>     transitionTimes (const KTimeZone::Phase&, const QDateTime& = QDateTime (), const QDateTime& = QDateTime ()) const;
    QList<KTimeZone::LeapSeconds> leapSecondChanges () const;
    KTimeZone::LeapSeconds leapSecondChange (const QDateTime&) const;

protected:
    void                 setPhases (const QList<KTimeZone::Phase>&, int);
    void                 setTransitions (const QList<KTimeZone::Transition>&);
    void                 setLeapSecondChanges (const QList<KTimeZone::LeapSeconds>&);

};  // class KTimeZoneData


