// Copyright 2010 Simon Edwards <simon@simonzone.com>

//                 Generated by twine2

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

// This program 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 Library General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

class KDateTimeEdit : QWidget
{
%TypeHeaderCode
#include <kdatetimeedit.h>
%End

public:
    enum Option
    {
        ShowCalendar,
        ShowDate,
        ShowTime,
        ShowTimeSpec,
        EditDate,
        EditTime,
        SelectCalendar,
        SelectDate,
        SelectTime,
        SelectTimeSpec,
        DatePicker,
        DateKeywords,
        ForceTime,
        WarnOnInvalid
    };
    typedef QFlags<KDateTimeEdit::Option> Options;
    explicit                KDateTimeEdit (QWidget* parent /TransferThis/ = 0);
    virtual ~KDateTimeEdit ();
    KDateTime               dateTime () const;
    QDate                   date () const;
//ig    const KCalendarSystem*  calendar () const;
    QTime                   time () const;
    KDateTime::Spec         timeSpec () const;
    KDateTime               minimumDateTime () const;
    KDateTime               maximumDateTime () const;
//ig    KLocale::DateFormat     dateDisplayFormat ();
//ig    KLocale::TimeFormatOptions  timeDisplayFormat ();
    QMap<QDate,QString>     dateMap () const;
    QList<QTime>            timeList () const;
    bool                    isValid () const;
    KDateTimeEdit::Options  options () const;
//ig    void                    setDateDisplayFormat (KLocale::DateFormat format);
    void                    resetMinimumDateTime ();
    void                    resetMaximumDateTime ();
    void                    resetDateTimeRange ();
    void                    setCalendar (KCalendarSystem* calendar = 0);
    void                    setTimeZones (const KTimeZones::ZoneMap& zones);
signals:
    void                    dateTimeEntered (const KDateTime& dateTime);
    void                    dateTimeChanged (const KDateTime& dateTime);
    void                    dateTimeEdited (const KDateTime& dateTime);
    void                    dateEntered (const QDate& date);
    void                    dateChanged (const QDate& date);
    void                    dateEdited (const QDate& date);
    void                    timeEntered (const QTime& time);
    void                    timeChanged (const QTime& time);
    void                    timeEdited (const QTime& time);
    void                    timeSpecEntered (const KDateTime::Spec& spec);
    void                    timeSpecChanged (const KDateTime::Spec& spec);
public:
    void                    setDateTime (const KDateTime& dateTime);
    void                    setDate (const QDate& date);
    void                    setCalendarSystem (KLocale::CalendarSystem calendarSystem);
    void                    setTime (const QTime& time);
    void                    setTimeSpec (const KDateTime::Spec& spec);
    void                    setDateTimeRange (const KDateTime& minDateTime, const KDateTime& maxDateTime, const QString& minWarnMsg = QString(), const QString& maxWarnMsg = QString());
    void                    setMinimumDateTime (const KDateTime& minDateTime, const QString& minWarnMsg = QString());
    void                    setMaximumDateTime (const KDateTime& maxDateTime, const QString& maxWarnMsg = QString());
    void                    setDateDisplayFormat (KLocale::DateFormat format);
    void                    setDateMap (QMap<QDate,QString> dateMap);
    void                    setTimeDisplayFormat (KLocale::TimeFormatOptions formatOptions);
    void                    setTimeList (QList<QTime> timeList, const QString& minWarnMsg = QString(), const QString& maxWarnMsg = QString());
protected:
    virtual bool            eventFilter (QObject* object, QEvent* event);
    virtual void            focusInEvent (QFocusEvent* event);
    virtual void            focusOutEvent (QFocusEvent* event);
    virtual void            resizeEvent (QResizeEvent* event);
    virtual void            assignDateTime (const KDateTime& dateTime);
    virtual void            assignDate (const QDate& date);
    void                    assignCalendarSystem (KLocale::CalendarSystem calendarSystem);
    virtual void            assignTime (const QTime& time);
//ig    void                    assignTimeSpec (const KDateTime::Spec& spec);
public:
    int                     timeListInterval () const;
    bool                    isValidDate () const;
    bool                    isValidTime () const;
    void                    setCalendarSystemsList (QList<KLocale::CalendarSystem> calendars);
    void                    setTimeListInterval (int minutes);
signals:
    void                    calendarEntered (KLocale::CalendarSystem calendarSystem);
    void                    calendarChanged (KLocale::CalendarSystem calendarSystem);
public:
    void                    setOptions (KDateTimeEdit::Options options);
    KLocale::CalendarSystem  calendarSystem () const;
    QList<KLocale::CalendarSystem>  calendarSystemsList () const;
    KLocale::DateFormat     dateDisplayFormat () const;
    KLocale::TimeFormatOptions  timeDisplayFormat () const;
    KTimeZones::ZoneMap     timeZones () const;
    bool                    isNull () const;
    bool                    isNullDate () const;
    bool                    isNullTime () const;
};
