1 /***************************************************************************
2 * Copyright (C) 2007-2008 by Riccardo Iaconelli <riccardo@kde.org> *
3 * Copyright (C) 2007-2008 by Sebastian Kuegler <sebas@kde.org> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
19 ***************************************************************************/
24 #include <QtCore/QTime>
25 #include <QtCore/QDate>
27 #include <KDE/Plasma/DataEngine>
28 #include <KDE/Plasma/Dialog>
29 #include <KDE/Plasma/PopupApplet>
30 #include <KDE/Plasma/ToolTipManager>
32 #include "plasmaclock_export.h"
42 class PLASMACLOCK_EXPORT ClockApplet
: public Plasma::PopupApplet
46 ClockApplet(QObject
*parent
, const QVariantList
&args
);
51 QString
currentTimezone() const;
52 QString
prettyTimezone() const;
53 bool isLocalTimezone() const;
54 QStringList
getSelectedTimezones() const;
55 bool shouldDisplayTimezone() const;
57 static QString
localTimezone();
58 static QString
localTimezoneUntranslated();
61 void toolTipAboutToShow();
65 virtual void createClockConfigurationInterface(KConfigDialog
*parent
);
66 virtual void clockConfigAccepted();
67 virtual void changeEngineTimezone(const QString
&oldTimezone
, const QString
&newTimezone
);
68 virtual Plasma::ToolTipContent
toolTipContent();
69 void wheelEvent(QGraphicsSceneWheelEvent
*event
);
70 void createConfigurationInterface(KConfigDialog
*parent
);
71 void initExtenderItem(Plasma::ExtenderItem
*item
);
72 void updateTipContent();
73 void popupEvent(bool show
);
76 void setCurrentTimezone(const QString
&tz
);
77 void configAccepted();
78 void updateClockDefaultsTo();
84 Q_PRIVATE_SLOT(d
, void createCalendar())