// qcalendarwidget.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied 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 // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. %If (Qt_4_2_0 -) class QCalendarWidget : QWidget { %TypeHeaderCode #include %End public: enum HorizontalHeaderFormat { NoHorizontalHeader, SingleLetterDayNames, ShortDayNames, LongDayNames, }; enum VerticalHeaderFormat { NoVerticalHeader, ISOWeekNumbers, }; enum SelectionMode { NoSelection, SingleSelection, }; explicit QCalendarWidget(QWidget *parent /TransferThis/ = 0); virtual ~QCalendarWidget(); virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; QDate selectedDate() const; int yearShown() const; int monthShown() const; QDate minimumDate() const; void setMinimumDate(const QDate &date); QDate maximumDate() const; void setMaximumDate(const QDate &date); Qt::DayOfWeek firstDayOfWeek() const; void setFirstDayOfWeek(Qt::DayOfWeek dayOfWeek); bool isHeaderVisible() const; void setHeaderVisible(bool show); bool isGridVisible() const; void setGridVisible(bool show); QCalendarWidget::SelectionMode selectionMode() const; void setSelectionMode(QCalendarWidget::SelectionMode mode); QCalendarWidget::HorizontalHeaderFormat horizontalHeaderFormat() const; void setHorizontalHeaderFormat(QCalendarWidget::HorizontalHeaderFormat format); QCalendarWidget::VerticalHeaderFormat verticalHeaderFormat() const; void setVerticalHeaderFormat(QCalendarWidget::VerticalHeaderFormat format); QTextCharFormat headerTextFormat() const; void setHeaderTextFormat(const QTextCharFormat &format); QTextCharFormat weekdayTextFormat(Qt::DayOfWeek dayOfWeek) const; void setWeekdayTextFormat(Qt::DayOfWeek dayOfWeek, const QTextCharFormat &format); QMap dateTextFormat() const; QTextCharFormat dateTextFormat(const QDate &date) const; void setDateTextFormat(const QDate &date, const QTextCharFormat &color); protected: virtual bool event(QEvent *event); virtual void mousePressEvent(QMouseEvent *event); virtual void resizeEvent(QResizeEvent *event); virtual void keyPressEvent(QKeyEvent *event); virtual void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const; public slots: void setCurrentPage(int year, int month); void setDateRange(const QDate &min, const QDate &max); void setSelectedDate(const QDate &date); void showNextMonth(); void showNextYear(); void showPreviousMonth(); void showPreviousYear(); void showSelectedDate(); void showToday(); signals: void activated(const QDate &date); void clicked(const QDate &date); void currentPageChanged(int year, int month); void selectionChanged(); public: %If (Qt_4_3_0 -) bool isNavigationBarVisible() const; %End %If (Qt_4_3_0 -) bool isDateEditEnabled() const; %End %If (Qt_4_3_0 -) void setDateEditEnabled(bool enable); %End %If (Qt_4_3_0 -) int dateEditAcceptDelay() const; %End %If (Qt_4_3_0 -) void setDateEditAcceptDelay(int delay); %End public slots: %If (Qt_4_3_0 -) void setNavigationBarVisible(bool visible); %End private: QCalendarWidget(const QCalendarWidget &); }; %End