add more spacing
[personal-kdebase.git] / workspace / libs / plasmaclock / calendar.h
blob65c75fd8f857166ec2aec21d2bebd394f63a8f13
1 /*
2 * Copyright 2008 Davide Bettio <davide.bettio@kdemail.net>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef PLASMA_CALENDAR_H
21 #define PLASMA_CALENDAR_H
23 #include <QtGui/QGraphicsWidget>
25 #include "plasmaclock_export.h"
27 #include "calendartable.h"
29 class KCalendarSystem;
31 namespace Plasma
34 class CalendarTable;
35 class CalendarPrivate;
37 class PLASMACLOCK_EXPORT Calendar : public QGraphicsWidget
39 Q_OBJECT
41 public:
42 explicit Calendar(QGraphicsWidget *parent = 0);
43 Calendar(const QDate &, QGraphicsWidget *parent = 0);
44 ~Calendar();
46 const KCalendarSystem *calendar () const;
48 bool setDate(const QDate &date);
49 const QDate& date() const;
51 bool setCalendar(KCalendarSystem *calendar = 0);
53 CalendarTable *calendarTable() const;
55 Q_SIGNALS:
56 void dateChanged(const QDate &cur, const QDate &old);
57 void dateChanged(const QDate &date);
58 void tableClicked();
60 private Q_SLOTS:
61 void prevMonth();
62 void nextMonth();
63 void dateUpdated(const QDate &date);
64 void goToToday();
65 void goToWeek(int week);
66 void goToMonth(int year, int month);
67 void manualDateChange();
68 void monthsPopup();
69 void monthTriggered();
70 void showYearSpinBox();
71 void hideYearSpinBox();
73 private:
74 CalendarPrivate* const d;
79 #endif