[ca90cb1] | 1 | /* |
---|
| 2 | * Copyright (C) 2010 Ixonos Plc. |
---|
| 3 | * |
---|
| 4 | * This file is part of fosdem-schedule. |
---|
| 5 | * |
---|
| 6 | * fosdem-schedule is free software: you can redistribute it and/or modify it |
---|
| 7 | * under the terms of the GNU General Public License as published by the Free |
---|
| 8 | * Software Foundation, either version 2 of the License, or (at your option) |
---|
| 9 | * any later version. |
---|
| 10 | * |
---|
| 11 | * fosdem-schedule is distributed in the hope that it will be useful, but |
---|
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
---|
| 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
| 14 | * more details. |
---|
| 15 | * |
---|
| 16 | * You should have received a copy of the GNU General Public License along with |
---|
| 17 | * fosdem-schedule. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | */ |
---|
[969a840] | 19 | #ifndef DAYNAVIGATORWIDGET_H |
---|
| 20 | #define DAYNAVIGATORWIDGET_H |
---|
| 21 | |
---|
| 22 | #include "ui_daynavigatorwidget.h" |
---|
| 23 | #include <QObject> |
---|
| 24 | #include <QDate> |
---|
| 25 | |
---|
[5992909] | 26 | /*#include <QPainter>*/ |
---|
| 27 | /*#include <QLabel>*/ |
---|
| 28 | |
---|
| 29 | /*class QFontMetrics;*/ |
---|
| 30 | |
---|
| 31 | /*class VerticalLabel : public QWidget*/ |
---|
| 32 | /*{*/ |
---|
| 33 | |
---|
| 34 | /*public:*/ |
---|
| 35 | /*VerticalLabel(QWidget *aParent = NULL)*/ |
---|
| 36 | /*: QWidget(aParent)*/ |
---|
| 37 | /*, mText("")*/ |
---|
| 38 | /*{*/ |
---|
| 39 | /*mFont = QLabel().font();*/ |
---|
| 40 | /*} */ |
---|
| 41 | |
---|
| 42 | /*void paintEvent(QPaintEvent *)*/ |
---|
| 43 | /*{ */ |
---|
| 44 | /*QPainter p(this);*/ |
---|
| 45 | /*drawRotatedText(&p, 270, width()/2, height()/2, mText);*/ |
---|
| 46 | /*} */ |
---|
| 47 | |
---|
| 48 | /*void drawRotatedText(QPainter *aPainter, qreal aDegrees, int x, int y, const QString &aText)*/ |
---|
| 49 | /*{ */ |
---|
| 50 | |
---|
| 51 | /*aPainter->save();*/ |
---|
| 52 | /*aPainter->setFont(mFont);*/ |
---|
| 53 | /*aPainter->translate(x, y); */ |
---|
| 54 | /*aPainter->rotate(aDegrees);*/ |
---|
| 55 | /*QFontMetrics fm(mFont);*/ |
---|
| 56 | /*QRect r = fm.boundingRect(aText);*/ |
---|
| 57 | /*aPainter->drawText(-r.width()/2, fm.descent()/2, aText);*/ |
---|
| 58 | /*aPainter->restore();*/ |
---|
| 59 | /*} */ |
---|
| 60 | |
---|
| 61 | /*void setText(const QString &aText)*/ |
---|
| 62 | /*{*/ |
---|
| 63 | /*mText = aText;*/ |
---|
| 64 | /*update();*/ |
---|
| 65 | /*}*/ |
---|
| 66 | |
---|
| 67 | /*private:*/ |
---|
| 68 | /*QString mText;*/ |
---|
| 69 | /*QFont mFont;*/ |
---|
| 70 | /*};*/ |
---|
| 71 | |
---|
[f6300c7] | 72 | class DayNavigatorWidget : public QWidget, private Ui::DayNavigatorWidget |
---|
[969a840] | 73 | { |
---|
| 74 | Q_OBJECT |
---|
| 75 | public: |
---|
| 76 | DayNavigatorWidget(QWidget *aParent = NULL); |
---|
| 77 | ~DayNavigatorWidget() {} |
---|
| 78 | void setDates(const QDate &aStartDate, const QDate &aEndDate); |
---|
[5992909] | 79 | protected: |
---|
| 80 | void paintEvent(QPaintEvent *); |
---|
[969a840] | 81 | private slots: |
---|
| 82 | void prevDayButtonClicked(); |
---|
| 83 | void nextDayButtonClicked(); |
---|
| 84 | signals: |
---|
| 85 | void dateChanged(const QDate &aDate); |
---|
| 86 | private: |
---|
| 87 | QDate mStartDate; |
---|
| 88 | QDate mEndDate; |
---|
| 89 | QDate mCurDate; |
---|
[5992909] | 90 | QFontMetrics *mFontMetrics; |
---|
[969a840] | 91 | }; |
---|
| 92 | |
---|
| 93 | #endif /* DAYNAVIGATORWIDGET_H */ |
---|
| 94 | |
---|